From: Thomas Leonard Date: Thu, 26 Jun 2014 11:28:30 +0000 (+0100) Subject: mini-os: moved __pte to x86 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0f6413239cab88aed65b5483c5abf7572be0ef4e;p=people%2Fliuw%2Flibxenctrl-split%2Fmini-os.git mini-os: moved __pte to x86 We don't need to define this on ARM. Suggested by Julien Grall. Signed-off-by: Thomas Leonard Acked-by: Samuel Thibault --- diff --git a/include/types.h b/include/types.h index de356e8..93356fe 100644 --- a/include/types.h +++ b/include/types.h @@ -30,23 +30,11 @@ typedef unsigned long u_long; #ifdef __i386__ typedef long long quad_t; typedef unsigned long long u_quad_t; - -typedef struct { unsigned long pte_low, pte_high; } pte_t; - #elif defined(__x86_64__) typedef long quad_t; typedef unsigned long u_quad_t; - -typedef struct { unsigned long pte; } pte_t; #endif /* __i386__ || __x86_64__ */ -#ifdef __x86_64__ -#define __pte(x) ((pte_t) { (x) } ) -#else -#define __pte(x) ({ unsigned long long _x = (x); \ - ((pte_t) {(unsigned long)(_x), (unsigned long)(_x>>32)}); }) -#endif - #ifdef HAVE_LIBC #include #include diff --git a/include/x86/x86_32/hypercall-x86_32.h b/include/x86/x86_32/hypercall-x86_32.h index dcfbe41..99a4ee3 100644 --- a/include/x86/x86_32/hypercall-x86_32.h +++ b/include/x86/x86_32/hypercall-x86_32.h @@ -35,6 +35,11 @@ #include #include +typedef struct { unsigned long pte_low, pte_high; } pte_t; + +#define __pte(x) ({ unsigned long long _x = (x); \ + ((pte_t) {(unsigned long)(_x), (unsigned long)(_x>>32)}); }) + #define __STR(x) #x #define STR(x) __STR(x) diff --git a/include/x86/x86_64/hypercall-x86_64.h b/include/x86/x86_64/hypercall-x86_64.h index 7083763..e00b3bd 100644 --- a/include/x86/x86_64/hypercall-x86_64.h +++ b/include/x86/x86_64/hypercall-x86_64.h @@ -38,6 +38,10 @@ #include #include +typedef struct { unsigned long pte; } pte_t; + +#define __pte(x) ((pte_t) { (x) } ) + #define __STR(x) #x #define STR(x) __STR(x)