WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [IA64] Fix breakage from upstream and rem

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Fix breakage from upstream and remove duplicate code
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Nov 2007 04:21:22 -0800
Delivery-date: Fri, 09 Nov 2007 05:30:16 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] Fix breakage from upstream and remove duplicate code, Xen patchbot-unstable <=