aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-09-14 09:34:43 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-09-14 09:34:43 -0400
commit256f631f1f7e7bedc882510679ad4473a2274708 (patch)
tree16deef95ae59e6fdf63fa3707cf07ac4df1d4d27
parent2e01f16601d8924b12b1acf1cdc49a0d1cc1cfb2 (diff)
xen/arm: Introduce xen_ulong_t for unsigned long
All the original Xen headers have xen_ulong_t as unsigned long type, however when they have been imported in Linux, xen_ulong_t has been replaced with unsigned long. That might work for x86 and ia64 but it does not for arm. Bring back xen_ulong_t and let each architecture define xen_ulong_t as they see fit. Also explicitly size pointers (__DEFINE_GUEST_HANDLE) to 64 bit. Changes in v3: - remove the incorrect changes to multicall_entry; - remove the change to apic_physbase. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r--arch/arm/include/asm/xen/interface.h8
-rw-r--r--arch/ia64/include/asm/xen/interface.h1
-rw-r--r--arch/x86/include/asm/xen/interface.h1
-rw-r--r--include/xen/interface/memory.h12
-rw-r--r--include/xen/interface/physdev.h2
-rw-r--r--include/xen/interface/version.h2
6 files changed, 16 insertions, 10 deletions
diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h
index 74c72b5083a6..ae05e56dd17d 100644
--- a/arch/arm/include/asm/xen/interface.h
+++ b/arch/arm/include/asm/xen/interface.h
@@ -9,8 +9,11 @@
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11 11
12#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
13
12#define __DEFINE_GUEST_HANDLE(name, type) \ 14#define __DEFINE_GUEST_HANDLE(name, type) \
13 typedef type * __guest_handle_ ## name 15 typedef struct { union { type *p; uint64_aligned_t q; }; } \
16 __guest_handle_ ## name
14 17
15#define DEFINE_GUEST_HANDLE_STRUCT(name) \ 18#define DEFINE_GUEST_HANDLE_STRUCT(name) \
16 __DEFINE_GUEST_HANDLE(name, struct name) 19 __DEFINE_GUEST_HANDLE(name, struct name)
@@ -21,13 +24,14 @@
21 do { \ 24 do { \
22 if (sizeof(hnd) == 8) \ 25 if (sizeof(hnd) == 8) \
23 *(uint64_t *)&(hnd) = 0; \ 26 *(uint64_t *)&(hnd) = 0; \
24 (hnd) = val; \ 27 (hnd).p = val; \
25 } while (0) 28 } while (0)
26 29
27#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
28/* Explicitly size integers that represent pfns in the interface with 31/* Explicitly size integers that represent pfns in the interface with
29 * Xen so that we can have one ABI that works for 32 and 64 bit guests. */ 32 * Xen so that we can have one ABI that works for 32 and 64 bit guests. */
30typedef uint64_t xen_pfn_t; 33typedef uint64_t xen_pfn_t;
34typedef uint64_t xen_ulong_t;
31/* Guest handles for primitive C types. */ 35/* Guest handles for primitive C types. */
32__DEFINE_GUEST_HANDLE(uchar, unsigned char); 36__DEFINE_GUEST_HANDLE(uchar, unsigned char);
33__DEFINE_GUEST_HANDLE(uint, unsigned int); 37__DEFINE_GUEST_HANDLE(uint, unsigned int);
diff --git a/arch/ia64/include/asm/xen/interface.h b/arch/ia64/include/asm/xen/interface.h
index 3d52a5bbd857..e88c5de27410 100644
--- a/arch/ia64/include/asm/xen/interface.h
+++ b/arch/ia64/include/asm/xen/interface.h
@@ -71,6 +71,7 @@
71 * with Xen so that we could have one ABI that works for 32 and 64 bit 71 * with Xen so that we could have one ABI that works for 32 and 64 bit
72 * guests. */ 72 * guests. */
73typedef unsigned long xen_pfn_t; 73typedef unsigned long xen_pfn_t;
74typedef unsigned long xen_ulong_t;
74/* Guest handles for primitive C types. */ 75/* Guest handles for primitive C types. */
75__DEFINE_GUEST_HANDLE(uchar, unsigned char); 76__DEFINE_GUEST_HANDLE(uchar, unsigned char);
76__DEFINE_GUEST_HANDLE(uint, unsigned int); 77__DEFINE_GUEST_HANDLE(uint, unsigned int);
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h
index 555f94d3637b..28fc6211a79a 100644
--- a/arch/x86/include/asm/xen/interface.h
+++ b/arch/x86/include/asm/xen/interface.h
@@ -51,6 +51,7 @@
51 * with Xen so that on ARM we can have one ABI that works for 32 and 64 51 * with Xen so that on ARM we can have one ABI that works for 32 and 64
52 * bit guests. */ 52 * bit guests. */
53typedef unsigned long xen_pfn_t; 53typedef unsigned long xen_pfn_t;
54typedef unsigned long xen_ulong_t;
54/* Guest handles for primitive C types. */ 55/* Guest handles for primitive C types. */
55__DEFINE_GUEST_HANDLE(uchar, unsigned char); 56__DEFINE_GUEST_HANDLE(uchar, unsigned char);
56__DEFINE_GUEST_HANDLE(uint, unsigned int); 57__DEFINE_GUEST_HANDLE(uint, unsigned int);
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
index d8e33a93ea4d..b66d04ce6957 100644
--- a/include/xen/interface/memory.h
+++ b/include/xen/interface/memory.h
@@ -34,7 +34,7 @@ struct xen_memory_reservation {
34 GUEST_HANDLE(xen_pfn_t) 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 xen_ulong_t nr_extents;
38 unsigned int extent_order; 38 unsigned int extent_order;
39 39
40 /* 40 /*
@@ -92,7 +92,7 @@ struct xen_memory_exchange {
92 * command will be non-zero. 92 * command will be non-zero.
93 * 5. THIS FIELD MUST BE INITIALISED TO ZERO BY THE CALLER! 93 * 5. THIS FIELD MUST BE INITIALISED TO ZERO BY THE CALLER!
94 */ 94 */
95 unsigned long nr_exchanged; 95 xen_ulong_t nr_exchanged;
96}; 96};
97 97
98DEFINE_GUEST_HANDLE_STRUCT(xen_memory_exchange); 98DEFINE_GUEST_HANDLE_STRUCT(xen_memory_exchange);
@@ -148,8 +148,8 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list);
148 */ 148 */
149#define XENMEM_machphys_mapping 12 149#define XENMEM_machphys_mapping 12
150struct xen_machphys_mapping { 150struct xen_machphys_mapping {
151 unsigned long v_start, v_end; /* Start and end virtual addresses. */ 151 xen_ulong_t v_start, v_end; /* Start and end virtual addresses. */
152 unsigned long max_mfn; /* Maximum MFN that can be looked up. */ 152 xen_ulong_t max_mfn; /* Maximum MFN that can be looked up. */
153}; 153};
154DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mapping_t); 154DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mapping_t);
155 155
@@ -172,7 +172,7 @@ struct xen_add_to_physmap {
172 unsigned int space; 172 unsigned int space;
173 173
174 /* Index into source mapping space. */ 174 /* Index into source mapping space. */
175 unsigned long idx; 175 xen_ulong_t idx;
176 176
177 /* GPFN where the source mapping page should appear. */ 177 /* GPFN where the source mapping page should appear. */
178 xen_pfn_t gpfn; 178 xen_pfn_t gpfn;
@@ -189,7 +189,7 @@ struct xen_translate_gpfn_list {
189 domid_t domid; 189 domid_t domid;
190 190
191 /* Length of list. */ 191 /* Length of list. */
192 unsigned long nr_gpfns; 192 xen_ulong_t nr_gpfns;
193 193
194 /* List of GPFNs to translate. */ 194 /* List of GPFNs to translate. */
195 GUEST_HANDLE(ulong) gpfn_list; 195 GUEST_HANDLE(ulong) gpfn_list;
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index 9ce788d8cf49..f616514f781b 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -56,7 +56,7 @@ struct physdev_eoi {
56#define PHYSDEVOP_pirq_eoi_gmfn_v2 28 56#define PHYSDEVOP_pirq_eoi_gmfn_v2 28
57struct physdev_pirq_eoi_gmfn { 57struct physdev_pirq_eoi_gmfn {
58 /* IN */ 58 /* IN */
59 unsigned long gmfn; 59 xen_ulong_t gmfn;
60}; 60};
61 61
62/* 62/*
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
index dd58cf5ea3e4..3030c81c09ce 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -45,7 +45,7 @@ struct xen_changeset_info {
45 45
46#define XENVER_platform_parameters 5 46#define XENVER_platform_parameters 5
47struct xen_platform_parameters { 47struct xen_platform_parameters {
48 unsigned long virt_start; 48 xen_ulong_t virt_start;
49}; 49};
50 50
51#define XENVER_get_features 6 51#define XENVER_get_features 6