diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-08-22 12:20:14 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-08-23 10:18:17 -0400 |
commit | bd3f79b71de0410352ab506496a467fcb0620912 (patch) | |
tree | 329d52717cb1b04702af154db05eb766c04473cc | |
parent | a8636c0b2e57d4f31f71aa306b1ee701db3f3c85 (diff) |
xen: Introduce xen_pfn_t for pfn and mfn types
All the original Xen headers have xen_pfn_t as mfn and pfn type, however
when they have been imported in Linux, xen_pfn_t has been replaced with
unsigned long. That might work for x86 and ia64 but it does not for arm.
Bring back xen_pfn_t and let each architecture define xen_pfn_t as they
see fit.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r-- | arch/ia64/include/asm/xen/interface.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/xen/interface.h | 5 | ||||
-rw-r--r-- | include/xen/interface/grant_table.h | 4 | ||||
-rw-r--r-- | include/xen/interface/memory.h | 6 | ||||
-rw-r--r-- | include/xen/interface/platform.h | 4 | ||||
-rw-r--r-- | include/xen/interface/xen.h | 6 | ||||
-rw-r--r-- | include/xen/privcmd.h | 2 |
7 files changed, 19 insertions, 13 deletions
diff --git a/arch/ia64/include/asm/xen/interface.h b/arch/ia64/include/asm/xen/interface.h index ee9cad6e749b..3d52a5bbd857 100644 --- a/arch/ia64/include/asm/xen/interface.h +++ b/arch/ia64/include/asm/xen/interface.h | |||
@@ -67,6 +67,10 @@ | |||
67 | #define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) | 67 | #define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) |
68 | 68 | ||
69 | #ifndef __ASSEMBLY__ | 69 | #ifndef __ASSEMBLY__ |
70 | /* Explicitly size integers that represent pfns in the public interface | ||
71 | * with Xen so that we could have one ABI that works for 32 and 64 bit | ||
72 | * guests. */ | ||
73 | typedef unsigned long xen_pfn_t; | ||
70 | /* Guest handles for primitive C types. */ | 74 | /* Guest handles for primitive C types. */ |
71 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); | 75 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); |
72 | __DEFINE_GUEST_HANDLE(uint, unsigned int); | 76 | __DEFINE_GUEST_HANDLE(uint, unsigned int); |
@@ -79,7 +83,6 @@ DEFINE_GUEST_HANDLE(void); | |||
79 | DEFINE_GUEST_HANDLE(uint64_t); | 83 | DEFINE_GUEST_HANDLE(uint64_t); |
80 | DEFINE_GUEST_HANDLE(uint32_t); | 84 | DEFINE_GUEST_HANDLE(uint32_t); |
81 | 85 | ||
82 | typedef unsigned long xen_pfn_t; | ||
83 | DEFINE_GUEST_HANDLE(xen_pfn_t); | 86 | DEFINE_GUEST_HANDLE(xen_pfn_t); |
84 | #define PRI_xen_pfn "lx" | 87 | #define PRI_xen_pfn "lx" |
85 | #endif | 88 | #endif |
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h index a93db16e9582..555f94d3637b 100644 --- a/arch/x86/include/asm/xen/interface.h +++ b/arch/x86/include/asm/xen/interface.h | |||
@@ -47,6 +47,10 @@ | |||
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #ifndef __ASSEMBLY__ | 49 | #ifndef __ASSEMBLY__ |
50 | /* Explicitly size integers that represent pfns in the public interface | ||
51 | * with Xen so that on ARM we can have one ABI that works for 32 and 64 | ||
52 | * bit guests. */ | ||
53 | typedef unsigned long xen_pfn_t; | ||
50 | /* Guest handles for primitive C types. */ | 54 | /* Guest handles for primitive C types. */ |
51 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); | 55 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); |
52 | __DEFINE_GUEST_HANDLE(uint, unsigned int); | 56 | __DEFINE_GUEST_HANDLE(uint, unsigned int); |
@@ -57,6 +61,7 @@ DEFINE_GUEST_HANDLE(long); | |||
57 | DEFINE_GUEST_HANDLE(void); | 61 | DEFINE_GUEST_HANDLE(void); |
58 | DEFINE_GUEST_HANDLE(uint64_t); | 62 | DEFINE_GUEST_HANDLE(uint64_t); |
59 | DEFINE_GUEST_HANDLE(uint32_t); | 63 | DEFINE_GUEST_HANDLE(uint32_t); |
64 | DEFINE_GUEST_HANDLE(xen_pfn_t); | ||
60 | #endif | 65 | #endif |
61 | 66 | ||
62 | #ifndef HYPERVISOR_VIRT_START | 67 | #ifndef HYPERVISOR_VIRT_START |
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h index a17d84433e6a..7da811bdd558 100644 --- a/include/xen/interface/grant_table.h +++ b/include/xen/interface/grant_table.h | |||
@@ -338,7 +338,7 @@ DEFINE_GUEST_HANDLE_STRUCT(gnttab_dump_table); | |||
338 | #define GNTTABOP_transfer 4 | 338 | #define GNTTABOP_transfer 4 |
339 | struct gnttab_transfer { | 339 | struct gnttab_transfer { |
340 | /* IN parameters. */ | 340 | /* IN parameters. */ |
341 | unsigned long mfn; | 341 | xen_pfn_t mfn; |
342 | domid_t domid; | 342 | domid_t domid; |
343 | grant_ref_t ref; | 343 | grant_ref_t ref; |
344 | /* OUT parameters. */ | 344 | /* OUT parameters. */ |
@@ -375,7 +375,7 @@ struct gnttab_copy { | |||
375 | struct { | 375 | struct { |
376 | union { | 376 | union { |
377 | grant_ref_t ref; | 377 | grant_ref_t ref; |
378 | unsigned long gmfn; | 378 | xen_pfn_t gmfn; |
379 | } u; | 379 | } u; |
380 | domid_t domid; | 380 | domid_t domid; |
381 | uint16_t offset; | 381 | uint16_t offset; |
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index 8d4efc1cc64a..d8e33a93ea4d 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -31,7 +31,7 @@ struct xen_memory_reservation { | |||
31 | * OUT: GMFN bases of extents that were allocated | 31 | * OUT: GMFN bases of extents that were allocated |
32 | * (NB. This command also updates the mach_to_phys translation table) | 32 | * (NB. This command also updates the mach_to_phys translation table) |
33 | */ | 33 | */ |
34 | GUEST_HANDLE(ulong) extent_start; | 34 | GUEST_HANDLE(xen_pfn_t) extent_start; |
35 | 35 | ||
36 | /* Number of extents, and size/alignment of each (2^extent_order pages). */ | 36 | /* Number of extents, and size/alignment of each (2^extent_order pages). */ |
37 | unsigned long nr_extents; | 37 | unsigned long nr_extents; |
@@ -130,7 +130,7 @@ struct xen_machphys_mfn_list { | |||
130 | * any large discontiguities in the machine address space, 2MB gaps in | 130 | * any large discontiguities in the machine address space, 2MB gaps in |
131 | * the machphys table will be represented by an MFN base of zero. | 131 | * the machphys table will be represented by an MFN base of zero. |
132 | */ | 132 | */ |
133 | GUEST_HANDLE(ulong) extent_start; | 133 | GUEST_HANDLE(xen_pfn_t) extent_start; |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Number of extents written to the above array. This will be smaller | 136 | * Number of extents written to the above array. This will be smaller |
@@ -175,7 +175,7 @@ struct xen_add_to_physmap { | |||
175 | unsigned long idx; | 175 | unsigned long idx; |
176 | 176 | ||
177 | /* GPFN where the source mapping page should appear. */ | 177 | /* GPFN where the source mapping page should appear. */ |
178 | unsigned long gpfn; | 178 | xen_pfn_t gpfn; |
179 | }; | 179 | }; |
180 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); | 180 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); |
181 | 181 | ||
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 486653f0dd8f..0bea47027fa2 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h | |||
@@ -54,7 +54,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_settime_t); | |||
54 | #define XENPF_add_memtype 31 | 54 | #define XENPF_add_memtype 31 |
55 | struct xenpf_add_memtype { | 55 | struct xenpf_add_memtype { |
56 | /* IN variables. */ | 56 | /* IN variables. */ |
57 | unsigned long mfn; | 57 | xen_pfn_t mfn; |
58 | uint64_t nr_mfns; | 58 | uint64_t nr_mfns; |
59 | uint32_t type; | 59 | uint32_t type; |
60 | /* OUT variables. */ | 60 | /* OUT variables. */ |
@@ -84,7 +84,7 @@ struct xenpf_read_memtype { | |||
84 | /* IN variables. */ | 84 | /* IN variables. */ |
85 | uint32_t reg; | 85 | uint32_t reg; |
86 | /* OUT variables. */ | 86 | /* OUT variables. */ |
87 | unsigned long mfn; | 87 | xen_pfn_t mfn; |
88 | uint64_t nr_mfns; | 88 | uint64_t nr_mfns; |
89 | uint32_t type; | 89 | uint32_t type; |
90 | }; | 90 | }; |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index 3871e4753680..42834a36d345 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
@@ -188,7 +188,7 @@ struct mmuext_op { | |||
188 | unsigned int cmd; | 188 | unsigned int cmd; |
189 | union { | 189 | union { |
190 | /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */ | 190 | /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */ |
191 | unsigned long mfn; | 191 | xen_pfn_t mfn; |
192 | /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */ | 192 | /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */ |
193 | unsigned long linear_addr; | 193 | unsigned long linear_addr; |
194 | } arg1; | 194 | } arg1; |
@@ -428,11 +428,11 @@ struct start_info { | |||
428 | unsigned long nr_pages; /* Total pages allocated to this domain. */ | 428 | unsigned long nr_pages; /* Total pages allocated to this domain. */ |
429 | unsigned long shared_info; /* MACHINE address of shared info struct. */ | 429 | unsigned long shared_info; /* MACHINE address of shared info struct. */ |
430 | uint32_t flags; /* SIF_xxx flags. */ | 430 | uint32_t flags; /* SIF_xxx flags. */ |
431 | unsigned long store_mfn; /* MACHINE page number of shared page. */ | 431 | xen_pfn_t store_mfn; /* MACHINE page number of shared page. */ |
432 | uint32_t store_evtchn; /* Event channel for store communication. */ | 432 | uint32_t store_evtchn; /* Event channel for store communication. */ |
433 | union { | 433 | union { |
434 | struct { | 434 | struct { |
435 | unsigned long mfn; /* MACHINE page number of console page. */ | 435 | xen_pfn_t mfn; /* MACHINE page number of console page. */ |
436 | uint32_t evtchn; /* Event channel for console page. */ | 436 | uint32_t evtchn; /* Event channel for console page. */ |
437 | } domU; | 437 | } domU; |
438 | struct { | 438 | struct { |
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h index 4d588814510b..45c1aa14b83d 100644 --- a/include/xen/privcmd.h +++ b/include/xen/privcmd.h | |||
@@ -37,8 +37,6 @@ | |||
37 | #include <linux/compiler.h> | 37 | #include <linux/compiler.h> |
38 | #include <xen/interface/xen.h> | 38 | #include <xen/interface/xen.h> |
39 | 39 | ||
40 | typedef unsigned long xen_pfn_t; | ||
41 | |||
42 | struct privcmd_hypercall { | 40 | struct privcmd_hypercall { |
43 | __u64 op; | 41 | __u64 op; |
44 | __u64 arg[5]; | 42 | __u64 arg[5]; |