direct-io.hg

changeset 8665:bd6ae7117cca

Fix 64-bit build.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
author sos22@douglas.cl.cam.ac.uk
date Wed Jan 25 23:31:07 2006 +0100 (2006-01-25)
parents 407358daf389
children 5b004f4e76cf
files tools/libxc/xc_linux_build.c
line diff
     1.1 --- a/tools/libxc/xc_linux_build.c	Wed Jan 25 17:41:22 2006 +0100
     1.2 +++ b/tools/libxc/xc_linux_build.c	Wed Jan 25 23:31:07 2006 +0100
     1.3 @@ -232,16 +232,16 @@ static int setup_pg_tables_64(int xc_han
     1.4      l2_pgentry_t *vl2tab=NULL, *vl2e=NULL;
     1.5      l3_pgentry_t *vl3tab=NULL, *vl3e=NULL;
     1.6      l4_pgentry_t *vl4tab=NULL, *vl4e=NULL;
     1.7 -    unsigned long l2tab = 0;
     1.8 -    unsigned long l1tab = 0;
     1.9 -    unsigned long l3tab = 0;
    1.10 -    unsigned long l4tab = 0;
    1.11 +    unsigned long l2tab = 0, pl2tab;
    1.12 +    unsigned long l1tab = 0, pl1tab;
    1.13 +    unsigned long l3tab = 0, pl3tab;
    1.14 +    unsigned long l4tab = 0, pl4tab;
    1.15      unsigned long ppt_alloc;
    1.16      unsigned long count;
    1.17  
    1.18      /* First allocate page for page dir. */
    1.19      ppt_alloc = (vpt_start - dsi_v_start) >> PAGE_SHIFT;
    1.20 -    alloc_pt(l4tab, vl4tab);
    1.21 +    alloc_pt(l4tab, vl4tab, pl4tab);
    1.22      vl4e = &vl4tab[l4_table_offset(dsi_v_start)];
    1.23      ctxt->ctrlreg[3] = l4tab;
    1.24      
    1.25 @@ -249,28 +249,37 @@ static int setup_pg_tables_64(int xc_han
    1.26      {
    1.27          if ( !((unsigned long)vl1e & (PAGE_SIZE-1)) )
    1.28          {
    1.29 -            alloc_pt(l1tab, vl1tab);
    1.30 +            alloc_pt(l1tab, vl1tab, pl1tab);
    1.31              
    1.32              if ( !((unsigned long)vl2e & (PAGE_SIZE-1)) )
    1.33              {
    1.34 -                alloc_pt(l2tab, vl2tab);
    1.35 +                alloc_pt(l2tab, vl2tab, pl2tab);
    1.36                  if ( !((unsigned long)vl3e & (PAGE_SIZE-1)) )
    1.37                  {
    1.38 -                    alloc_pt(l3tab, vl3tab);
    1.39 +                    alloc_pt(l3tab, vl3tab, pl3tab);
    1.40                      vl3e = &vl3tab[l3_table_offset(dsi_v_start + (count<<PAGE_SHIFT))];
    1.41 -                    *vl4e = l3tab | L4_PROT;
    1.42 +                    if (shadow_mode_enabled)
    1.43 +                        *vl4e = pl3tab | L4_PROT;
    1.44 +                    else
    1.45 +                        *vl4e = l3tab | L4_PROT;
    1.46                      vl4e++;
    1.47                  }
    1.48                  vl2e = &vl2tab[l2_table_offset(dsi_v_start + (count<<PAGE_SHIFT))];
    1.49 -                *vl3e = l2tab | L3_PROT;
    1.50 +                if (shadow_mode_enabled)
    1.51 +                    *vl3e = pl2tab | L3_PROT;
    1.52 +                else
    1.53 +                    *vl3e = l2tab | L3_PROT;
    1.54                  vl3e++;
    1.55              }
    1.56              vl1e = &vl1tab[l1_table_offset(dsi_v_start + (count<<PAGE_SHIFT))];
    1.57 -            *vl2e = l1tab | L2_PROT;
    1.58 +            if (shadow_mode_enabled)
    1.59 +                *vl2e = pl1tab | L2_PROT;
    1.60 +            else
    1.61 +                *vl2e = l1tab | L2_PROT;
    1.62              vl2e++;
    1.63          }
    1.64          
    1.65 -        if (shadow_mode_enable) {
    1.66 +        if (shadow_mode_enabled) {
    1.67              *vl1e = (count << PAGE_SHIFT) | L1_PROT;
    1.68          } else {
    1.69              *vl1e = (page_array[count] << PAGE_SHIFT) | L1_PROT;