aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xg_private.h
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-09-23 14:43:52 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-09-23 14:43:52 +0100
commit2404d08913fa5f0d2e49cee083013fc36e529876 (patch)
tree3c62f03036327f0f0fc72d63d42680b2e1efb9ea /tools/libxc/xg_private.h
parentbdd477ad345e8e0ba6640ea480fa47a7c3d5fdf0 (diff)
downloadxen-2404d08913fa5f0d2e49cee083013fc36e529876.tar.gz
xen-2404d08913fa5f0d2e49cee083013fc36e529876.tar.bz2
xen-2404d08913fa5f0d2e49cee083013fc36e529876.zip
Make PAE defs in xg_private.h usable in both 32- and
64-bit builds. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/libxc/xg_private.h')
-rw-r--r--tools/libxc/xg_private.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index 3d3cceb326..186b68940a 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -28,25 +28,27 @@ unsigned long csum_page (void * page);
#define _PAGE_PSE 0x080
#define _PAGE_GLOBAL 0x100
-#if defined(__i386__)
-#define L1_PAGETABLE_SHIFT 12
-#define L2_PAGETABLE_SHIFT 22
#define L1_PAGETABLE_SHIFT_PAE 12
#define L2_PAGETABLE_SHIFT_PAE 21
#define L3_PAGETABLE_SHIFT_PAE 30
+
+#if defined(__i386__)
+#define L1_PAGETABLE_SHIFT 12
+#define L2_PAGETABLE_SHIFT 22
#elif defined(__x86_64__)
-#define L1_PAGETABLE_SHIFT 12
-#define L2_PAGETABLE_SHIFT 21
-#define L3_PAGETABLE_SHIFT 30
-#define L4_PAGETABLE_SHIFT 39
+#define L1_PAGETABLE_SHIFT 12
+#define L2_PAGETABLE_SHIFT 21
+#define L3_PAGETABLE_SHIFT 30
+#define L4_PAGETABLE_SHIFT 39
#endif
-#if defined(__i386__)
-#define ENTRIES_PER_L1_PAGETABLE 1024
-#define ENTRIES_PER_L2_PAGETABLE 1024
#define L1_PAGETABLE_ENTRIES_PAE 512
#define L2_PAGETABLE_ENTRIES_PAE 512
#define L3_PAGETABLE_ENTRIES_PAE 4
+
+#if defined(__i386__)
+#define L1_PAGETABLE_ENTRIES 1024
+#define L2_PAGETABLE_ENTRIES 1024
#elif defined(__x86_64__)
#define L1_PAGETABLE_ENTRIES 512
#define L2_PAGETABLE_ENTRIES 512
@@ -70,17 +72,18 @@ typedef unsigned long l3_pgentry_t;
typedef unsigned long l4_pgentry_t;
#endif
-#if defined(__i386__)
-#define l1_table_offset(_a) \
- (((_a) >> L1_PAGETABLE_SHIFT) & (ENTRIES_PER_L1_PAGETABLE - 1))
-#define l2_table_offset(_a) \
- ((_a) >> L2_PAGETABLE_SHIFT)
#define l1_table_offset_pae(_a) \
(((_a) >> L1_PAGETABLE_SHIFT_PAE) & (L1_PAGETABLE_ENTRIES_PAE - 1))
#define l2_table_offset_pae(_a) \
(((_a) >> L2_PAGETABLE_SHIFT_PAE) & (L2_PAGETABLE_ENTRIES_PAE - 1))
#define l3_table_offset_pae(_a) \
(((_a) >> L3_PAGETABLE_SHIFT_PAE) & (L3_PAGETABLE_ENTRIES_PAE - 1))
+
+#if defined(__i386__)
+#define l1_table_offset(_a) \
+ (((_a) >> L1_PAGETABLE_SHIFT) & (L1_PAGETABLE_ENTRIES - 1))
+#define l2_table_offset(_a) \
+ ((_a) >> L2_PAGETABLE_SHIFT)
#elif defined(__x86_64__)
#define l1_table_offset(_a) \
(((_a) >> L1_PAGETABLE_SHIFT) & (L1_PAGETABLE_ENTRIES - 1))