aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenpaging
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-01-09 17:07:21 +0100
committerOlaf Hering <olaf@aepfle.de>2012-01-09 17:07:21 +0100
commit98eda193b6b358929423979b12a839f2d2c2e83a (patch)
treea54d617e534895d2effa83b3a01d54fc71067fd2 /tools/xenpaging
parent0e6f8cfd47ce649b0b633f9c03cea2108640de6a (diff)
downloadxen-98eda193b6b358929423979b12a839f2d2c2e83a.tar.gz
xen-98eda193b6b358929423979b12a839f2d2c2e83a.tar.bz2
xen-98eda193b6b358929423979b12a839f2d2c2e83a.zip
xenpaging: convert xenpaging_victim_t to struct victim
Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/xenpaging')
-rw-r--r--tools/xenpaging/policy.h2
-rw-r--r--tools/xenpaging/policy_default.c2
-rw-r--r--tools/xenpaging/xenpaging.c12
-rw-r--r--tools/xenpaging/xenpaging.h4
4 files changed, 9 insertions, 11 deletions
diff --git a/tools/xenpaging/policy.h b/tools/xenpaging/policy.h
index 458ed27ce5..27a5b2d2fc 100644
--- a/tools/xenpaging/policy.h
+++ b/tools/xenpaging/policy.h
@@ -29,7 +29,7 @@
int policy_init(xenpaging_t *paging);
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim);
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim);
void policy_notify_paged_out(unsigned long gfn);
void policy_notify_paged_in(unsigned long gfn);
void policy_notify_paged_in_nomru(unsigned long gfn);
diff --git a/tools/xenpaging/policy_default.c b/tools/xenpaging/policy_default.c
index e555ed4e59..bc1353e5cb 100644
--- a/tools/xenpaging/policy_default.c
+++ b/tools/xenpaging/policy_default.c
@@ -77,7 +77,7 @@ int policy_init(xenpaging_t *paging)
return rc;
}
-int policy_choose_victim(xenpaging_t *paging, xenpaging_victim_t *victim)
+int policy_choose_victim(xenpaging_t *paging, struct victim *victim)
{
xc_interface *xch = paging->xc_handle;
unsigned long wrap = current_gfn;
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index c7f153ef89..4b2589b21c 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -561,8 +561,7 @@ static void put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
RING_PUSH_RESPONSES(back_ring);
}
-static int xenpaging_evict_page(xenpaging_t *paging,
- xenpaging_victim_t *victim, int fd, int i)
+static int xenpaging_evict_page(xenpaging_t *paging, struct victim *victim, int fd, int i)
{
xc_interface *xch = paging->xc_handle;
void *page;
@@ -711,8 +710,7 @@ static void resume_pages(xenpaging_t *paging, int num_pages)
page_in_trigger();
}
-static int evict_victim(xenpaging_t *paging,
- xenpaging_victim_t *victim, int fd, int i)
+static int evict_victim(xenpaging_t *paging, struct victim *victim, int fd, int i)
{
xc_interface *xch = paging->xc_handle;
int j = 0;
@@ -755,7 +753,7 @@ static int evict_victim(xenpaging_t *paging,
}
/* Evict a batch of pages and write them to a free slot in the paging file */
-static int evict_pages(xenpaging_t *paging, int fd, xenpaging_victim_t *victims, int num_pages)
+static int evict_pages(xenpaging_t *paging, int fd, struct victim *victims, int num_pages)
{
xc_interface *xch = paging->xc_handle;
int rc, slot, num = 0;
@@ -782,7 +780,7 @@ int main(int argc, char *argv[])
{
struct sigaction act;
xenpaging_t *paging;
- xenpaging_victim_t *victims;
+ struct victim *victims;
mem_event_request_t req;
mem_event_response_t rsp;
int num, prev_num = 0;
@@ -816,7 +814,7 @@ int main(int argc, char *argv[])
}
/* Allocate upper limit of pages to allow growing and shrinking */
- victims = calloc(paging->max_pages, sizeof(xenpaging_victim_t));
+ victims = calloc(paging->max_pages, sizeof(struct victim));
if ( !victims )
goto out;
diff --git a/tools/xenpaging/xenpaging.h b/tools/xenpaging/xenpaging.h
index a25f1b64e4..4ac915da1c 100644
--- a/tools/xenpaging/xenpaging.h
+++ b/tools/xenpaging/xenpaging.h
@@ -57,10 +57,10 @@ typedef struct xenpaging {
} xenpaging_t;
-typedef struct xenpaging_victim {
+struct victim {
/* the gfn of the page to evict */
unsigned long gfn;
-} xenpaging_victim_t;
+};
extern void create_page_in_thread(xenpaging_t *paging);