Get rid of memory_t. Almost all uses should be unsigned long.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 19 Aug 2005 17:25:04 +0000 (17:25 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 19 Aug 2005 17:25:04 +0000 (17:25 +0000)
The few uses for a physical/machine address have been mostly
changed to u64.

Grant table code probably needs auditing for PAE correctness,
but at least the interface is now sound.

Signed-off-by: Keir Fraser <keir@xensource.com>
30 files changed:
linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c
linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/process.c
linux-2.6-xen-sparse/drivers/xen/blkback/common.h
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h
linux-2.6-xen-sparse/drivers/xen/netback/common.h
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
tools/debugger/libxendebug/xendebug.c
tools/debugger/libxendebug/xendebug.h
tools/debugger/pdb/linux-2.6-module/debug.c
tools/debugger/pdb/linux-2.6-module/module.c
tools/debugger/pdb/linux-2.6-module/pdb_debug.h
tools/debugger/pdb/pdb_caml_domain.c
tools/debugger/pdb/pdb_caml_process.c
tools/debugger/pdb/pdb_caml_xcs.c
tools/libxc/xc.h
tools/libxc/xc_gnttab.c
tools/python/xen/lowlevel/xu/xu.c
tools/xentrace/xentrace.c
xen/arch/x86/physdev.c
xen/common/trace.c
xen/include/public/arch-ia64.h
xen/include/public/arch-x86_32.h
xen/include/public/arch-x86_64.h
xen/include/public/dom0_ops.h
xen/include/public/grant_table.h
xen/include/public/io/domain_controller.h
xen/include/public/io/netif.h
xen/include/public/physdev.h
xen/include/public/xen.h

index 314033ce415e747ce152bb0bab4563b1adfcd8e8..14bb12317482501ab6aec6d0864138709cd4ad0f 100644 (file)
@@ -80,7 +80,7 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
                t->io_bitmap_ptr = bitmap;
 
                op.cmd = PHYSDEVOP_SET_IOBITMAP;
-               op.u.set_iobitmap.bitmap   = (unsigned long)bitmap;
+               op.u.set_iobitmap.bitmap   = (char *)bitmap;
                op.u.set_iobitmap.nr_ports = IO_BITMAP_BITS;
                HYPERVISOR_physdev_op(&op);
        }
index 298b0183343fad280a5b289ebe3776a486b7cb50..14ae68f3c9b28af3427b68a2beadeacd14e92d59 100644 (file)
@@ -547,7 +547,7 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
                iobmp_op.cmd                     =
                        PHYSDEVOP_SET_IOBITMAP;
                iobmp_op.u.set_iobitmap.bitmap   =
-                       (unsigned long)next->io_bitmap_ptr;
+                       (char *)next->io_bitmap_ptr;
                iobmp_op.u.set_iobitmap.nr_ports =
                        next->io_bitmap_ptr ? IO_BITMAP_BITS : 0;
                mcl->op      = __HYPERVISOR_physdev_op;
index ee10b8d8b83c82bbc584e49a08d8ba14b9b69241..e234671dbde71235e09cc2e7a33286eae3bc0e8f 100644 (file)
@@ -474,7 +474,7 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *
                iobmp_op.cmd                     =
                        PHYSDEVOP_SET_IOBITMAP;
                iobmp_op.u.set_iobitmap.bitmap   =
-                       (unsigned long)next->io_bitmap_ptr;
+                       (char *)next->io_bitmap_ptr;
                iobmp_op.u.set_iobitmap.nr_ports =
                        next->io_bitmap_ptr ? IO_BITMAP_BITS : 0;
                mcl->op      = __HYPERVISOR_physdev_op;
index 36f3441e0bbdc8e392e9c4976f474700b12279c2..ffb44a78d6797f03032d99b9b87ff066de2d1c81 100644 (file)
@@ -71,7 +71,7 @@ typedef struct blkif_st {
     struct work_struct work;
 #ifdef CONFIG_XEN_BLKDEV_GRANT
     u16 shmem_handle;
-    memory_t shmem_vaddr;
+    unsigned long shmem_vaddr;
     grant_ref_t shmem_ref;
 #endif
 } blkif_t;
index b3368aa7d6f6ab3a03521a98df0c91c0d07fdedf..655d568d2409eb08a7649623a01bf955715a32bc 100644 (file)
@@ -87,7 +87,7 @@ typedef struct blkif_st {
     struct work_struct work;
 #ifdef CONFIG_XEN_BLKDEV_GRANT
     u16 shmem_handle;
-    memory_t shmem_vaddr;
+    unsigned long shmem_vaddr;
     grant_ref_t shmem_ref;
 #endif
 } blkif_t;
