ia64/xen-unstable

changeset 7041:352151393395

Make PAE defs in xg_private.h usable in both 32- and
64-bit builds.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Sep 23 14:43:52 2005 +0100 (2005-09-23)
parents 10d6bda59ea4
children 7ff651a39cfc
files tools/libxc/xg_private.h
line diff
     1.1 --- a/tools/libxc/xg_private.h	Fri Sep 23 14:28:16 2005 +0100
     1.2 +++ b/tools/libxc/xg_private.h	Fri Sep 23 14:43:52 2005 +0100
     1.3 @@ -28,25 +28,27 @@ unsigned long csum_page (void * page);
     1.4  #define _PAGE_PSE       0x080
     1.5  #define _PAGE_GLOBAL    0x100
     1.6  
     1.7 -#if defined(__i386__)
     1.8 -#define L1_PAGETABLE_SHIFT       12
     1.9 -#define L2_PAGETABLE_SHIFT       22
    1.10  #define L1_PAGETABLE_SHIFT_PAE   12
    1.11  #define L2_PAGETABLE_SHIFT_PAE   21
    1.12  #define L3_PAGETABLE_SHIFT_PAE   30
    1.13 +
    1.14 +#if defined(__i386__)
    1.15 +#define L1_PAGETABLE_SHIFT       12
    1.16 +#define L2_PAGETABLE_SHIFT       22
    1.17  #elif defined(__x86_64__)
    1.18 -#define L1_PAGETABLE_SHIFT      12
    1.19 -#define L2_PAGETABLE_SHIFT      21
    1.20 -#define L3_PAGETABLE_SHIFT      30
    1.21 -#define L4_PAGETABLE_SHIFT      39
    1.22 +#define L1_PAGETABLE_SHIFT       12
    1.23 +#define L2_PAGETABLE_SHIFT       21
    1.24 +#define L3_PAGETABLE_SHIFT       30
    1.25 +#define L4_PAGETABLE_SHIFT       39
    1.26  #endif
    1.27  
    1.28 -#if defined(__i386__) 
    1.29 -#define ENTRIES_PER_L1_PAGETABLE 1024
    1.30 -#define ENTRIES_PER_L2_PAGETABLE 1024
    1.31  #define L1_PAGETABLE_ENTRIES_PAE  512
    1.32  #define L2_PAGETABLE_ENTRIES_PAE  512
    1.33  #define L3_PAGETABLE_ENTRIES_PAE    4
    1.34 +
    1.35 +#if defined(__i386__) 
    1.36 +#define L1_PAGETABLE_ENTRIES   1024
    1.37 +#define L2_PAGETABLE_ENTRIES   1024
    1.38  #elif defined(__x86_64__)
    1.39  #define L1_PAGETABLE_ENTRIES    512
    1.40  #define L2_PAGETABLE_ENTRIES    512
    1.41 @@ -70,17 +72,18 @@ typedef unsigned long l3_pgentry_t;
    1.42  typedef unsigned long l4_pgentry_t;
    1.43  #endif
    1.44  
    1.45 -#if defined(__i386__)
    1.46 -#define l1_table_offset(_a) \
    1.47 -          (((_a) >> L1_PAGETABLE_SHIFT) & (ENTRIES_PER_L1_PAGETABLE - 1))
    1.48 -#define l2_table_offset(_a) \
    1.49 -          ((_a) >> L2_PAGETABLE_SHIFT)
    1.50  #define l1_table_offset_pae(_a) \
    1.51    (((_a) >> L1_PAGETABLE_SHIFT_PAE) & (L1_PAGETABLE_ENTRIES_PAE - 1))
    1.52  #define l2_table_offset_pae(_a) \
    1.53    (((_a) >> L2_PAGETABLE_SHIFT_PAE) & (L2_PAGETABLE_ENTRIES_PAE - 1))
    1.54  #define l3_table_offset_pae(_a) \
    1.55  	(((_a) >> L3_PAGETABLE_SHIFT_PAE) & (L3_PAGETABLE_ENTRIES_PAE - 1))
    1.56 +
    1.57 +#if defined(__i386__)
    1.58 +#define l1_table_offset(_a) \
    1.59 +          (((_a) >> L1_PAGETABLE_SHIFT) & (L1_PAGETABLE_ENTRIES - 1))
    1.60 +#define l2_table_offset(_a) \
    1.61 +          ((_a) >> L2_PAGETABLE_SHIFT)
    1.62  #elif defined(__x86_64__)
    1.63  #define l1_table_offset(_a) \
    1.64    (((_a) >> L1_PAGETABLE_SHIFT) & (L1_PAGETABLE_ENTRIES - 1))