ia64/xen-unstable

changeset 1084:35e9a7d31995

bitkeeper revision 1.719 (402b68c6wyzlyU0WWpwzC19I8mQBEw)

Many files:
Various cleanups to Xen control interfaces.
author kaf24@scramble.cl.cam.ac.uk
date Thu Feb 12 11:51:34 2004 +0000 (2004-02-12)
parents 82350f1a3ece
children eefcc4592e7f c89c254c2bdb
files tools/examples/xc_dom_control.py tools/xc/lib/xc.h tools/xc/lib/xc_bvtsched.c tools/xc/lib/xc_domain.c tools/xc/lib/xc_linux_build.c tools/xc/lib/xc_linux_restore.c tools/xc/lib/xc_linux_save.c tools/xc/lib/xc_netbsd_build.c tools/xc/lib/xc_vbd.c tools/xc/lib/xc_vif.c tools/xc/py/Xc.c tools/xc/py/XenoUtil.py xen/arch/i386/Rules.mk xen/common/dom_mem_ops.c xen/common/memory.c xen/common/schedule.c xen/drivers/block/xen_block.c xen/drivers/block/xen_vbd.c xen/include/hypervisor-ifs/block.h xen/include/hypervisor-ifs/vbd.h xen/include/xeno/vbd.h xen/net/dev.c xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c
line diff
     1.1 --- a/tools/examples/xc_dom_control.py	Wed Feb 11 22:45:55 2004 +0000
     1.2 +++ b/tools/examples/xc_dom_control.py	Thu Feb 12 11:51:34 2004 +0000
     1.3 @@ -47,7 +47,7 @@ dom = None
     1.4  
     1.5  
     1.6  if len( sys.argv ) > 2 and re.match('\d+$', sys.argv[2]):
     1.7 -    dom = string.atoi(sys.argv[2])
     1.8 +    dom = long(sys.argv[2])
     1.9  
    1.10  if cmd == 'stop':
    1.11      rc = xc.domain_stop( dom=dom )
     2.1 --- a/tools/xc/lib/xc.h	Wed Feb 11 22:45:55 2004 +0000
     2.2 +++ b/tools/xc/lib/xc.h	Thu Feb 12 11:51:34 2004 +0000
     2.3 @@ -28,7 +28,7 @@ typedef struct {
     2.4      int           has_cpu;
     2.5      int           stopped;
     2.6      unsigned long nr_pages;
     2.7 -    unsigned long long cpu_time;
     2.8 +    u64           cpu_time;
     2.9  #define XC_DOMINFO_MAXNAME 16
    2.10      char          name[XC_DOMINFO_MAXNAME];
    2.11  } xc_dominfo_t;
    2.12 @@ -86,8 +86,8 @@ typedef struct {
    2.13  } xc_vif_sched_params_t;
    2.14  
    2.15  typedef struct {
    2.16 -    unsigned long long tx_bytes, tx_pkts;
    2.17 -    unsigned long long rx_bytes, rx_pkts;
    2.18 +    u64 tx_bytes, tx_pkts;
    2.19 +    u64 rx_bytes, rx_pkts;
    2.20  } xc_vif_stats_t;
    2.21  
    2.22  int xc_vif_scheduler_set(int xc_handle,
    2.23 @@ -109,13 +109,13 @@ typedef struct {
    2.24      unsigned short vbdid;
    2.25  #define XC_VBDF_WRITEABLE (1<<0)
    2.26      unsigned long  flags;
    2.27 -    unsigned long  nr_sectors;
    2.28 +    u64            nr_sectors;
    2.29  } xc_vbd_t;
    2.30  
    2.31  typedef struct {
    2.32      unsigned short real_device;
    2.33 -    unsigned long  start_sector;
    2.34 -    unsigned long  nr_sectors;
    2.35 +    u64            start_sector;
    2.36 +    u64            nr_sectors;
    2.37  } xc_vbdextent_t;
    2.38  
    2.39  int xc_vbd_create(int xc_handle,
     3.1 --- a/tools/xc/lib/xc_bvtsched.c	Wed Feb 11 22:45:55 2004 +0000
     3.2 +++ b/tools/xc/lib/xc_bvtsched.c	Thu Feb 12 11:51:34 2004 +0000
     3.3 @@ -18,7 +18,7 @@ int xc_bvtsched_global_set(int xc_handle
     3.4  }
     3.5  
     3.6  int xc_bvtsched_domain_set(int xc_handle,
     3.7 -                           domid_t domid,
     3.8 +                           u64 domid,
     3.9                             unsigned long mcuadv,
    3.10                             unsigned long warp,
    3.11                             unsigned long warpl,
    3.12 @@ -26,7 +26,7 @@ int xc_bvtsched_domain_set(int xc_handle
    3.13  {
    3.14      dom0_op_t op;
    3.15      op.cmd = DOM0_ADJUSTDOM;
    3.16 -    op.u.adjustdom.domain  = domid;
    3.17 +    op.u.adjustdom.domain  = (domid_t)domid;
    3.18      op.u.adjustdom.mcu_adv = mcuadv;
    3.19      op.u.adjustdom.warp    = warp;
    3.20      op.u.adjustdom.warpl   = warpl;
     4.1 --- a/tools/xc/lib/xc_domain.c	Wed Feb 11 22:45:55 2004 +0000
     4.2 +++ b/tools/xc/lib/xc_domain.c	Thu Feb 12 11:51:34 2004 +0000
     4.3 @@ -11,7 +11,7 @@
     4.4  int xc_domain_create(int xc_handle,
     4.5                       unsigned int mem_kb, 
     4.6                       const char *name,
     4.7 -                     domid_t *pdomid)
     4.8 +                     u64 *pdomid)
     4.9  {
    4.10      int err;
    4.11      dom0_op_t op;
    4.12 @@ -22,71 +22,71 @@ int xc_domain_create(int xc_handle,
    4.13      op.u.createdomain.name[MAX_DOMAIN_NAME-1] = '\0';
    4.14  
    4.15      if ( (err = do_dom0_op(xc_handle, &op)) == 0 )
    4.16 -        *pdomid = op.u.createdomain.domain;
    4.17 +        *pdomid = (u64)op.u.createdomain.domain;
    4.18  
    4.19      return err;
    4.20  }    
    4.21  
    4.22  
    4.23  int xc_domain_start(int xc_handle,
    4.24 -                    domid_t domid)
    4.25 +                    u64 domid)
    4.26  {
    4.27      dom0_op_t op;
    4.28      op.cmd = DOM0_STARTDOMAIN;
    4.29 -    op.u.startdomain.domain = domid;
    4.30 +    op.u.startdomain.domain = (domid_t)domid;
    4.31      return do_dom0_op(xc_handle, &op);
    4.32  }    
    4.33  
    4.34  
    4.35  int xc_domain_stop(int xc_handle, 
    4.36 -                   domid_t domid)
    4.37 +                   u64 domid)
    4.38  {
    4.39      dom0_op_t op;
    4.40      op.cmd = DOM0_STOPDOMAIN;
    4.41 -    op.u.stopdomain.domain = domid;
    4.42 +    op.u.stopdomain.domain = (domid_t)domid;
    4.43      return do_dom0_op(xc_handle, &op);
    4.44  }    
    4.45  
    4.46  
    4.47  int xc_domain_destroy(int xc_handle,
    4.48 -                      domid_t domid, 
    4.49 +                      u64 domid, 
    4.50                        int force)
    4.51  {
    4.52      dom0_op_t op;
    4.53      op.cmd = DOM0_DESTROYDOMAIN;
    4.54 -    op.u.destroydomain.domain = domid;
    4.55 +    op.u.destroydomain.domain = (domid_t)domid;
    4.56      op.u.destroydomain.force  = !!force;
    4.57      return do_dom0_op(xc_handle, &op);
    4.58  }
    4.59  
    4.60  int xc_domain_pincpu(int xc_handle,
    4.61 -                     domid_t domid, 
    4.62 +                     u64 domid, 
    4.63                       int cpu)
    4.64  {
    4.65      dom0_op_t op;
    4.66      op.cmd = DOM0_PINCPUDOMAIN;
    4.67 -    op.u.pincpudomain.domain = domid;
    4.68 +    op.u.pincpudomain.domain = (domid_t)domid;
    4.69      op.u.pincpudomain.cpu  = cpu;
    4.70      return do_dom0_op(xc_handle, &op);
    4.71  }
    4.72  
    4.73  
    4.74  int xc_domain_getinfo(int xc_handle,
    4.75 -                      domid_t first_domid,
    4.76 +                      u64 first_domid,
    4.77                        unsigned int max_doms,
    4.78                        xc_dominfo_t *info)
    4.79  {
    4.80      unsigned int nr_doms;
    4.81 -    domid_t next_domid = first_domid;
    4.82 +    u64 next_domid = first_domid;
    4.83      dom0_op_t op;
    4.84  
    4.85      for ( nr_doms = 0; nr_doms < max_doms; nr_doms++ )
    4.86      {
    4.87          op.cmd = DOM0_GETDOMAININFO;
    4.88 -        op.u.getdomaininfo.domain = next_domid;
    4.89 +        op.u.getdomaininfo.domain = (domid_t)next_domid;
    4.90          if ( do_dom0_op(xc_handle, &op) < 0 )
    4.91              break;
    4.92 -        info->domid   = op.u.getdomaininfo.domain;
    4.93 +        info->domid   = (u64)op.u.getdomaininfo.domain;
    4.94          info->cpu     = op.u.getdomaininfo.processor;
    4.95          info->has_cpu = op.u.getdomaininfo.has_cpu;
    4.96          info->stopped = (op.u.getdomaininfo.state == DOMSTATE_STOPPED);
    4.97 @@ -95,7 +95,7 @@ int xc_domain_getinfo(int xc_handle,
    4.98          strncpy(info->name, op.u.getdomaininfo.name, XC_DOMINFO_MAXNAME);
    4.99          info->name[XC_DOMINFO_MAXNAME-1] = '\0';
   4.100  
   4.101 -        next_domid = op.u.getdomaininfo.domain + 1;
   4.102 +        next_domid = (u64)op.u.getdomaininfo.domain + 1;
   4.103          info++;
   4.104      }
   4.105  
     5.1 --- a/tools/xc/lib/xc_linux_build.c	Wed Feb 11 22:45:55 2004 +0000
     5.2 +++ b/tools/xc/lib/xc_linux_build.c	Thu Feb 12 11:51:34 2004 +0000
     5.3 @@ -12,24 +12,24 @@
     5.4  #define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
     5.5  #define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
     5.6  
     5.7 -static long get_tot_pages(int xc_handle, domid_t domid)
     5.8 +static long get_tot_pages(int xc_handle, u64 domid)
     5.9  {
    5.10      dom0_op_t op;
    5.11      op.cmd = DOM0_GETDOMAININFO;
    5.12 -    op.u.getdomaininfo.domain = domid;
    5.13 +    op.u.getdomaininfo.domain = (domid_t)domid;
    5.14      return (do_dom0_op(xc_handle, &op) < 0) ? 
    5.15          -1 : op.u.getdomaininfo.tot_pages;
    5.16  }
    5.17  
    5.18  static int get_pfn_list(int xc_handle,
    5.19 -                        domid_t domid, 
    5.20 +                        u64 domid, 
    5.21                          unsigned long *pfn_buf, 
    5.22                          unsigned long max_pfns)
    5.23  {
    5.24      dom0_op_t op;
    5.25      int ret;
    5.26      op.cmd = DOM0_GETMEMLIST;
    5.27 -    op.u.getmemlist.domain   = domid;
    5.28 +    op.u.getmemlist.domain   = (domid_t)domid;
    5.29      op.u.getmemlist.max_pfns = max_pfns;
    5.30      op.u.getmemlist.buffer   = pfn_buf;
    5.31  
    5.32 @@ -96,7 +96,7 @@ static int copy_to_domain_page(int pm_ha
    5.33  }
    5.34  
    5.35  static int setup_guestos(int xc_handle,
    5.36 -                         domid_t dom, 
    5.37 +                         u64 dom, 
    5.38                           gzFile kernel_gfd, 
    5.39                           gzFile initrd_gfd, 
    5.40                           unsigned long tot_pages,
    5.41 @@ -312,7 +312,7 @@ static int setup_guestos(int xc_handle,
    5.42  }
    5.43  
    5.44  int xc_linux_build(int xc_handle,
    5.45 -                   domid_t domid,
    5.46 +                   u64 domid,
    5.47                     const char *image_name,
    5.48                     const char *ramdisk_name,
    5.49                     const char *cmdline)
    5.50 @@ -382,9 +382,9 @@ int xc_linux_build(int xc_handle,
    5.51      }
    5.52  
    5.53      op.cmd = DOM0_GETDOMAININFO;
    5.54 -    op.u.getdomaininfo.domain = domid;
    5.55 +    op.u.getdomaininfo.domain = (domid_t)domid;
    5.56      if ( (do_dom0_op(xc_handle, &op) < 0) || 
    5.57 -         (op.u.getdomaininfo.domain != domid) )
    5.58 +         ((u64)op.u.getdomaininfo.domain != domid) )
    5.59      {
    5.60          PERROR("Could not get info on domain");
    5.61          goto error_out;
    5.62 @@ -468,7 +468,7 @@ int xc_linux_build(int xc_handle,
    5.63      ctxt->failsafe_callback_cs  = FLAT_RING1_CS;
    5.64      ctxt->failsafe_callback_eip = 0;
    5.65  
    5.66 -    launch_op.u.builddomain.domain   = domid;
    5.67 +    launch_op.u.builddomain.domain   = (domid_t)domid;
    5.68      launch_op.u.builddomain.num_vifs = 1;
    5.69  
    5.70      launch_op.cmd = DOM0_BUILDDOMAIN;
     6.1 --- a/tools/xc/lib/xc_linux_restore.c	Wed Feb 11 22:45:55 2004 +0000
     6.2 +++ b/tools/xc/lib/xc_linux_restore.c	Thu Feb 12 11:51:34 2004 +0000
     6.3 @@ -19,14 +19,14 @@
     6.4      } while ( 0 )
     6.5  
     6.6  static int get_pfn_list(int xc_handle,
     6.7 -                        domid_t domain_id, 
     6.8 +                        u64 domain_id, 
     6.9                          unsigned long *pfn_buf, 
    6.10                          unsigned long max_pfns)
    6.11  {
    6.12      dom0_op_t op;
    6.13      int ret;
    6.14      op.cmd = DOM0_GETMEMLIST;
    6.15 -    op.u.getmemlist.domain   = domain_id;
    6.16 +    op.u.getmemlist.domain   = (domid_t)domain_id;
    6.17      op.u.getmemlist.max_pfns = max_pfns;
    6.18      op.u.getmemlist.buffer   = pfn_buf;
    6.19  
    6.20 @@ -104,12 +104,12 @@ static int checked_read(gzFile fd, void 
    6.21  int xc_linux_restore(int xc_handle,
    6.22                       const char *state_file,
    6.23                       int verbose,
    6.24 -                     domid_t *pdomid)
    6.25 +                     u64 *pdomid)
    6.26  {
    6.27      dom0_op_t op;
    6.28      int rc = 1, i, j;
    6.29      unsigned long mfn, pfn;
    6.30 -    domid_t dom = 0;
    6.31 +    u64 dom = 0ULL;
    6.32      unsigned int prev_pc, this_pc;
    6.33      
    6.34      /* Number of page frames in use by this XenoLinux session. */
    6.35 @@ -225,11 +225,11 @@ int xc_linux_restore(int xc_handle,
    6.36          ERROR("Could not create new domain");
    6.37          goto out;
    6.38      }
    6.39 -    dom = op.u.createdomain.domain;
    6.40 +    dom = (u64)op.u.createdomain.domain;
    6.41  
    6.42      /* Get the domain's shared-info frame. */
    6.43      op.cmd = DOM0_GETDOMAININFO;
    6.44 -    op.u.getdomaininfo.domain = dom;
    6.45 +    op.u.getdomaininfo.domain = (domid_t)dom;
    6.46      if ( do_dom0_op(xc_handle, &op) < 0 )
    6.47      {
    6.48          ERROR("Could not get information on new domain");
    6.49 @@ -452,7 +452,7 @@ int xc_linux_restore(int xc_handle,
    6.50      }
    6.51  
    6.52      op.cmd = DOM0_BUILDDOMAIN;
    6.53 -    op.u.builddomain.domain   = dom;
    6.54 +    op.u.builddomain.domain   = (domid_t)dom;
    6.55      op.u.builddomain.num_vifs = 1;
    6.56      memcpy(&op.u.builddomain.ctxt, &ctxt, sizeof(ctxt));
    6.57      rc = do_dom0_op(xc_handle, &op);
    6.58 @@ -463,7 +463,7 @@ int xc_linux_restore(int xc_handle,
    6.59          if ( dom != 0 )
    6.60          {
    6.61              op.cmd = DOM0_DESTROYDOMAIN;
    6.62 -            op.u.destroydomain.domain = dom;
    6.63 +            op.u.destroydomain.domain = (domid_t)dom;
    6.64              op.u.destroydomain.force  = 1;
    6.65              (void)do_dom0_op(xc_handle, &op);
    6.66          }
     7.1 --- a/tools/xc/lib/xc_linux_save.c	Wed Feb 11 22:45:55 2004 +0000
     7.2 +++ b/tools/xc/lib/xc_linux_save.c	Thu Feb 12 11:51:34 2004 +0000
     7.3 @@ -40,24 +40,24 @@
     7.4  
     7.5  static int check_pfn_ownership(int xc_handle, 
     7.6                                 unsigned long mfn, 
     7.7 -                               domid_t dom)
     7.8 +                               u64 dom)
     7.9  {
    7.10      dom0_op_t op;
    7.11      op.cmd = DOM0_GETPAGEFRAMEINFO;
    7.12      op.u.getpageframeinfo.pfn    = mfn;
    7.13 -    op.u.getpageframeinfo.domain = dom;
    7.14 +    op.u.getpageframeinfo.domain = (domid_t)dom;
    7.15      return (do_dom0_op(xc_handle, &op) >= 0);
    7.16  }
    7.17  
    7.18  #define GETPFN_ERR (~0U)
    7.19  static unsigned int get_pfn_type(int xc_handle, 
    7.20                                   unsigned long mfn, 
    7.21 -                                 domid_t dom)
    7.22 +                                 u64 dom)
    7.23  {
    7.24      dom0_op_t op;
    7.25      op.cmd = DOM0_GETPAGEFRAMEINFO;
    7.26      op.u.getpageframeinfo.pfn    = mfn;
    7.27 -    op.u.getpageframeinfo.domain = dom;
    7.28 +    op.u.getpageframeinfo.domain = (domid_t)dom;
    7.29      if ( do_dom0_op(xc_handle, &op) < 0 )
    7.30      {
    7.31          PERROR("Unexpected failure when getting page frame info!");
    7.32 @@ -75,7 +75,7 @@ static int checked_write(gzFile fd, void
    7.33  }
    7.34  
    7.35  int xc_linux_save(int xc_handle,
    7.36 -                  domid_t domid, 
    7.37 +                  u64 domid, 
    7.38                    const char *state_file, 
    7.39                    int verbose)
    7.40  {
    7.41 @@ -142,9 +142,9 @@ int xc_linux_save(int xc_handle,
    7.42      for ( ; ; )
    7.43      {
    7.44          op.cmd = DOM0_GETDOMAININFO;
    7.45 -        op.u.getdomaininfo.domain = domid;
    7.46 +        op.u.getdomaininfo.domain = (domid_t)domid;
    7.47          if ( (do_dom0_op(xc_handle, &op) < 0) || 
    7.48 -             (op.u.getdomaininfo.domain != domid) )
    7.49 +             ((u64)op.u.getdomaininfo.domain != domid) )
    7.50          {
    7.51              PERROR("Could not get info on domain");
    7.52              goto out;
    7.53 @@ -160,7 +160,7 @@ int xc_linux_save(int xc_handle,
    7.54          we_stopped_it = 1;
    7.55  
    7.56          op.cmd = DOM0_STOPDOMAIN;
    7.57 -        op.u.stopdomain.domain = domid;
    7.58 +        op.u.stopdomain.domain = (domid_t)domid;
    7.59          if ( do_dom0_op(xc_handle, &op) != 0 )
    7.60          {
    7.61              we_stopped_it = 0;
    7.62 @@ -375,7 +375,7 @@ int xc_linux_save(int xc_handle,
    7.63      if ( we_stopped_it )
    7.64      {
    7.65          op.cmd = DOM0_STARTDOMAIN;
    7.66 -        op.u.startdomain.domain = domid;
    7.67 +        op.u.startdomain.domain = (domid_t)domid;
    7.68          (void)do_dom0_op(xc_handle, &op);
    7.69      }
    7.70  
     8.1 --- a/tools/xc/lib/xc_netbsd_build.c	Wed Feb 11 22:45:55 2004 +0000
     8.2 +++ b/tools/xc/lib/xc_netbsd_build.c	Thu Feb 12 11:51:34 2004 +0000
     8.3 @@ -22,24 +22,24 @@ static int loadelfimage(gzFile, int, uns
     8.4  #define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
     8.5  #define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
     8.6  
     8.7 -static long get_tot_pages(int xc_handle, domid_t domid)
     8.8 +static long get_tot_pages(int xc_handle, u64 domid)
     8.9  {
    8.10      dom0_op_t op;
    8.11      op.cmd = DOM0_GETDOMAININFO;
    8.12 -    op.u.getdomaininfo.domain = domid;
    8.13 +    op.u.getdomaininfo.domain = (domid_t)domid;
    8.14      return (do_dom0_op(xc_handle, &op) < 0) ? 
    8.15          -1 : op.u.getdomaininfo.tot_pages;
    8.16  }
    8.17  
    8.18  static int get_pfn_list(int xc_handle,
    8.19 -                        domid_t domid, 
    8.20 +                        u64 domid, 
    8.21                          unsigned long *pfn_buf, 
    8.22                          unsigned long max_pfns)
    8.23  {
    8.24      dom0_op_t op;
    8.25      int ret;
    8.26      op.cmd = DOM0_GETMEMLIST;
    8.27 -    op.u.getmemlist.domain   = domid;
    8.28 +    op.u.getmemlist.domain   = (domid_t)domid;
    8.29      op.u.getmemlist.max_pfns = max_pfns;
    8.30      op.u.getmemlist.buffer   = pfn_buf;
    8.31  
    8.32 @@ -75,7 +75,7 @@ static int send_pgupdates(int xc_handle,
    8.33  }
    8.34  
    8.35  static int setup_guestos(int xc_handle,
    8.36 -                         domid_t dom, 
    8.37 +                         u64 dom, 
    8.38                           gzFile kernel_gfd, 
    8.39                           unsigned long tot_pages,
    8.40                           unsigned long *virt_startinfo_addr, 
    8.41 @@ -248,7 +248,7 @@ static int setup_guestos(int xc_handle,
    8.42  }
    8.43  
    8.44  int xc_netbsd_build(int xc_handle,
    8.45 -                    domid_t domid,
    8.46 +                    u64 domid,
    8.47                      const char *image_name,
    8.48                      const char *cmdline)
    8.49  {
    8.50 @@ -282,9 +282,9 @@ int xc_netbsd_build(int xc_handle,
    8.51      }
    8.52  
    8.53      op.cmd = DOM0_GETDOMAININFO;
    8.54 -    op.u.getdomaininfo.domain = domid;
    8.55 +    op.u.getdomaininfo.domain = (domid_t)domid;
    8.56      if ( (do_dom0_op(xc_handle, &op) < 0) || 
    8.57 -         (op.u.getdomaininfo.domain != domid) )
    8.58 +         ((u64)op.u.getdomaininfo.domain != domid) )
    8.59      {
    8.60          PERROR("Could not get info on domain");
    8.61          goto error_out;
    8.62 @@ -364,7 +364,7 @@ int xc_netbsd_build(int xc_handle,
    8.63      ctxt->failsafe_callback_cs  = FLAT_RING1_CS;
    8.64      ctxt->failsafe_callback_eip = 0;
    8.65  
    8.66 -    launch_op.u.builddomain.domain   = domid;
    8.67 +    launch_op.u.builddomain.domain   = (domid_t)domid;
    8.68      launch_op.u.builddomain.num_vifs = 1;
    8.69  
    8.70      launch_op.cmd = DOM0_BUILDDOMAIN;
     9.1 --- a/tools/xc/lib/xc_vbd.c	Wed Feb 11 22:45:55 2004 +0000
     9.2 +++ b/tools/xc/lib/xc_vbd.c	Thu Feb 12 11:51:34 2004 +0000
     9.3 @@ -10,13 +10,13 @@
     9.4  #include "xc_private.h"
     9.5  
     9.6  int xc_vbd_create(int xc_handle,
     9.7 -                  domid_t domid, 
     9.8 +                  u64 domid, 
     9.9                    unsigned short vbdid, 
    9.10                    int writeable)
    9.11  {
    9.12      block_io_op_t op; 
    9.13      op.cmd = BLOCK_IO_OP_VBD_CREATE; 
    9.14 -    op.u.create_params.domain  = domid;
    9.15 +    op.u.create_params.domain  = (domid_t)domid;
    9.16      op.u.create_params.vdevice = vbdid;
    9.17      op.u.create_params.mode    = VBD_MODE_R | (writeable ? VBD_MODE_W : 0);
    9.18      return do_block_io_op(xc_handle, &op);
    9.19 @@ -24,47 +24,47 @@ int xc_vbd_create(int xc_handle,
    9.20  
    9.21  
    9.22  int xc_vbd_destroy(int xc_handle,
    9.23 -                   domid_t domid, 
    9.24 +                   u64 domid, 
    9.25                     unsigned short vbdid)
    9.26  {
    9.27      block_io_op_t op; 
    9.28      op.cmd = BLOCK_IO_OP_VBD_DELETE; 
    9.29 -    op.u.delete_params.domain  = domid;
    9.30 +    op.u.delete_params.domain  = (domid_t)domid;
    9.31      op.u.delete_params.vdevice = vbdid;
    9.32      return do_block_io_op(xc_handle, &op);
    9.33  }
    9.34  
    9.35  
    9.36  int xc_vbd_grow(int xc_handle,
    9.37 -                domid_t domid, 
    9.38 +                u64 domid, 
    9.39                  unsigned short vbdid,
    9.40                  xc_vbdextent_t *extent)
    9.41  {
    9.42      block_io_op_t op; 
    9.43      op.cmd = BLOCK_IO_OP_VBD_GROW; 
    9.44 -    op.u.grow_params.domain  = domid; 
    9.45 +    op.u.grow_params.domain  = (domid_t)domid; 
    9.46      op.u.grow_params.vdevice = vbdid;
    9.47      op.u.grow_params.extent.device       = extent->real_device; 
    9.48 -    op.u.grow_params.extent.start_sector = extent->start_sector;
    9.49 -    op.u.grow_params.extent.nr_sectors   = extent->nr_sectors;
    9.50 +    op.u.grow_params.extent.start_sector = (xen_sector_t)extent->start_sector;
    9.51 +    op.u.grow_params.extent.nr_sectors   = (xen_sector_t)extent->nr_sectors;
    9.52      return do_block_io_op(xc_handle, &op);
    9.53  }
    9.54  
    9.55  
    9.56  int xc_vbd_shrink(int xc_handle,
    9.57 -                  domid_t domid, 
    9.58 +                  u64 domid, 
    9.59                    unsigned short vbdid)
    9.60  {
    9.61      block_io_op_t op; 
    9.62      op.cmd = BLOCK_IO_OP_VBD_SHRINK; 
    9.63 -    op.u.shrink_params.domain  = domid; 
    9.64 +    op.u.shrink_params.domain  = (domid_t)domid; 
    9.65      op.u.shrink_params.vdevice = vbdid;
    9.66      return do_block_io_op(xc_handle, &op);
    9.67  }
    9.68  
    9.69  
    9.70  int xc_vbd_setextents(int xc_handle,
    9.71 -                      domid_t domid, 
    9.72 +                      u64 domid, 
    9.73                        unsigned short vbdid,
    9.74                        unsigned int nr_extents,
    9.75                        xc_vbdextent_t *extents)
    9.76 @@ -87,13 +87,15 @@ int xc_vbd_setextents(int xc_handle,
    9.77          for ( i = 0; i < nr_extents; i++ )
    9.78          {
    9.79              real_extents[i].device       = extents[i].real_device;
    9.80 -            real_extents[i].start_sector = extents[i].start_sector;
    9.81 -            real_extents[i].nr_sectors   = extents[i].nr_sectors;
    9.82 +            real_extents[i].start_sector = 
    9.83 +                (xen_sector_t)extents[i].start_sector;
    9.84 +            real_extents[i].nr_sectors   = 
    9.85 +                (xen_sector_t)extents[i].nr_sectors;
    9.86          }
    9.87      }
    9.88  
    9.89      op.cmd = BLOCK_IO_OP_VBD_SET_EXTENTS;
    9.90 -    op.u.setextents_params.domain     = domid;
    9.91 +    op.u.setextents_params.domain     = (domid_t)domid;
    9.92      op.u.setextents_params.vdevice    = vbdid;
    9.93      op.u.setextents_params.nr_extents = nr_extents;
    9.94      op.u.setextents_params.extents    = real_extents;
    9.95 @@ -110,7 +112,7 @@ int xc_vbd_setextents(int xc_handle,
    9.96  
    9.97  
    9.98  int xc_vbd_getextents(int xc_handle,
    9.99 -                      domid_t domid, 
   9.100 +                      u64 domid, 
   9.101                        unsigned short vbdid,
   9.102                        unsigned int max_extents,
   9.103                        xc_vbdextent_t *extents,
   9.104 @@ -129,7 +131,7 @@ int xc_vbd_getextents(int xc_handle,
   9.105      }
   9.106  
   9.107      op.cmd = BLOCK_IO_OP_VBD_INFO;
   9.108 -    op.u.info_params.domain     = domid;
   9.109 +    op.u.info_params.domain     = (domid_t)domid;
   9.110      op.u.info_params.vdevice    = vbdid;
   9.111      op.u.info_params.maxextents = max_extents;
   9.112      op.u.info_params.extents    = real_extents;
   9.113 @@ -142,8 +144,8 @@ int xc_vbd_getextents(int xc_handle,
   9.114          for ( i = 0; i < op.u.info_params.nextents; i++ )
   9.115          {
   9.116              extents[i].real_device  = real_extents[i].device;
   9.117 -            extents[i].start_sector = real_extents[i].start_sector;
   9.118 -            extents[i].nr_sectors   = real_extents[i].nr_sectors;
   9.119 +            extents[i].start_sector = (u64)real_extents[i].start_sector;
   9.120 +            extents[i].nr_sectors   = (u64)real_extents[i].nr_sectors;
   9.121          }
   9.122  
   9.123          if ( writeable != NULL )
   9.124 @@ -159,7 +161,7 @@ int xc_vbd_getextents(int xc_handle,
   9.125  
   9.126  
   9.127  int xc_vbd_probe(int xc_handle,
   9.128 -                 domid_t domid,
   9.129 +                 u64 domid,
   9.130                   unsigned int max_vbds,
   9.131                   xc_vbd_t *vbds)
   9.132  {
   9.133 @@ -168,7 +170,7 @@ int xc_vbd_probe(int xc_handle,
   9.134      int i, j, ret, allocsz = max_vbds * sizeof(xen_disk_t); 
   9.135  
   9.136      op.cmd = BLOCK_IO_OP_VBD_PROBE; 
   9.137 -    op.u.probe_params.domain = domid; 
   9.138 +    op.u.probe_params.domain = (domid_t)domid; 
   9.139      
   9.140      xdi->max   = max_vbds;
   9.141      xdi->disks = malloc(allocsz);
   9.142 @@ -192,11 +194,11 @@ int xc_vbd_probe(int xc_handle,
   9.143              if ( !(xdi->disks[i].info & XD_FLAG_VIRT) )
   9.144                  continue;
   9.145              
   9.146 -            vbds[j].domid = xdi->disks[i].domain;
   9.147 +            vbds[j].domid = (u64)xdi->disks[i].domain;
   9.148              vbds[j].vbdid = xdi->disks[i].device;
   9.149              vbds[j].flags = (xdi->disks[i].info & XD_FLAG_RO) ? 
   9.150                  0 : XC_VBDF_WRITEABLE;
   9.151 -            vbds[j].nr_sectors = xdi->disks[i].capacity;
   9.152 +            vbds[j].nr_sectors = (u64)xdi->disks[i].capacity;
   9.153              
   9.154              j++;
   9.155          }
    10.1 --- a/tools/xc/lib/xc_vif.c	Wed Feb 11 22:45:55 2004 +0000
    10.2 +++ b/tools/xc/lib/xc_vif.c	Thu Feb 12 11:51:34 2004 +0000
    10.3 @@ -9,13 +9,13 @@
    10.4  #include "xc_private.h"
    10.5  
    10.6  int xc_vif_scheduler_set(int xc_handle,
    10.7 -                         domid_t domid, 
    10.8 +                         u64 domid, 
    10.9                           unsigned int vifid, 
   10.10                           xc_vif_sched_params_t *params)
   10.11  {
   10.12      network_op_t  netop;
   10.13      netop.cmd = NETWORK_OP_VIFSETPARAMS;
   10.14 -    netop.u.vif_setparams.domain       = domid;
   10.15 +    netop.u.vif_setparams.domain       = (domid_t)domid;
   10.16      netop.u.vif_setparams.vif          = vifid;
   10.17      netop.u.vif_setparams.credit_bytes = params->credit_bytes;
   10.18      netop.u.vif_setparams.credit_usec  = params->credit_usec;
   10.19 @@ -24,7 +24,7 @@ int xc_vif_scheduler_set(int xc_handle,
   10.20  
   10.21  
   10.22  int xc_vif_scheduler_get(int xc_handle,
   10.23 -                         domid_t domid, 
   10.24 +                         u64 domid, 
   10.25                           unsigned int vifid, 
   10.26                           xc_vif_sched_params_t *params)
   10.27  {
   10.28 @@ -32,7 +32,7 @@ int xc_vif_scheduler_get(int xc_handle,
   10.29      int rc;
   10.30  
   10.31      netop.cmd = NETWORK_OP_VIFGETINFO;
   10.32 -    netop.u.vif_getinfo.domain = domid;
   10.33 +    netop.u.vif_getinfo.domain = (domid_t)domid;
   10.34      netop.u.vif_getinfo.vif    = vifid;
   10.35  
   10.36      if ( (rc = do_network_op(xc_handle, &netop)) >= 0 )
   10.37 @@ -46,7 +46,7 @@ int xc_vif_scheduler_get(int xc_handle,
   10.38  
   10.39  
   10.40  int xc_vif_stats_get(int xc_handle,
   10.41 -                     domid_t domid, 
   10.42 +                     u64 domid, 
   10.43                       unsigned int vifid, 
   10.44                       xc_vif_stats_t *stats)
   10.45  {
   10.46 @@ -54,7 +54,7 @@ int xc_vif_stats_get(int xc_handle,
   10.47      int rc;
   10.48  
   10.49      netop.cmd = NETWORK_OP_VIFGETINFO;
   10.50 -    netop.u.vif_getinfo.domain = domid;
   10.51 +    netop.u.vif_getinfo.domain = (domid_t)domid;
   10.52      netop.u.vif_getinfo.vif    = vifid;
   10.53  
   10.54      if ( (rc = do_network_op(xc_handle, &netop)) >= 0 )
    11.1 --- a/tools/xc/py/Xc.c	Wed Feb 11 22:45:55 2004 +0000
    11.2 +++ b/tools/xc/py/Xc.c	Thu Feb 12 11:51:34 2004 +0000
    11.3 @@ -432,7 +432,7 @@ static PyObject *pyxc_vbd_grow(PyObject 
    11.4      static char *kwd_list[] = { "dom", "vbd", "device", 
    11.5                                  "start_sector", "nr_sectors", NULL };
    11.6  
    11.7 -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "Liill", kwd_list, 
    11.8 +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "LiiLL", kwd_list, 
    11.9                                        &dom, &vbd, 
   11.10                                        &extent.real_device, 
   11.11                                        &extent.start_sector, 
   11.12 @@ -502,13 +502,13 @@ static PyObject *pyxc_vbd_setextents(PyO
   11.13                  goto fail;
   11.14              extents[i].real_device = (unsigned short)PyInt_AsLong(obj);
   11.15              if ( ((obj = PyDict_GetItemString(dict,"start_sector")) == NULL) ||
   11.16 -                 !PyInt_Check(obj) )
   11.17 +                 !PyLong_Check(obj) )
   11.18                  goto fail;
   11.19 -            extents[i].start_sector = PyInt_AsLong(obj);
   11.20 +            extents[i].start_sector = PyLong_AsUnsignedLongLong(obj);
   11.21              if ( ((obj = PyDict_GetItemString(dict, "nr_sectors")) == NULL) ||
   11.22 -                 !PyInt_Check(obj) )
   11.23 +                 !PyLong_Check(obj) )
   11.24                  goto fail;
   11.25 -            extents[i].nr_sectors = PyInt_AsLong(obj);        
   11.26 +            extents[i].nr_sectors = PyLong_AsUnsignedLongLong(obj);        
   11.27          }
   11.28      }
   11.29  
   11.30 @@ -564,7 +564,7 @@ static PyObject *pyxc_vbd_getextents(PyO
   11.31          {
   11.32              PyList_SetItem(
   11.33                  list, i, 
   11.34 -                Py_BuildValue("{s:i,s:l,s:l}",
   11.35 +                Py_BuildValue("{s:i,s:L,s:L}",
   11.36                                "device",       extents[i].real_device,
   11.37                                "start_sector", extents[i].start_sector,
   11.38                                "nr_sectors",   extents[i].nr_sectors));
   11.39 @@ -606,7 +606,7 @@ static PyObject *pyxc_vbd_probe(PyObject
   11.40      {
   11.41          PyList_SetItem(
   11.42              list, i, 
   11.43 -            Py_BuildValue("{s:L,s:i,s:i,s:l}",
   11.44 +            Py_BuildValue("{s:L,s:i,s:i,s:L}",
   11.45                            "dom",        info[i].domid,
   11.46                            "vbd",        info[i].vbdid,
   11.47                            "writeable",  !!(info[i].flags & XC_VBDF_WRITEABLE),
   11.48 @@ -806,8 +806,8 @@ static PyMethodDef pyxc_methods[] = {
   11.49        " dom          [long]: Identifier of domain containing the VBD.\n"
   11.50        " vbd          [int]:  Identifier of the VBD.\n"
   11.51        " device       [int]:  Identifier of the real underlying block device.\n"
   11.52 -      " start_sector [int]:  Real start sector of this extent.\n"
   11.53 -      " nr_sectors   [int]:  Length, in sectors, of this extent.\n\n"
   11.54 +      " start_sector [long]: Real start sector of this extent.\n"
   11.55 +      " nr_sectors   [long]: Length, in sectors, of this extent.\n\n"
   11.56        "Returns: [int] 0 on success; -1 on error.\n" },
   11.57  
   11.58      { "vbd_shrink", 
   11.59 @@ -825,9 +825,9 @@ static PyMethodDef pyxc_methods[] = {
   11.60        " dom          [long]: Identifier of domain containing the VBD.\n"
   11.61        " vbd          [int]:  Identifier of the VBD.\n"
   11.62        " extents      [list of dicts]: Per-extent information.\n"
   11.63 -      "  device       [int]: Identifier of the real underlying block device.\n"
   11.64 -      "  start_sector [int]: Real start sector of this extent.\n"
   11.65 -      "  nr_sectors   [int]: Length, in sectors, of this extent.\n\n"
   11.66 +      "  device       [int]:  Id of the real underlying block device.\n"
   11.67 +      "  start_sector [long]: Real start sector of this extent.\n"
   11.68 +      "  nr_sectors   [long]: Length, in sectors, of this extent.\n\n"
   11.69        "Returns: [int] 0 on success; -1 on error.\n" },
   11.70  
   11.71      { "vbd_getextents", 
   11.72 @@ -837,9 +837,9 @@ static PyMethodDef pyxc_methods[] = {
   11.73        " dom          [long]: Identifier of domain containing the VBD.\n"
   11.74        " vbd          [int]:  Identifier of the VBD.\n\n"
   11.75        "Returns: [list of dicts] per-extent information; empty on error.\n"
   11.76 -      " device       [int]: Identifier of the real underlying block device.\n"
   11.77 -      " start_sector [int]: Real start sector of this extent.\n"
   11.78 -      " nr_sectors   [int]: Length, in sectors, of this extent.\n" },
   11.79 +      " device       [int]:  Identifier of the real underlying block device.\n"
   11.80 +      " start_sector [long]: Real start sector of this extent.\n"
   11.81 +      " nr_sectors   [long]: Length, in sectors, of this extent.\n" },
   11.82  
   11.83      { "vbd_probe", 
   11.84        (PyCFunction)pyxc_vbd_probe, 
   11.85 @@ -852,7 +852,7 @@ static PyMethodDef pyxc_methods[] = {
   11.86        " dom        [long]: Domain containing this VBD.\n"
   11.87        " vbd        [int]:  Domain-specific identifier of this VBD.\n"
   11.88        " writeable  [int]:  Bool - is this VBD writeable?\n"
   11.89 -      " nr_sectors [int]:  Size of this VBD, in 512-byte sectors.\n" },
   11.90 +      " nr_sectors [long]: Size of this VBD, in 512-byte sectors.\n" },
   11.91  
   11.92      { "readconsolering", 
   11.93        (PyCFunction)pyxc_readconsolering, 
    12.1 --- a/tools/xc/py/XenoUtil.py	Wed Feb 11 22:45:55 2004 +0000
    12.2 +++ b/tools/xc/py/XenoUtil.py	Thu Feb 12 11:51:34 2004 +0000
    12.3 @@ -133,8 +133,8 @@ def lookup_raw_partn(partition):
    12.4      nr_sectors, type }
    12.5          device:       Device number of the given partition
    12.6          start_sector: Index of first sector of the partition
    12.7 -        nr_sectsors:  Number of sectors comprising this partition
    12.8 -        type:       'Disk' or identifying name for partition type
    12.9 +        nr_sectors:   Number of sectors comprising this partition
   12.10 +        type:         'Disk' or identifying name for partition type
   12.11      """
   12.12  
   12.13      if not re.match( '/dev/', partition ):
   12.14 @@ -147,8 +147,8 @@ def lookup_raw_partn(partition):
   12.15          line = fd.readline()
   12.16          if line:
   12.17              return [ { 'device' : blkdev_name_to_number(drive),
   12.18 -                       'start_sector' : 0,
   12.19 -                       'nr_sectors' : int(line) * 2,
   12.20 +                       'start_sector' : long(0),
   12.21 +                       'nr_sectors' : long(line) * 2,
   12.22                         'type' : 'Disk' } ]
   12.23          return None
   12.24  
   12.25 @@ -162,8 +162,8 @@ def lookup_raw_partn(partition):
   12.26                         'size=\s*([0-9]+), Id=\s*(\S+).*$', line)
   12.27          if m:
   12.28              return [ { 'device' : blkdev_name_to_number(drive),
   12.29 -                       'start_sector' : int(m.group(1)),
   12.30 -                       'nr_sectors' : int(m.group(2)),
   12.31 +                       'start_sector' : long(m.group(1)),
   12.32 +                       'nr_sectors' : long(m.group(2)),
   12.33                         'type' : m.group(3) } ]
   12.34      
   12.35      return None
   12.36 @@ -421,7 +421,7 @@ def vd_lookup(id):
   12.37                   # the disk device this extent is on - for passing to Xen
   12.38                   'device' : lookup_raw_partn(partition)[0]['device'],
   12.39                   # the offset of this extent within the disk - for passing to Xen
   12.40 -                 'start_sector' : int(part_offset + lookup_raw_partn(partition)[0]['start_sector']),
   12.41 +                 'start_sector' : long(part_offset + lookup_raw_partn(partition)[0]['start_sector']),
   12.42                   # extent size, in sectors
   12.43                   'nr_sectors' : nr_sectors,
   12.44                   # partition device this extent is on (useful to know for XenoUtil fns)
    13.1 --- a/xen/arch/i386/Rules.mk	Wed Feb 11 22:45:55 2004 +0000
    13.2 +++ b/xen/arch/i386/Rules.mk	Thu Feb 12 11:51:34 2004 +0000
    13.3 @@ -9,8 +9,8 @@ MONITOR_BASE := 0xFC500000
    13.4  LOAD_BASE    := 0x00100000
    13.5  CFLAGS  := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing 
    13.6  CFLAGS  += -iwithprefix include -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE)
    13.7 -CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
    13.8 -#CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
    13.9 +#CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
   13.10 +CFLAGS  += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
   13.11  CFLAGS  += -Wno-pointer-arith -Wredundant-decls
   13.12  LDFLAGS := -T xeno.lds -N
   13.13  
    14.1 --- a/xen/common/dom_mem_ops.c	Wed Feb 11 22:45:55 2004 +0000
    14.2 +++ b/xen/common/dom_mem_ops.c	Thu Feb 12 11:51:34 2004 +0000
    14.3 @@ -62,7 +62,7 @@ static long free_dom_mem(struct task_str
    14.4          op.pages++;
    14.5          if ( mpfn >= max_page )
    14.6          {
    14.7 -            DPRINTK("Domain %d page number out of range (%08lx>=%08lx)\n", 
    14.8 +            DPRINTK("Domain %llu page number out of range (%08lx>=%08lx)\n", 
    14.9                      p->domain, mpfn, max_page);
   14.10              rc = -EINVAL;
   14.11              goto out;
   14.12 @@ -71,7 +71,7 @@ static long free_dom_mem(struct task_str
   14.13          page = &frame_table[mpfn];
   14.14          if ( unlikely(!get_page(page, p)) )
   14.15          {
   14.16 -            DPRINTK("Bad page free for domain %d\n", p->domain);
   14.17 +            DPRINTK("Bad page free for domain %llu\n", p->domain);
   14.18              rc = -EINVAL;
   14.19              goto out;
   14.20          }
    15.1 --- a/xen/common/memory.c	Wed Feb 11 22:45:55 2004 +0000
    15.2 +++ b/xen/common/memory.c	Thu Feb 12 11:51:34 2004 +0000
    15.3 @@ -141,7 +141,7 @@
    15.4  
    15.5  #ifndef NDEBUG
    15.6  #define MEM_LOG(_f, _a...)                           \
    15.7 -  printk("DOM%d: (file=memory.c, line=%d) " _f "\n", \
    15.8 +  printk("DOM%llu: (file=memory.c, line=%d) " _f "\n", \
    15.9           current->domain, __LINE__, ## _a )
   15.10  #else
   15.11  #define MEM_LOG(_f, _a...) ((void)0)
    16.1 --- a/xen/common/schedule.c	Wed Feb 11 22:45:55 2004 +0000
    16.2 +++ b/xen/common/schedule.c	Thu Feb 12 11:51:34 2004 +0000
    16.3 @@ -260,7 +260,7 @@ long do_sched_op(unsigned long op)
    16.4  
    16.5      case SCHEDOP_exit:
    16.6      {
    16.7 -        DPRINTK("DOM%d killed itself!\n", current->domain);
    16.8 +        DPRINTK("DOM%llu killed itself!\n", current->domain);
    16.9          DPRINTK(" EIP == %08lx\n", get_execution_context()->eip);
   16.10          kill_domain();
   16.11          break;
   16.12 @@ -268,7 +268,7 @@ long do_sched_op(unsigned long op)
   16.13  
   16.14      case SCHEDOP_stop:
   16.15      {
   16.16 -        DPRINTK("DOM%d stopped itself!\n", current->domain);
   16.17 +        DPRINTK("DOM%llu stopped itself!\n", current->domain);
   16.18          DPRINTK(" EIP == %08lx\n", get_execution_context()->eip);
   16.19          stop_domain();
   16.20          break;
    17.1 --- a/xen/drivers/block/xen_block.c	Wed Feb 11 22:45:55 2004 +0000
    17.2 +++ b/xen/drivers/block/xen_block.c	Thu Feb 12 11:51:34 2004 +0000
    17.3 @@ -452,7 +452,7 @@ static void dispatch_rw_block_io(struct 
    17.4  	new_segs = vbd_translate(&phys_seg[nr_psegs], p, operation);
    17.5  	if ( new_segs < 0 )
    17.6          { 
    17.7 -            DPRINTK("access denied: %s of [%ld,%ld] on dev=%04x\n", 
    17.8 +            DPRINTK("access denied: %s of [%llu,%llu] on dev=%04x\n", 
    17.9                      operation == READ ? "read" : "write", 
   17.10                      req->sector_number + tot_sects, 
   17.11                      req->sector_number + tot_sects + nr_sects, 
   17.12 @@ -498,7 +498,7 @@ static void dispatch_rw_block_io(struct 
   17.13      
   17.14          bh->b_size          = phys_seg[i].nr_sects << 9;
   17.15          bh->b_dev           = phys_seg[i].dev;
   17.16 -        bh->b_rsector       = phys_seg[i].sector_number;
   17.17 +        bh->b_rsector       = (unsigned long)phys_seg[i].sector_number;
   17.18          bh->b_data          = phys_to_virt(phys_seg[i].buffer);
   17.19          bh->b_end_io        = end_block_io_op;
   17.20          bh->pending_req     = pending_req;
    18.1 --- a/xen/drivers/block/xen_vbd.c	Wed Feb 11 22:45:55 2004 +0000
    18.2 +++ b/xen/drivers/block/xen_vbd.c	Thu Feb 12 11:51:34 2004 +0000
    18.3 @@ -88,7 +88,7 @@ long vbd_create(vbd_create_t *create)
    18.4  
    18.5      if ( unlikely((p = find_domain_by_id(create->domain)) == NULL) )
    18.6      {
    18.7 -        DPRINTK("vbd_create attempted for non-existent domain %d\n", 
    18.8 +        DPRINTK("vbd_create attempted for non-existent domain %llu\n", 
    18.9                  create->domain); 
   18.10          return -EINVAL; 
   18.11      }
   18.12 @@ -170,7 +170,7 @@ long vbd_grow(vbd_grow_t *grow)
   18.13  
   18.14      if ( unlikely((p = find_domain_by_id(grow->domain)) == NULL) )
   18.15      {
   18.16 -        DPRINTK("vbd_grow: attempted for non-existent domain %d\n", 
   18.17 +        DPRINTK("vbd_grow: attempted for non-existent domain %llu\n", 
   18.18                  grow->domain); 
   18.19          return -EINVAL; 
   18.20      }
   18.21 @@ -197,7 +197,7 @@ long vbd_shrink(vbd_shrink_t *shrink)
   18.22  
   18.23      if ( (p = find_domain_by_id(shrink->domain)) == NULL )
   18.24      {
   18.25 -        DPRINTK("vbd_shrink attempted for non-existent domain %d\n", 
   18.26 +        DPRINTK("vbd_shrink attempted for non-existent domain %llu\n", 
   18.27                  shrink->domain); 
   18.28          return -EINVAL; 
   18.29      }
   18.30 @@ -259,7 +259,7 @@ long vbd_setextents(vbd_setextents_t *se
   18.31  
   18.32      if ( (p = find_domain_by_id(setextents->domain)) == NULL )
   18.33      {
   18.34 -        DPRINTK("vbd_setextents attempted for non-existent domain %d\n", 
   18.35 +        DPRINTK("vbd_setextents attempted for non-existent domain %llu\n", 
   18.36                  setextents->domain); 
   18.37          return -EINVAL; 
   18.38      }
   18.39 @@ -355,7 +355,7 @@ long vbd_delete(vbd_delete_t *delete)
   18.40  
   18.41      if ( (p = find_domain_by_id(delete->domain)) == NULL )
   18.42      {
   18.43 -        DPRINTK("vbd_delete attempted for non-existent domain %d\n", 
   18.44 +        DPRINTK("vbd_delete attempted for non-existent domain %llu\n", 
   18.45                  delete->domain); 
   18.46          return -EINVAL; 
   18.47      }
   18.48 @@ -450,7 +450,7 @@ static int vbd_probe_single(xen_disk_inf
   18.49      cur_disk.info   = vbd->type;
   18.50      if ( !VBD_CAN_WRITE(vbd) )
   18.51          cur_disk.info |= XD_FLAG_RO; 
   18.52 -    cur_disk.capacity = 0 ; 
   18.53 +    cur_disk.capacity = 0ULL;
   18.54      for ( x = vbd->extents; x != NULL; x = x->next )
   18.55          cur_disk.capacity += x->extent.nr_sectors; 
   18.56      cur_disk.domain = p->domain; 
   18.57 @@ -542,7 +542,7 @@ long vbd_probe(vbd_probe_t *probe)
   18.58          if ( (probe->domain != VBD_PROBE_ALL) &&
   18.59               ((p = find_domain_by_id(probe->domain)) == NULL) )
   18.60          {
   18.61 -            DPRINTK("vbd_probe attempted for non-existent domain %d\n", 
   18.62 +            DPRINTK("vbd_probe attempted for non-existent domain %llu\n", 
   18.63                      probe->domain); 
   18.64              return -EINVAL; 
   18.65          }
   18.66 @@ -597,7 +597,7 @@ long vbd_info(vbd_info_t *info)
   18.67  
   18.68      if ( (p = find_domain_by_id(info->domain)) == NULL )
   18.69      {
   18.70 -        DPRINTK("vbd_info attempted for non-existent domain %d\n", 
   18.71 +        DPRINTK("vbd_info attempted for non-existent domain %llu\n", 
   18.72                  info->domain); 
   18.73          return -EINVAL; 
   18.74      }
   18.75 @@ -653,7 +653,8 @@ int vbd_translate(phys_seg_t *pseg, stru
   18.76      xen_extent_le_t *x; 
   18.77      vbd_t *vbd;
   18.78      rb_node_t *rb;
   18.79 -    unsigned long sec_off, nr_secs;
   18.80 +    xen_sector_t sec_off;
   18.81 +    unsigned long nr_secs;
   18.82  
   18.83      spin_lock(&p->vbd_lock);
   18.84  
   18.85 @@ -669,7 +670,7 @@ int vbd_translate(phys_seg_t *pseg, stru
   18.86              goto found;
   18.87      }
   18.88  
   18.89 -    DPRINTK("vbd_translate; domain %d attempted to access "
   18.90 +    DPRINTK("vbd_translate; domain %llu attempted to access "
   18.91              "non-existent VBD.\n", p->domain); 
   18.92  
   18.93      spin_unlock(&p->vbd_lock);
    19.1 --- a/xen/include/hypervisor-ifs/block.h	Wed Feb 11 22:45:55 2004 +0000
    19.2 +++ b/xen/include/hypervisor-ifs/block.h	Thu Feb 12 11:51:34 2004 +0000
    19.3 @@ -8,6 +8,8 @@
    19.4  #ifndef __BLOCK_H__
    19.5  #define __BLOCK_H__
    19.6  
    19.7 +typedef u64 xen_sector_t;
    19.8 +
    19.9  /*
   19.10   *
   19.11   * These are the ring data structures for buffering messages between 
   19.12 @@ -28,16 +30,17 @@
   19.13  /*
   19.14   * Maximum scatter/gather segments per request.
   19.15   * This is carefully chosen so that sizeof(blk_ring_t) <= PAGE_SIZE.
   19.16 + * NB. This could be 12 if the ring indexes weren't stored in the same page.
   19.17   */
   19.18 -#define MAX_BLK_SEGS 12
   19.19 +#define MAX_BLK_SEGS 11
   19.20  
   19.21  typedef struct blk_ring_req_entry 
   19.22  {
   19.23      unsigned long  id;                     /* private guest os value       */
   19.24 -    unsigned long  sector_number;          /* start sector idx on disk     */
   19.25      unsigned short device;                 /* XENDEV_??? + idx             */
   19.26      unsigned char  operation;              /* XEN_BLOCK_???                */
   19.27      unsigned char  nr_segments;            /* number of segments           */
   19.28 +    xen_sector_t   sector_number;          /* start sector idx on disk     */
   19.29      /* Least 9 bits is 'nr_sects'. High 23 bits are the address.           */
   19.30      unsigned long  buffer_and_sects[MAX_BLK_SEGS];
   19.31  } blk_ring_req_entry_t;
   19.32 @@ -97,7 +100,7 @@ typedef struct xen_disk
   19.33  {
   19.34      unsigned short device;       /* device number (opaque 16 bit val)  */
   19.35      unsigned short info;         /* device type and flags              */
   19.36 -    unsigned long  capacity;     /* size in terms of #512 byte sectors */
   19.37 +    xen_sector_t   capacity;     /* size in terms of #512 byte sectors */
   19.38      domid_t        domain;       /* if a VBD, domain this 'belongs to' */
   19.39  } xen_disk_t;
   19.40  
    20.1 --- a/xen/include/hypervisor-ifs/vbd.h	Wed Feb 11 22:45:55 2004 +0000
    20.2 +++ b/xen/include/hypervisor-ifs/vbd.h	Thu Feb 12 11:51:34 2004 +0000
    20.3 @@ -18,10 +18,10 @@
    20.4  #define BLOCK_IO_OP_VBD_INFO     9    /* query info about a particular VBD */
    20.5  
    20.6  typedef struct _xen_extent { 
    20.7 -    u16       device; 
    20.8 -    u16       unused;
    20.9 -    ulong     start_sector; 
   20.10 -    ulong     nr_sectors;
   20.11 +    u16          device; 
   20.12 +    u16          unused;
   20.13 +    xen_sector_t start_sector; 
   20.14 +    xen_sector_t nr_sectors;
   20.15  } xen_extent_t; 
   20.16  
   20.17  #define VBD_MODE_R         0x1
    21.1 --- a/xen/include/xeno/vbd.h	Wed Feb 11 22:45:55 2004 +0000
    21.2 +++ b/xen/include/xeno/vbd.h	Thu Feb 12 11:51:34 2004 +0000
    21.3 @@ -57,8 +57,8 @@ void destroy_all_vbds(struct task_struct
    21.4  typedef struct {
    21.5      unsigned short dev;
    21.6      unsigned short nr_sects;
    21.7 -    unsigned long  sector_number;
    21.8      unsigned long  buffer;
    21.9 +    xen_sector_t   sector_number;
   21.10  } phys_seg_t;
   21.11  
   21.12  
    22.1 --- a/xen/net/dev.c	Wed Feb 11 22:45:55 2004 +0000
    22.2 +++ b/xen/net/dev.c	Thu Feb 12 11:51:34 2004 +0000
    22.3 @@ -2064,7 +2064,7 @@ static void get_rx_bufs(net_vif_t *vif)
    22.4          if ( unlikely(pte_pfn >= max_page) ||
    22.5               unlikely(!get_page_and_type(pte_page, p, PGT_l1_page_table)) )
    22.6          {
    22.7 -            DPRINTK("Bad page frame for ppte %d,%08lx,%08lx,%08lx\n",
    22.8 +            DPRINTK("Bad page frame for ppte %llu,%08lx,%08lx,%08lx\n",
    22.9                      p->domain, pte_pfn, max_page, pte_page->type_and_flags);
   22.10              make_rx_response(vif, rx.id, 0, RING_STATUS_BAD_PAGE, 0);
   22.11              continue;
    23.1 --- a/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c	Wed Feb 11 22:45:55 2004 +0000
    23.2 +++ b/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_block.c	Thu Feb 12 11:51:34 2004 +0000
    23.3 @@ -366,7 +366,7 @@ static int hypervisor_request(unsigned l
    23.4      req = &blk_ring->ring[MASK_BLK_IDX(req_prod)].req;
    23.5      req->id            = id;
    23.6      req->operation     = operation;
    23.7 -    req->sector_number = sector_number;
    23.8 +    req->sector_number = (xen_sector_t)sector_number;
    23.9      req->device        = device; 
   23.10      req->nr_segments   = 1;
   23.11      req->buffer_and_sects[0] = buffer_ma | nr_sectors;
    24.1 --- a/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c	Wed Feb 11 22:45:55 2004 +0000
    24.2 +++ b/xenolinux-2.4.24-sparse/arch/xeno/drivers/block/xl_vbd.c	Thu Feb 12 11:51:34 2004 +0000
    24.3 @@ -102,6 +102,7 @@ static int xlvbd_init_device(xen_disk_t 
    24.4      struct block_device *bd;
    24.5      xl_disk_t *disk;
    24.6      int i, rc = 0, max_part, partno;
    24.7 +    unsigned long capacity;
    24.8  
    24.9      unsigned char buf[64];
   24.10  
   24.11 @@ -237,6 +238,9 @@ static int xlvbd_init_device(xen_disk_t 
   24.12  
   24.13      gd->flags[minor >> gd->minor_shift] |= GENHD_FL_XENO;
   24.14          
   24.15 +    /* NB. Linux 2.4 only handles 32-bit sector offsets and capacities. */
   24.16 +    capacity = (unsigned long)xd->capacity;
   24.17 +
   24.18      if ( partno != 0 )
   24.19      {
   24.20          /*
   24.21 @@ -268,15 +272,15 @@ static int xlvbd_init_device(xen_disk_t 
   24.22  
   24.23          /* Need to skankily setup 'partition' information */
   24.24          gd->part[minor].start_sect = 0; 
   24.25 -        gd->part[minor].nr_sects   = xd->capacity; 
   24.26 -        gd->sizes[minor]           = xd->capacity; 
   24.27 +        gd->part[minor].nr_sects   = capacity; 
   24.28 +        gd->sizes[minor]           = capacity; 
   24.29  
   24.30          gd->flags[minor >> gd->minor_shift] |= GENHD_FL_VIRT_PARTNS;
   24.31      }
   24.32      else
   24.33      {
   24.34 -        gd->part[minor].nr_sects = xd->capacity;
   24.35 -        gd->sizes[minor] = xd->capacity>>(BLOCK_SIZE_BITS-9);
   24.36 +        gd->part[minor].nr_sects = capacity;
   24.37 +        gd->sizes[minor] = capacity>>(BLOCK_SIZE_BITS-9);
   24.38          
   24.39          /* Some final fix-ups depending on the device type */
   24.40          switch ( XD_TYPE(xd->info) )
   24.41 @@ -301,8 +305,7 @@ static int xlvbd_init_device(xen_disk_t 
   24.42                         disk_name(gd, MINOR(device), buf));
   24.43                  break;
   24.44              }
   24.45 -            register_disk(gd, device, gd->max_p, &xlvbd_block_fops, 
   24.46 -                          xd->capacity);            
   24.47 +            register_disk(gd, device, gd->max_p, &xlvbd_block_fops, capacity);
   24.48              break; 
   24.49  
   24.50          default: