[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] Fix breakage from upstream and remove duplicate code



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1194473504 25200
# Node ID d0cd18d780749482866ab4b21e3f77b40141230e
# Parent  a1247c2df2b41d7959c1626833c2a149dd705640
[IA64] Fix breakage from upstream and remove duplicate code

- Get rid of PAGE_SIZE usage in arch-ia64.h when building tools.
- Now that more of xen_init_fv is identical to x86 code, share the
  code rather than duplicate it.
- Change a few things that came over from the ia64 tree to use the
  XC_* macros as already done upstream.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 tools/ioemu/hw/xen_machine_fv.c |   28 +++++-----------------------
 xen/include/public/arch-ia64.h  |   22 ++++++++++++++--------
 2 files changed, 19 insertions(+), 31 deletions(-)

diff -r a1247c2df2b4 -r d0cd18d78074 tools/ioemu/hw/xen_machine_fv.c
--- a/tools/ioemu/hw/xen_machine_fv.c   Wed Nov 07 14:48:48 2007 -0700
+++ b/tools/ioemu/hw/xen_machine_fv.c   Wed Nov 07 15:11:44 2007 -0700
@@ -203,6 +203,7 @@ static void xen_init_fv(uint64_t ram_siz
         fprintf(logfile, "qemu_map_cache_init returned: error %d\n", errno);
         exit(-1);
     }
+#endif
 
     xc_get_hvm_param(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
     fprintf(logfile, "shared page at pfn %lx\n", ioreq_pfn);
@@ -222,36 +223,17 @@ static void xen_init_fv(uint64_t ram_siz
         exit(-1);
     }
 
-#elif defined(__ia64__)
-
-    xc_get_hvm_param(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
-    fprintf(logfile, "shared page at pfn %lx\n", ioreq_pfn);
-    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
-                                       PROT_READ|PROT_WRITE, ioreq_pfn);
-    if (shared_page == NULL) {
-        fprintf(logfile, "map shared IO page returned error %d\n", errno);
-        exit(-1);
-    }
-    
-    xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFIOREQ_PFN, &ioreq_pfn);
-    fprintf(logfile, "buffered io page at pfn %lx\n", ioreq_pfn);
-    buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
-                                            PROT_READ|PROT_WRITE, ioreq_pfn);
-    if (buffered_io_page == NULL) {
-        fprintf(logfile, "map buffered IO page returned error %d\n", errno);
-        exit(-1);
-    }
-
+#if defined(__ia64__)
     xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFPIOREQ_PFN, &ioreq_pfn);
     fprintf(logfile, "buffered pio page at pfn %lx\n", ioreq_pfn);
-    buffered_pio_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
+    buffered_pio_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE,
                                             PROT_READ|PROT_WRITE, ioreq_pfn);
     if (buffered_pio_page == NULL) {
         fprintf(logfile, "map buffered PIO page returned error %d\n", errno);
         exit(-1);
     }
 
-    nr_pages = ram_size / PAGE_SIZE;
+    nr_pages = ram_size / XC_PAGE_SIZE;
 
     page_array = (xen_pfn_t *)malloc(nr_pages * sizeof(xen_pfn_t));
     if (page_array == NULL) {
@@ -267,7 +249,7 @@ static void xen_init_fv(uint64_t ram_siz
     if (ram_size > MMIO_START) {       
         for (i = 0 ; i < (MEM_G >> XC_PAGE_SHIFT); i++)
             page_array[(MMIO_START >> XC_PAGE_SHIFT) + i] =
-                (STORE_XC_PAGE_START >> XC_PAGE_SHIFT); 
+                (STORE_PAGE_START >> XC_PAGE_SHIFT); 
     }
 
     phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
diff -r a1247c2df2b4 -r d0cd18d78074 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Wed Nov 07 14:48:48 2007 -0700
+++ b/xen/include/public/arch-ia64.h    Wed Nov 07 15:11:44 2007 -0700
@@ -73,6 +73,12 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 
 typedef unsigned long xen_ulong_t;
 
+#ifdef __XEN_TOOLS__
+#define XEN_PAGE_SIZE XC_PAGE_SIZE
+#else
+#define XEN_PAGE_SIZE PAGE_SIZE
+#endif
+
 #define INVALID_MFN       (~0UL)
 
 #define MEM_G   (1UL << 30)
@@ -93,16 +99,16 @@ typedef unsigned long xen_ulong_t;
 #define LEGACY_IO_SIZE   (64*MEM_M)
 
 #define IO_PAGE_START (LEGACY_IO_START + LEGACY_IO_SIZE)
-#define IO_PAGE_SIZE  PAGE_SIZE
+#define IO_PAGE_SIZE  XEN_PAGE_SIZE
 
 #define STORE_PAGE_START (IO_PAGE_START + IO_PAGE_SIZE)
-#define STORE_PAGE_SIZE  PAGE_SIZE
-
-#define BUFFER_IO_PAGE_START (STORE_PAGE_START+STORE_PAGE_SIZE)
-#define BUFFER_IO_PAGE_SIZE PAGE_SIZE
-
-#define BUFFER_PIO_PAGE_START (BUFFER_IO_PAGE_START+BUFFER_IO_PAGE_SIZE)
-#define BUFFER_PIO_PAGE_SIZE PAGE_SIZE
+#define STORE_PAGE_SIZE  XEN_PAGE_SIZE
+
+#define BUFFER_IO_PAGE_START (STORE_PAGE_START + STORE_PAGE_SIZE)
+#define BUFFER_IO_PAGE_SIZE  XEN_PAGE_SIZE
+
+#define BUFFER_PIO_PAGE_START (BUFFER_IO_PAGE_START + BUFFER_IO_PAGE_SIZE)
+#define BUFFER_PIO_PAGE_SIZE  XEN_PAGE_SIZE
 
 #define IO_SAPIC_START   0xfec00000UL
 #define IO_SAPIC_SIZE    0x100000

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.