diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-04-02 13:53:59 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 17:57:32 -0400 |
commit | 5f0ababbf49f12330effab932a18055a50f4c0a1 (patch) | |
tree | e6f991570835c7e22646f89db979508d0ca5c93e | |
parent | 20e71f2edb5991de8f2a70902b4aa5982f67c69c (diff) |
xen: replace callers of alloc_vm_area()/free_vm_area() with xen_ prefixed one
Don't use alloc_vm_area()/free_vm_area() directly, instead define
xen_alloc_vm_area()/xen_free_vm_area() and use them.
alloc_vm_area()/free_vm_area() are used to allocate/free area which
are for grant table mapping. Xen/x86 grant table is based on virtual
address so that alloc_vm_area()/free_vm_area() are suitable.
On the other hand Xen/ia64 (and Xen/powerpc) grant table is based on
pseudo physical address (guest physical address) so that allocation
should be done differently.
The original version of xenified Linux/IA64 have its own
allocate_vm_area()/free_vm_area() definitions which don't allocate vm area
contradictory to those names.
Now vanilla Linux already has its definitions so that it's impossible
to have IA64 definitions of allocate_vm_area()/free_vm_area().
Instead introduce xen_allocate_vm_area()/xen_free_vm_area() and use them.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/xen/grant-table.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 6 | ||||
-rw-r--r-- | include/asm-x86/xen/grant_table.h | 7 | ||||
-rw-r--r-- | include/xen/grant_table.h | 1 |
4 files changed, 12 insertions, 4 deletions
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index d4a89b3d694f..3e02808c4055 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
@@ -482,7 +482,7 @@ static int gnttab_map(unsigned int start_idx, unsigned int end_idx) | |||
482 | 482 | ||
483 | if (shared == NULL) { | 483 | if (shared == NULL) { |
484 | struct vm_struct *area; | 484 | struct vm_struct *area; |
485 | area = alloc_vm_area(PAGE_SIZE * max_nr_grant_frames()); | 485 | area = xen_alloc_vm_area(PAGE_SIZE * max_nr_grant_frames()); |
486 | BUG_ON(area == NULL); | 486 | BUG_ON(area == NULL); |
487 | shared = area->addr; | 487 | shared = area->addr; |
488 | } | 488 | } |
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 9fd2f70ab46d..0f86b0ff7879 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c | |||
@@ -399,7 +399,7 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr) | |||
399 | 399 | ||
400 | *vaddr = NULL; | 400 | *vaddr = NULL; |
401 | 401 | ||
402 | area = alloc_vm_area(PAGE_SIZE); | 402 | area = xen_alloc_vm_area(PAGE_SIZE); |
403 | if (!area) | 403 | if (!area) |
404 | return -ENOMEM; | 404 | return -ENOMEM; |
405 | 405 | ||
@@ -409,7 +409,7 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr) | |||
409 | BUG(); | 409 | BUG(); |
410 | 410 | ||
411 | if (op.status != GNTST_okay) { | 411 | if (op.status != GNTST_okay) { |
412 | free_vm_area(area); | 412 | xen_free_vm_area(area); |
413 | xenbus_dev_fatal(dev, op.status, | 413 | xenbus_dev_fatal(dev, op.status, |
414 | "mapping in shared page %d from domain %d", | 414 | "mapping in shared page %d from domain %d", |
415 | gnt_ref, dev->otherend_id); | 415 | gnt_ref, dev->otherend_id); |
@@ -508,7 +508,7 @@ int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr) | |||
508 | BUG(); | 508 | BUG(); |
509 | 509 | ||
510 | if (op.status == GNTST_okay) | 510 | if (op.status == GNTST_okay) |
511 | free_vm_area(area); | 511 | xen_free_vm_area(area); |
512 | else | 512 | else |
513 | xenbus_dev_error(dev, op.status, | 513 | xenbus_dev_error(dev, op.status, |
514 | "unmapping page at handle %d error %d", | 514 | "unmapping page at handle %d error %d", |
diff --git a/include/asm-x86/xen/grant_table.h b/include/asm-x86/xen/grant_table.h new file mode 100644 index 000000000000..2444d4593a3b --- /dev/null +++ b/include/asm-x86/xen/grant_table.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __XEN_GRANT_TABLE_H | ||
2 | #define __XEN_GRANT_TABLE_H | ||
3 | |||
4 | #define xen_alloc_vm_area(size) alloc_vm_area(size) | ||
5 | #define xen_free_vm_area(area) free_vm_area(area) | ||
6 | |||
7 | #endif /* __XEN_GRANT_TABLE_H */ | ||
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 761c83498e03..d2822920d43e 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
@@ -39,6 +39,7 @@ | |||
39 | 39 | ||
40 | #include <asm/xen/hypervisor.h> | 40 | #include <asm/xen/hypervisor.h> |
41 | #include <xen/interface/grant_table.h> | 41 | #include <xen/interface/grant_table.h> |
42 | #include <asm/xen/grant_table.h> | ||
42 | 43 | ||
43 | /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ | 44 | /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */ |
44 | #define NR_GRANT_FRAMES 4 | 45 | #define NR_GRANT_FRAMES 4 |