index c3c877ce6cb34efe1a5c37287a741741ff1d1794..b54844c0796e9096160628a40308407266c39272 100644 (file)
@@ -49,13 +49,13 @@ typedef struct netif_st {
     unsigned long    tx_shmem_frame;
 #ifdef CONFIG_XEN_NETDEV_GRANT_TX
     u16              tx_shmem_handle;
-    memory_t         tx_shmem_vaddr; 
+    unsigned long    tx_shmem_vaddr; 
     grant_ref_t      tx_shmem_ref; 
 #endif
     unsigned long    rx_shmem_frame;
 #ifdef CONFIG_XEN_NETDEV_GRANT_RX
     u16              rx_shmem_handle;
-    memory_t         rx_shmem_vaddr; 
+    unsigned long    rx_shmem_vaddr; 
     grant_ref_t      rx_shmem_ref; 
 #endif
     unsigned int     evtchn;
index 2315e8862bc43ea1c916f137a2a7949666396758..a0b61167aa2f0424e46b38f318b7035ba59d2398 100644 (file)
@@ -43,7 +43,7 @@ static void make_tx_response(netif_t *netif,
 static int  make_rx_response(netif_t *netif, 
                              u16      id, 
                              s8       st,
-                             memory_t addr,
+                             unsigned long addr,
                              u16      size,
                              u16      csum_valid);
 
@@ -887,7 +887,7 @@ static void make_tx_response(netif_t *netif,
 static int make_rx_response(netif_t *netif, 
                             u16      id, 
                             s8       st,
-                            memory_t addr,
+                            unsigned long addr,
                             u16      size,
                             u16      csum_valid)
 {
index 176aff9b79096435a179ce33c477c3a60119056e..20f6ffd06297ce99adcaf9e95f975cc607afaa82 100644 (file)
@@ -40,7 +40,7 @@ typedef int boolean;
 typedef struct bwcpoint                           /* break/watch/catch point */
 {
     struct list_head list;
-    memory_t address;
+    unsigned long address;
     u32 domain;
     u8 old_value;                             /* old value for software bkpt */
 } bwcpoint_t, *bwcpoint_p;
@@ -311,7 +311,7 @@ xendebug_continue(int xc_handle,
 /* access to one page */
 static int
 xendebug_memory_page (domain_context_p ctxt, int xc_handle, u32 vcpu,
-                      int protection, memory_t address, int length, u8 *buffer)
+                      int protection, unsigned long address, int length, u8 *buffer)
 {
     vcpu_guest_context_t *vcpu_ctxt = &ctxt->context[vcpu];
     unsigned long pde, page;
@@ -407,7 +407,7 @@ xendebug_memory_page (domain_context_p ctxt, int xc_handle, u32 vcpu,
 /* divide a memory operation into accesses to individual pages */
 static int
 xendebug_memory_op (domain_context_p ctxt, int xc_handle, u32 vcpu,
-                    int protection, memory_t address, int length, u8 *buffer)
+                    int protection, unsigned long address, int length, u8 *buffer)
 {
     int      remain;              /* number of bytes to touch past this page */
     int      bytes   = 0;
@@ -431,7 +431,7 @@ int
 xendebug_read_memory(int xc_handle,
                      u32 domid,
                      u32 vcpu,
-                     memory_t address,
+                     unsigned long address,
                      u32 length,
                      u8 *data)
 {
@@ -451,7 +451,7 @@ int
 xendebug_write_memory(int xc_handle,
                       u32 domid,
                       u32 vcpu,
-                      memory_t address,
+                      unsigned long address,
                       u32 length,
                       u8 *data)
 {
@@ -471,7 +471,7 @@ int
 xendebug_insert_memory_breakpoint(int xc_handle,
                                   u32 domid,
                                   u32 vcpu,
-                                  memory_t address,
+                                  unsigned long address,
                                   u32 length)
 {
     bwcpoint_p bkpt;
@@ -517,7 +517,7 @@ int
 xendebug_remove_memory_breakpoint(int xc_handle,
                                   u32 domid,
                                   u32 vcpu,
-                                  memory_t address,
+                                  unsigned long address,
                                   u32 length)
 {
     bwcpoint_p bkpt = NULL;
index 66a45104ba04861ead919b65b4779698f0bb1a02..bf79a3b239496cf6d16611a8669a8a223db7f78d 100644 (file)
@@ -45,7 +45,7 @@ int xendebug_continue(int xc_handle,
 int xendebug_read_memory(int xc_handle,
                         u32 domid,
                         u32 vcpu,
-                        memory_t address,
+                        unsigned long address,
                         u32 length,
                         u8 *data);
 
@@ -53,7 +53,7 @@ int xendebug_read_memory(int xc_handle,
 int xendebug_write_memory(int xc_handle,
                          u32 domid,
                          u32 vcpu,
-                         memory_t address,
+                         unsigned long address,
                          u32 length,
                          u8 *data);
 
@@ -61,13 +61,13 @@ int xendebug_write_memory(int xc_handle,
 int xendebug_insert_memory_breakpoint(int xc_handle,
                                      u32 domid,
                                      u32 vcpu,
-                                     memory_t address,
+                                     unsigned long address,
                                      u32 length);
 
 int xendebug_remove_memory_breakpoint(int xc_handle,
                                      u32 domid,
                                      u32 vcpu,
-                                     memory_t address,
+                                     unsigned long address,
                                      u32 length);
 
 int xendebug_query_domain_stop(int xc_handle,
index ae1064ebad8666cc690f241f17fb70b292707c42..00955313f5c5ac4f06edb6bec52add7238106041 100644 (file)
@@ -26,7 +26,7 @@ static int pdb_page_fault_fn (struct pt_regs *regs, long error_code,
 typedef struct bwcpoint                           /* break/watch/catch point */
 {
     struct list_head list;
-    memory_t address;
+    unsigned long address;
     int length;
 
     u8  type;                                                     /* BWC_??? */
@@ -109,7 +109,7 @@ pdb_bwc_print_list (void)
 }
 
 bwcpoint_p
-pdb_search_watchpoint (u32 process, memory_t address)
+pdb_search_watchpoint (u32 process, unsigned long address)
 {
     bwcpoint_p bwc_watch = (bwcpoint_p) 0;
     bwcpoint_p bwc_entry = (bwcpoint_p) 0;
@@ -364,7 +364,7 @@ pdb_step (struct task_struct *target)
 
 int
 pdb_insert_memory_breakpoint (struct task_struct *target, 
-                              memory_t address, u32 length)
+                              unsigned long address, u32 length)
 {
     int rc = 0;
     bwcpoint_p bkpt;
@@ -399,7 +399,7 @@ pdb_insert_memory_breakpoint (struct task_struct *target,
 
 int
 pdb_remove_memory_breakpoint (struct task_struct *target,
-                              memory_t address, u32 length)
+                              unsigned long address, u32 length)
 {
     int rc = 0;
     bwcpoint_p bkpt = NULL;
@@ -760,7 +760,7 @@ pdb_int3_fn (struct pt_regs *regs, long error_code)
 {
     pdb_response_t resp;
     bwcpoint_p bkpt = NULL;
-    memory_t address = regs->eip - 1;
+    unsigned long address = regs->eip - 1;
 
     struct list_head *entry;
     list_for_each(entry, &bwcpoint_list)
index b8093f9d3f36dac68415c6db64f2c4bdfb85cda5..776a7a8b6842a1f63d021a5b998ae67995078996 100644 (file)
@@ -199,7 +199,7 @@ pdb_interrupt (int irq, void *dev_id, struct pt_regs *ptregs)
 }
 
 static void
-pdb_send_connection_status(int status, memory_t ring)
+pdb_send_connection_status(int status, unsigned long ring)
 {
     ctrl_msg_t cmsg = 
     {
index 2d30eae625624b7680e4cdfa4855f2e0ae8b492e..7993464c3194d9f61b4d4545f092a59b23268661 100644 (file)
@@ -18,9 +18,9 @@ int pdb_continue (struct task_struct *target);
 int pdb_step (struct task_struct *target);
 
 int pdb_insert_memory_breakpoint (struct task_struct *target, 
-                                  memory_t address, u32 length);
+                                  unsigned long address, u32 length);
 int pdb_remove_memory_breakpoint (struct task_struct *target,
-                                  memory_t address, u32 length);
+                                  unsigned long address, u32 length);
 int pdb_insert_watchpoint (struct task_struct *target,
                            pdb_op_watchpt_p watchpt);
 int pdb_remove_watchpoint (struct task_struct *target,
index 934524ba0cca97c125081d36c77302479bb30982..5a14a2b82dd5e90bb580d374fdb946bb8c8b5534 100644 (file)
@@ -203,7 +203,7 @@ dom_read_memory (value context, value address, value length)
     context_t ctx;
     int loop;
     char *buffer;
-    memory_t my_address = Int32_val(address);
+    unsigned long my_address = Int32_val(address);
     u32 my_length = Int_val(length);
 
     printf ("(pdb) read memory\n");
@@ -259,7 +259,7 @@ dom_write_memory (value context, value address, value val_list)
     context_t ctx;
 
     char buffer[4096];  /* a big buffer */
-    memory_t  my_address;
+    unsigned long  my_address;
     u32 length = 0;
 
     printf ("(pdb) write memory\n");
@@ -279,7 +279,7 @@ dom_write_memory (value context, value address, value val_list)
     }
     buffer[length++] = Int_val(Field(node, 0));
 
-    my_address = (memory_t) Int32_val(address);
+    my_address = (unsigned long) Int32_val(address);
 
     if ( xendebug_write_memory(xc_handle, ctx.domain, ctx.vcpu,
                                my_address, length, buffer) )
@@ -344,7 +344,7 @@ dom_insert_memory_breakpoint (value context, value address, value length)
     CAMLparam3(context, address, length);
 
     context_t ctx;
-    memory_t my_address = (memory_t) Int32_val(address);
+    unsigned long my_address = (unsigned long) Int32_val(address);
     int my_length = Int_val(length);
 
     decode_context(&ctx, context);
@@ -373,7 +373,7 @@ dom_remove_memory_breakpoint (value context, value address, value length)
 
     context_t ctx;
 
-    memory_t my_address = (memory_t) Int32_val(address);
+    unsigned long my_address = (unsigned long) Int32_val(address);
     int my_length = Int_val(length);
 
     printf ("(pdb) remove memory breakpoint 0x%lx %d\n",
index 760a18273248b6f336acf5950459c04dde92e265..1e2dd7abf11e7457a89b299634532cb496402d0e 100644 (file)
@@ -495,7 +495,7 @@ proc_insert_memory_breakpoint (value context, value address, value length)
 
     req.operation = PDB_OPCODE_SET_BKPT;
     req.process = ctx.process;
-    req.u.bkpt.address = (memory_t) Int32_val(address);
+    req.u.bkpt.address = (unsigned long) Int32_val(address);
     req.u.bkpt.length  =  Int_val(length);
 
     send_request(ctx.ring, ctx.evtchn, &req);
@@ -518,7 +518,7 @@ proc_remove_memory_breakpoint (value context, value address, value length)
 
     req.operation = PDB_OPCODE_CLR_BKPT;
     req.process = ctx.process;
-    req.u.bkpt.address = (memory_t) Int32_val(address);
+    req.u.bkpt.address = (unsigned long) Int32_val(address);
     req.u.bkpt.length  =  Int_val(length);
 
     send_request(ctx.ring, ctx.evtchn, &req);
@@ -542,7 +542,7 @@ proc_insert_watchpoint (value context, value kind, value address, value length)
     req.operation = PDB_OPCODE_SET_WATCHPT;
     req.process = ctx.process;
     req.u.watchpt.type    =  Int_val(kind);
-    req.u.watchpt.address = (memory_t) Int32_val(address);
+    req.u.watchpt.address = (unsigned long) Int32_val(address);
     req.u.watchpt.length  =  Int_val(length);
 
     send_request(ctx.ring, ctx.evtchn, &req);
@@ -566,7 +566,7 @@ proc_remove_watchpoint (value context, value kind, value address, value length)
     req.operation = PDB_OPCODE_CLR_WATCHPT;
     req.process = ctx.process;
     req.u.watchpt.type    =  Int_val(kind);
-    req.u.watchpt.address = (memory_t) Int32_val(address);
+    req.u.watchpt.address = (unsigned long) Int32_val(address);
     req.u.watchpt.length  =  Int_val(length);
 
     send_request(ctx.ring, ctx.evtchn, &req);
index a1ba0808d2254914cb91afe3719b5b25cbb5e055..62e988eaef55b11bf20a3d0764360a595f53f7bd 100644 (file)
@@ -50,7 +50,7 @@ xcs_initialize_ring (value domain, value ring)
 {
     CAMLparam2(domain, ring);
     int my_domain = Int_val(domain);
-    memory_t my_ring = Int32_val(ring);
+    unsigned long my_ring = Int32_val(ring);
 
     pdb_front_ring_t *front_ring;
     pdb_sring_t *sring;
index 5cd61d9e2097f3e776cf58b1c510a8a2c26541e5..66cc8059204db9f0885847e23d53ec171eaef715 100644 (file)
@@ -515,25 +515,25 @@ int xc_grant_interface_open(void);
  */
 int xc_grant_interface_close(int xc_handle);
 
-int xc_gnttab_map_grant_ref(int         xc_handle,
-                            memory_t    host_virt_addr,
-                            u32         dom,
-                            u16         ref,
-                            u16         flags,
-                            s16        *handle,
-                            memory_t   *dev_bus_addr);
-
-int xc_gnttab_unmap_grant_ref(int       xc_handle,
-                              memory_t  host_virt_addr,
-                              memory_t  dev_bus_addr,
-                              u16       handle,
-                              s16      *status);
+int xc_gnttab_map_grant_ref(int  xc_handle,
+                            u64  host_virt_addr,
+                            u32  dom,
+                            u16  ref,
+                            u16  flags,
+                            s16 *handle,
+                            u64 *dev_bus_addr);
+
+int xc_gnttab_unmap_grant_ref(int  xc_handle,
+                              u64  host_virt_addr,
+                              u64  dev_bus_addr,
+                              u16  handle,
+                              s16 *status);
 
 int xc_gnttab_setup_table(int        xc_handle,
                           u32        dom,
                           u16        nr_frames,
                           s16       *status,
-                          memory_t **frame_list);
+                          unsigned long **frame_list);
 
 /* Grant debug builds only: */
 int xc_gnttab_dump_table(int        xc_handle,
index 83fcf9218c0c07b5db4c85d23a68acda5a691761..0f2d71751915634404a92e3f90768ac09d6af154 100644 (file)
@@ -40,12 +40,12 @@ do_gnttab_op(int xc_handle,
 
 
 int xc_gnttab_map_grant_ref(int         xc_handle,
-                            memory_t    host_virt_addr,
+                            u64    host_virt_addr,
                             u32         dom,
                             u16         ref,
                             u16         flags,
                             s16        *handle,
-                            memory_t   *dev_bus_addr)
+                            u64   *dev_bus_addr)
 {
     struct gnttab_map_grant_ref op;
     int rc;
@@ -67,8 +67,8 @@ int xc_gnttab_map_grant_ref(int         xc_handle,
 
 
 int xc_gnttab_unmap_grant_ref(int       xc_handle,
-                              memory_t  host_virt_addr,
-                              memory_t  dev_bus_addr,
+                              u64  host_virt_addr,
+                              u64  dev_bus_addr,
                               u16       handle,
                               s16      *status)
 {
@@ -92,7 +92,7 @@ int xc_gnttab_setup_table(int        xc_handle,
                           u32        dom,
                           u16        nr_frames,
                           s16       *status,
-                          memory_t **frame_list)
+                          unsigned long **frame_list)
 {
     struct gnttab_setup_table op;
     int rc, i;
index 832630e05708f147a4f3de41396263ea27001fbe..0f275448984d56ade08f9f2dff0291ec14bdbb85 100644 (file)
@@ -844,7 +844,7 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args)
     case TYPE(CMSG_BLKIF_BE, CMSG_BLKIF_BE_CONNECT):
         P2C(blkif_be_connect_t, domid,        u32);
         P2C(blkif_be_connect_t, blkif_handle, u32);
-        P2C(blkif_be_connect_t, shmem_frame,  memory_t);
+        P2C(blkif_be_connect_t, shmem_frame,  unsigned long);
         P2C(blkif_be_connect_t, shmem_ref,    u32);
         P2C(blkif_be_connect_t, evtchn,       u16);
         break;
@@ -906,9 +906,9 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args)
     case TYPE(CMSG_NETIF_BE, CMSG_NETIF_BE_CONNECT):
         P2C(netif_be_connect_t, domid,          u32);
         P2C(netif_be_connect_t, netif_handle,   u32);
-        P2C(netif_be_connect_t, tx_shmem_frame, memory_t);
+        P2C(netif_be_connect_t, tx_shmem_frame, unsigned long);
         P2C(netif_be_connect_t, tx_shmem_ref,   u32); 
-        P2C(netif_be_connect_t, rx_shmem_frame, memory_t);
+        P2C(netif_be_connect_t, rx_shmem_frame, unsigned long);
         P2C(netif_be_connect_t, rx_shmem_ref,   u32); 
         P2C(netif_be_connect_t, evtchn,         u16); 
         break;
@@ -942,7 +942,7 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args)
         P2C(usbif_fe_driver_status_changed_t, status, u32);
         break;
     case TYPE(CMSG_USBIF_FE, CMSG_USBIF_FE_INTERFACE_CONNECT):
-        P2C(usbif_fe_interface_connect_t, shmem_frame, memory_t);
+        P2C(usbif_fe_interface_connect_t, shmem_frame, unsigned long);
         break;
     case TYPE(CMSG_USBIF_FE, CMSG_USBIF_FE_INTERFACE_DISCONNECT):
         break;
@@ -956,7 +956,7 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args)
         break;
     case TYPE(CMSG_USBIF_BE, CMSG_USBIF_BE_CONNECT):
         P2C(usbif_be_connect_t, domid, domid_t);
-        P2C(usbif_be_connect_t, shmem_frame, memory_t);
+        P2C(usbif_be_connect_t, shmem_frame, unsigned long);
         P2C(usbif_be_connect_t, evtchn, u32);
         P2C(usbif_be_connect_t, bandwidth, u32);
         P2C(usbif_be_connect_t, status, u32);
index 2d59ac2a79766353e44749057c56987b36e044ad..4eef5a3e633296113563ac8d8f80421c1a79cc22 100644 (file)
@@ -95,13 +95,13 @@ void write_rec(unsigned int cpu, struct t_rec *rec, FILE *out)
 
 /**
  * get_tbufs - get pointer to and size of the trace buffers
- * @mach_addr: location to store machine address if the trace buffers to
- * @size:      location to store the size of a trace buffer to
+ * @mfn:  location to store mfn of the trace buffers to
+ * @size: location to store the size of a trace buffer to
  *
  * Gets the machine address of the trace pointer area and the size of the
  * per CPU buffers.
  */
-void get_tbufs(unsigned long *mach_addr, unsigned long *size)
+void get_tbufs(unsigned long *mfn, unsigned long *size)
 {
     int ret;
     dom0_op_t op;                        /* dom0 op we'll build             */
@@ -121,19 +121,19 @@ void get_tbufs(unsigned long *mach_addr, unsigned long *size)
         exit(EXIT_FAILURE);
     }
 
-    *mach_addr = op.u.tbufcontrol.mach_addr;
-    *size      = op.u.tbufcontrol.size;
+    *mfn  = op.u.tbufcontrol.buffer_mfn;
+    *size = op.u.tbufcontrol.size;
 }
 
 /**
  * map_tbufs - memory map Xen trace buffers into user space
- * @tbufs:     machine address of the trace buffers
+ * @tbufs_mfn: mfn of the trace buffers
  * @num:       number of trace buffers to map
  * @size:      size of each trace buffer
  *
  * Maps the Xen trace buffers them into process address space.
  */
-struct t_buf *map_tbufs(unsigned long tbufs_mach, unsigned int num,
+struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
                         unsigned long size)
 {
     int xc_handle;                  /* file descriptor for /proc/xen/privcmd */
@@ -149,7 +149,7 @@ struct t_buf *map_tbufs(unsigned long tbufs_mach, unsigned int num,
 
     tbufs_mapped = xc_map_foreign_range(xc_handle, 0 /* Dom 0 ID */,
                                         size * num, PROT_READ,
-                                        tbufs_mach >> PAGE_SHIFT);
+                                        tbufs_mfn);
 
     xc_interface_close(xc_handle);
 
@@ -231,7 +231,7 @@ struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
 
 /**
  * init_rec_ptrs - initialises data area pointers to locations in user space
- * @tbufs_mach:    machine base address of the trace buffer area
+ * @tbufs_mfn:     base mfn of the trace buffer area
  * @tbufs_mapped:  user virtual address of base of trace buffer area
  * @meta:          array of user-space pointers to struct t_buf's of metadata
  * @num:           number of trace buffers
@@ -240,7 +240,7 @@ struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
  * mapped in user space.  Note that the trace buffer metadata contains machine
  * pointers - the array returned allows more convenient access to them.
  */
-struct t_rec **init_rec_ptrs(unsigned long tbufs_mach,
+struct t_rec **init_rec_ptrs(unsigned long tbufs_mfn,
                              struct t_buf *tbufs_mapped,
                              struct t_buf **meta,
                              unsigned int num)
@@ -256,7 +256,7 @@ struct t_rec **init_rec_ptrs(unsigned long tbufs_mach,
     }
 
     for ( i = 0; i < num; i++ )
-        data[i] = (struct t_rec *)(meta[i]->rec_addr - tbufs_mach
+        data[i] = (struct t_rec *)(meta[i]->rec_addr - (tbufs_mfn<<XC_PAGE_SHIFT) /* XXX */
                                    + (unsigned long)tbufs_mapped);
 
     return data;
@@ -330,7 +330,7 @@ int monitor_tbufs(FILE *logfile)
     struct t_rec **data;         /* pointers to the trace buffer data areas
                                   * where they are mapped into user space.   */
     unsigned long *cons;         /* store tail indexes for the trace buffers */
-    unsigned long tbufs_mach;    /* machine address of the tbufs             */
+    unsigned long tbufs_mfn;     /* mfn of the tbufs                         */
     unsigned int  num;           /* number of trace buffers / logical CPUS   */
     unsigned long size;          /* size of a single trace buffer            */
 
@@ -340,14 +340,14 @@ int monitor_tbufs(FILE *logfile)
     num = get_num_cpus();
 
     /* setup access to trace buffers */
-    get_tbufs(&tbufs_mach, &size);
-    tbufs_mapped = map_tbufs(tbufs_mach, num, size);
+    get_tbufs(&tbufs_mfn, &size);
+    tbufs_mapped = map_tbufs(tbufs_mfn, num, size);
 
     size_in_recs = (size - sizeof(struct t_buf)) / sizeof(struct t_rec);
 
     /* build arrays of convenience ptrs */
     meta  = init_bufs_ptrs (tbufs_mapped, num, size);
-    data  = init_rec_ptrs  (tbufs_mach, tbufs_mapped, meta, num);
+    data  = init_rec_ptrs  (tbufs_mfn, tbufs_mapped, meta, num);
     cons  = init_tail_idxs (meta, num);
 
     /* now, scan buffers for events */
index 1cbed74240d76ebdbc4cbc7be8178290ed6153d4..376419b2393b7aa423d3a50857e519129f0ce455 100644 (file)
@@ -106,7 +106,7 @@ long do_physdev_op(physdev_op_t *uop)
              (op.u.set_iobitmap.nr_ports > 65536) )
             break;
         ret = 0;
-        current->arch.iobmp       = (u8 *)op.u.set_iobitmap.bitmap;
+        current->arch.iobmp       = op.u.set_iobitmap.bitmap;
         current->arch.iobmp_limit = op.u.set_iobitmap.nr_ports;
         break;
     default:
index 034dbb4d5d2e7666bbad8678228f1b937390eeac..c5af36c4a0449d5b9283774869f40689208f6451 100644 (file)
@@ -113,10 +113,10 @@ int tb_control(dom0_tbufcontrol_t *tbc)
     switch ( tbc->op)
     {
     case DOM0_TBUF_GET_INFO:
-        tbc->cpu_mask  = tb_cpu_mask;
-        tbc->evt_mask  = tb_event_mask;
-        tbc->mach_addr = __pa(t_bufs[0]);
-        tbc->size      = opt_tbuf_size * PAGE_SIZE;
+        tbc->cpu_mask   = tb_cpu_mask;
+        tbc->evt_mask   = tb_event_mask;
+        tbc->buffer_mfn = __pa(t_bufs[0]) >> PAGE_SHIFT;
+        tbc->size       = opt_tbuf_size * PAGE_SIZE;
         break;
     case DOM0_TBUF_SET_CPU_MASK:
         tb_cpu_mask = tbc->cpu_mask;
index 750ec7fae7d537feb3acc50e2c03aa1da0ef03a2..f67a04afd434d2edcd7863219d7f2b5567527d7d 100644 (file)
@@ -13,9 +13,6 @@
 
 #ifndef __ASSEMBLY__
 
-/* NB. Both the following are 64 bits each. */
-typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-
 #define MAX_NR_SECTION  32  // at most 32 memory holes
 typedef struct {
     unsigned long      start;  /* start of memory hole */
index 4e3e7455f8a466fcaa02e95c73515902c6c562f2..2c7b0db362c778b34a9e5f8a8f3e64b9e91af9af 100644 (file)
@@ -63,9 +63,6 @@
 
 #ifndef __ASSEMBLY__
 
-/* NB. Both the following are 32 bits each. */
-typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-
 /*
  * Send an array of these to HYPERVISOR_set_trap_table()
  */
@@ -74,10 +71,10 @@ typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
 #define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
 #define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
 typedef struct trap_info {
-    u8       vector;  /* exception vector                              */
-    u8       flags;   /* 0-3: privilege level; 4: clear event enable?  */
-    u16      cs;      /* code selector                                 */
-    memory_t address; /* code address                                  */
+    u8       vector;       /* exception vector                              */
+    u8       flags;        /* 0-3: privilege level; 4: clear event enable?  */
+    u16      cs;           /* code selector                                 */
+    unsigned long address; /* code offset                                   */
 } trap_info_t;
 
 typedef struct cpu_user_regs {
index 02648a4830d13ed80d1d918cdde3385194cc031a..4594b946a724a02f852c5424d4c562ea4092da13 100644 (file)
@@ -103,9 +103,6 @@ struct switch_to_user {
     /* Bottom of switch_to_user stack frame. */
 };
 
-/* NB. Both the following are 64 bits each. */
-typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
-
 /*
  * Send an array of these to HYPERVISOR_set_trap_table().
  * N.B. As in x86/32 mode, the privilege level specifies which modes may enter
@@ -121,10 +118,10 @@ typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
 #define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
 #define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
 typedef struct trap_info {
-    u8       vector;  /* exception vector                              */
-    u8       flags;   /* 0-3: privilege level; 4: clear event enable?  */
-    u16      cs;      /* code selector                                 */
-    memory_t address; /* code address                                  */
+    u8       vector;       /* exception vector                              */
+    u8       flags;        /* 0-3: privilege level; 4: clear event enable?  */
+    u16      cs;           /* code selector                                 */
+    unsigned long address; /* code offset                                   */
 } trap_info_t;
 
 typedef struct cpu_user_regs {
index 6f8cb22cac37bc79078cb1ffc720b23684af3f77..b5b027726ce35e5579856f6e713d4f2915df54dc 100644 (file)
@@ -19,7 +19,7 @@
  * This makes sure that old versions of dom0 tools will stop working in a
  * well-defined way (rather than crashing the machine, for instance).
  */
-#define DOM0_INTERFACE_VERSION   0xAAAA100E
+#define DOM0_INTERFACE_VERSION   0xAAAA100F
 
 /************************************************************************/
 
 typedef struct {
     /* IN variables. */
     domid_t       domain;
-    memory_t      max_pfns;
+    unsigned long max_pfns;
     void         *buffer;
     /* OUT variables. */
-    memory_t      num_pfns;
+    unsigned long num_pfns;
 } dom0_getmemlist_t;
 
 #define DOM0_SCHEDCTL          6
@@ -83,9 +83,9 @@ typedef struct {
 #define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
 #define DOMFLAGS_SHUTDOWNSHIFT 16
     u32      flags;
-    memory_t tot_pages;
-    memory_t max_pages;
-    memory_t shared_info_frame;       /* MFN of shared_info struct */
+    unsigned long tot_pages;
+    unsigned long max_pages;
+    unsigned long shared_info_frame;       /* MFN of shared_info struct */
     u64      cpu_time;
     u32      n_vcpu;
     s32      vcpu_to_cpu[MAX_VIRT_CPUS];  /* current mapping   */
@@ -155,7 +155,7 @@ typedef struct {
 
 typedef struct {
     /* IN variables. */
-    memory_t pfn;          /* Machine page frame number to query.       */
+    unsigned long pfn;     /* Machine page frame number to query.       */
     domid_t domain;        /* To which domain does the frame belong?    */
     /* OUT variables. */
     /* Is the page PINNED to a type? */
@@ -197,7 +197,7 @@ typedef struct {
     unsigned long cpu_mask;
     u32           evt_mask;
     /* OUT variables */
-    memory_t mach_addr;
+    unsigned long buffer_mfn;
     u32      size;
 } dom0_tbufcontrol_t;
 
@@ -211,8 +211,8 @@ typedef struct {
     u32      sockets_per_node;
     u32      nr_nodes;
     u32      cpu_khz;
-    memory_t total_pages;
-    memory_t free_pages;
+    unsigned long total_pages;
+    unsigned long free_pages;
 } dom0_physinfo_t;
 
 /*
@@ -252,7 +252,7 @@ typedef struct {
     u32            op;
     unsigned long *dirty_bitmap; /* pointer to locked buffer */
     /* IN/OUT variables. */
-    memory_t       pages;        /* size of buffer, updated with actual size */
+    unsigned long  pages;        /* size of buffer, updated with actual size */
     /* OUT variables. */
     dom0_shadow_control_stats_t stats;
 } dom0_shadow_control_t;
@@ -260,15 +260,15 @@ typedef struct {
 #define DOM0_SETDOMAINMAXMEM   28
 typedef struct {
     /* IN variables. */
-    domid_t     domain;
-    memory_t    max_memkb;
+    domid_t       domain;
+    unsigned long max_memkb;
 } dom0_setdomainmaxmem_t;
 
 #define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
 typedef struct {
     /* IN variables. */
-    domid_t  domain;
-    memory_t num;
+    domid_t        domain;
+    unsigned long  num;
     /* IN/OUT variables. */
     unsigned long *array;
 } dom0_getpageframeinfo2_t;
@@ -283,12 +283,12 @@ typedef struct {
 #define DOM0_ADD_MEMTYPE         31
 typedef struct {
     /* IN variables. */
-    memory_t pfn;
-    memory_t nr_pfns;
-    u32      type;
+    unsigned long pfn;
+    unsigned long nr_pfns;
+    u32           type;
     /* OUT variables. */
-    u32      handle;
-    u32      reg;
+    u32           handle;
+    u32           reg;
 } dom0_add_memtype_t;
 
 /*
@@ -311,8 +311,8 @@ typedef struct {
     /* IN variables. */
     u32      reg;
     /* OUT variables. */
-    memory_t pfn;
-    memory_t nr_pfns;
+    unsigned long pfn;
+    unsigned long nr_pfns;
     u32      type;
 } dom0_read_memtype_t;
 
@@ -361,10 +361,10 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t               first_domain;
-    memory_t              max_domains;
+    unsigned int          max_domains;
     dom0_getdomaininfo_t *buffer;
     /* OUT variables. */
-    memory_t              num_domains;
+    unsigned int          num_domains;
 } dom0_getdomaininfolist_t;
 
 #define DOM0_PLATFORM_QUIRK      39  
index d3bf9ed9d31606a8c3b5eaaf80412000ea24c2a7..54bbc45eeb646959d2935f2975ddc945d05f912e 100644 (file)
@@ -153,13 +153,13 @@ typedef u16 grant_ref_t;
 #define GNTTABOP_map_grant_ref        0
 typedef struct gnttab_map_grant_ref {
     /* IN parameters. */
-    memory_t    host_addr;
+    u64         host_addr;
     domid_t     dom;
     grant_ref_t ref;
     u16         flags;                /* GNTMAP_* */
     /* OUT parameters. */
     s16         handle;               /* +ve: handle; -ve: GNTST_* */
-    memory_t    dev_bus_addr;
+    u64         dev_bus_addr;
 } gnttab_map_grant_ref_t;
 
 /*
@@ -176,8 +176,8 @@ typedef struct gnttab_map_grant_ref {
 #define GNTTABOP_unmap_grant_ref      1
 typedef struct gnttab_unmap_grant_ref {
     /* IN parameters. */
-    memory_t    host_addr;
-    memory_t    dev_bus_addr;
+    u64         host_addr;
+    u64         dev_bus_addr;
     u16         handle;
     /* OUT parameters. */
     s16         status;               /* GNTST_* */
@@ -223,7 +223,7 @@ typedef struct gnttab_dump_table {
  */
 #define GNTTABOP_donate                4
 typedef struct {
-    memory_t    mfn;                 /*  0 */
+    unsigned long mfn;               /*  0 */
     domid_t     domid;               /*  4 */
     u16         handle;               /*  8 */
     s16         status;               /*  10: GNTST_* */
index 1ff5f123cfa94baa1e3db76767d0e3b05caf6e11..c681af8d051d3eda6aca8fd76383a724f12d5db4 100644 (file)
@@ -139,7 +139,7 @@ typedef struct blkif_fe_driver_status {
  */
 typedef struct blkif_fe_interface_connect {
     u32      handle;
-    memory_t shmem_frame;
+    unsigned long shmem_frame;
     int      shmem_ref;
 } blkif_fe_interface_connect_t;
 
@@ -249,7 +249,7 @@ typedef struct blkif_be_connect {
     /* IN */
     domid_t    domid;         /* Domain attached to new interface.   */
     u32        blkif_handle;  /* Domain-specific interface handle.   */
-    memory_t   shmem_frame;   /* Page cont. shared comms window.     */
+    unsigned long shmem_frame;/* Page cont. shared comms window.     */
     int        shmem_ref;     /* Grant table reference.              */
     u32        evtchn;        /* Event channel for notifications.    */
     /* OUT */
@@ -364,11 +364,11 @@ typedef struct netif_fe_driver_status {
  *  STATUS_CONNECTED message.
  */
 typedef struct netif_fe_interface_connect {
-    u32        handle;
-    memory_t   tx_shmem_frame; 
-    int        tx_shmem_ref;
-    memory_t   rx_shmem_frame;
-    int        rx_shmem_ref;
+    u32           handle;
+    unsigned long tx_shmem_frame; 
+    int           tx_shmem_ref;
+    unsigned long rx_shmem_frame;
+    int           rx_shmem_ref;
 } netif_fe_interface_connect_t;
 
 /*
@@ -486,13 +486,13 @@ typedef struct netif_be_creditlimit {
  */
 typedef struct netif_be_connect { 
     /* IN */
-    domid_t    domid;          /* Domain attached to new interface.   */
-    u32        netif_handle;   /* Domain-specific interface handle.   */
-    memory_t   tx_shmem_frame; /* Page cont. tx shared comms window.  */
-    int        tx_shmem_ref;   /* Grant reference for above           */
-    memory_t   rx_shmem_frame; /* Page cont. rx shared comms window.  */
-    int        rx_shmem_ref;   /* Grant reference for above           */
-    u16        evtchn;         /* Event channel for notifications.    */
+    domid_t    domid;            /* Domain attached to new interface.   */
+    u32        netif_handle;     /* Domain-specific interface handle.   */
+    unsigned long tx_shmem_frame;/* Page cont. tx shared comms window.  */
+    int        tx_shmem_ref;     /* Grant reference for above           */
+    unsigned long rx_shmem_frame;/* Page cont. rx shared comms window.  */
+    int        rx_shmem_ref;     /* Grant reference for above           */
+    u16        evtchn;           /* Event channel for notifications.    */
     /* OUT */
     u32        status;
 } netif_be_connect_t;
@@ -577,7 +577,7 @@ typedef struct usbif_fe_driver_status_changed {
  *  STATUS_CONNECTED message.
  */
 typedef struct usbif_fe_interface_connect {
-    memory_t shmem_frame;
+    unsigned long shmem_frame;
 } usbif_fe_interface_connect_t;
 
 /*
@@ -660,7 +660,7 @@ typedef struct usbif_be_destroy {
 typedef struct usbif_be_connect { 
     /* IN */
     domid_t    domid;         /* Domain attached to new interface.   */
-    memory_t   shmem_frame;   /* Page cont. shared comms window.     */
+    unsigned long shmem_frame;/* Page cont. shared comms window.     */
     u32        evtchn;        /* Event channel for notifications.    */
     u32        bandwidth;     /* Bandwidth allocated for isoch / int - us
                                * per 1ms frame (ie between 0 and 900 or 800
@@ -780,7 +780,7 @@ typedef struct pdb_Connection {
 #define PDB_CONNECTION_STATUS_UP   1
 #define PDB_CONNECTION_STATUS_DOWN 2
     u32      status;
-    memory_t ring;       /* status: UP */
+    unsigned long ring;  /* status: UP */
     u32      evtchn;     /* status: UP */
 } pdb_connection_t, *pdb_connection_p;
 
index bcb72c2f3ade06225c9518dda233fa096d660f2c..3ec38d0fda839df21b9bdd8842d2885364234362 100644 (file)
@@ -10,7 +10,7 @@
 #define __XEN_PUBLIC_IO_NETIF_H__
 
 typedef struct netif_tx_request {
-    memory_t addr;   /* Machine address of packet.  */
+    unsigned long addr;   /* Machine address of packet.  */
     u16      csum_blank:1; /* Proto csum field blank?   */
     u16      id:15;  /* Echoed in response message. */
     u16      size;   /* Packet size in bytes.       */
@@ -32,7 +32,7 @@ typedef struct {
 #ifdef CONFIG_XEN_NETDEV_GRANT_TX
     u32      addr;   /*  0: Offset in page of start of received packet  */
 #else
-    memory_t addr;   /* Machine address of packet.              */
+    unsigned long addr; /* Machine address of packet.              */
 #endif
     u16      csum_valid:1; /* Protocol checksum is validated?       */
     u16      id:15;
index 8bee1440d082a9c8ae2fc87964b59db9d176cfc9..b61432c8996be96da381fb08061fe412e2a17390 100644 (file)
@@ -27,8 +27,8 @@ typedef struct physdevop_set_iopl {
 
 typedef struct physdevop_set_iobitmap {
     /* IN */
-    memory_t bitmap;
-    u32      nr_ports;
+    char *bitmap;
+    u32   nr_ports;
 } physdevop_set_iobitmap_t;
 
 typedef struct physdevop_apic {
index 82b5023a31cbe60a8f727fc97b77689ea52e45fe..2434c74a72de4a92c230acbd50adeaf52be0957a 100644 (file)
@@ -171,9 +171,9 @@ struct mmuext_op {
     unsigned int cmd;
     union {
         /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR, REASSIGN_PAGE */
-        memory_t mfn;
+        unsigned long mfn;
         /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
-        memory_t linear_addr;
+        unsigned long linear_addr;
     };
     union {
         /* SET_LDT */
@@ -438,18 +438,18 @@ typedef struct shared_info {
 #define MAX_GUEST_CMDLINE 1024
 typedef struct start_info {
     /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
-    memory_t nr_pages;        /* Total pages allocated to this domain.    */
-    memory_t shared_info;     /* MACHINE address of shared info struct.   */
+    unsigned long nr_pages;   /* Total pages allocated to this domain.    */
+    unsigned long shared_info;/* MACHINE address of shared info struct.   */
     u32      flags;           /* SIF_xxx flags.                           */
     u16      domain_controller_evtchn;
     /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).     */
-    memory_t pt_base;         /* VIRTUAL address of page directory.       */
-    memory_t nr_pt_frames;    /* Number of bootstrap p.t. frames.         */
-    memory_t mfn_list;        /* VIRTUAL address of page-frame list.      */
-    memory_t mod_start;       /* VIRTUAL address of pre-loaded module.    */
-    memory_t mod_len;         /* Size (bytes) of pre-loaded module.       */
+    unsigned long pt_base;    /* VIRTUAL address of page directory.       */
+    unsigned long nr_pt_frames;/* Number of bootstrap p.t. frames.        */
+    unsigned long mfn_list;   /* VIRTUAL address of page-frame list.      */
+    unsigned long mod_start;  /* VIRTUAL address of pre-loaded module.    */
+    unsigned long mod_len;    /* Size (bytes) of pre-loaded module.       */
     s8 cmd_line[MAX_GUEST_CMDLINE];
-    memory_t store_mfn;       /* MACHINE page number of shared page.      */
+    unsigned long store_mfn;  /* MACHINE page number of shared page.      */
     u16      store_evtchn;    /* Event channel for store communication.   */
 } start_info_t;