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

[Xen-changelog] Allow HYPERVISOR_VIRT_START/END public definitions to be



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 299d6ff8fdb2604dde767af2a2bee985602e9a46
# Parent  b866ed85fad37ebcf198f9ca8aff7dac916d174d
Allow HYPERVISOR_VIRT_START/END public definitions to be
used in assembly files. Check that the public and private
definitions of these constants match up at run time.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r b866ed85fad3 -r 299d6ff8fdb2 xen/arch/x86/boot/x86_32.S
--- a/xen/arch/x86/boot/x86_32.S        Sat Jan  7 17:17:13 2006
+++ b/xen/arch/x86/boot/x86_32.S        Mon Jan  9 10:31:19 2006
@@ -100,7 +100,7 @@
 1:      stosl   /* low mappings cover as much physmem as possible */
         add     $4,%edi
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $__HYPERVISOR_VIRT_START+0xe3,%eax
+        cmp     $HYPERVISOR_VIRT_START+0xe3,%eax
         jne     1b
 #else
         /* Initialize low and high mappings of all memory with 4MB pages */
@@ -113,7 +113,7 @@
         jne     1b
 1:      stosl   /* low mappings cover as much physmem as possible */
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $__HYPERVISOR_VIRT_START+0xe3,%eax
+        cmp     $HYPERVISOR_VIRT_START+0xe3,%eax
         jne     1b
 #endif
         
diff -r b866ed85fad3 -r 299d6ff8fdb2 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Sat Jan  7 17:17:13 2006
+++ b/xen/arch/x86/setup.c      Mon Jan  9 10:31:19 2006
@@ -343,6 +343,12 @@
     BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
     BUG_ON(sizeof(vcpu_info_t) != 64);
 
+    /* __foo are defined in public headers. Check they match internal defs. */
+    BUG_ON(__HYPERVISOR_VIRT_START != HYPERVISOR_VIRT_START);
+#ifdef HYPERVISOR_VIRT_END
+    BUG_ON(__HYPERVISOR_VIRT_END   != HYPERVISOR_VIRT_END);
+#endif
+
     init_frametable();
 
     end_boot_allocator();
diff -r b866ed85fad3 -r 299d6ff8fdb2 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h      Sat Jan  7 17:17:13 2006
+++ b/xen/include/asm-x86/config.h      Mon Jan  9 10:31:19 2006
@@ -248,12 +248,10 @@
 
 #ifdef CONFIG_X86_PAE
 /* Hypervisor owns top 168MB of virtual address space. */
-# define __HYPERVISOR_VIRT_START  0xF5800000
-# define HYPERVISOR_VIRT_START   (0xF5800000UL)
+#define HYPERVISOR_VIRT_START   mk_unsigned_long(0xF5800000)
 #else
 /* Hypervisor owns top 64MB of virtual address space. */
-# define __HYPERVISOR_VIRT_START  0xFC000000
-# define HYPERVISOR_VIRT_START   (0xFC000000UL)
+#define HYPERVISOR_VIRT_START   mk_unsigned_long(0xFC000000)
 #endif
 
 #define L2_PAGETABLE_FIRST_XEN_SLOT \
diff -r b866ed85fad3 -r 299d6ff8fdb2 xen/include/public/arch-x86_32.h
--- a/xen/include/public/arch-x86_32.h  Sat Jan  7 17:17:13 2006
+++ b/xen/include/public/arch-x86_32.h  Mon Jan  9 10:31:19 2006
@@ -49,10 +49,15 @@
  * machine->physical mapping table starts at this address, read-only.
  */
 #ifdef CONFIG_X86_PAE
-# define HYPERVISOR_VIRT_START (0xF5800000UL)
+#define __HYPERVISOR_VIRT_START 0xF5800000
 #else
-# define HYPERVISOR_VIRT_START (0xFC000000UL)
+#define __HYPERVISOR_VIRT_START 0xFC000000
 #endif
+
+#ifndef HYPERVISOR_VIRT_START
+#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
+#endif
+
 #ifndef machine_to_phys_mapping
 #define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
 #endif
@@ -137,7 +142,7 @@
     unsigned long pad[5]; /* sizeof(vcpu_info_t) == 64 */
 } arch_vcpu_info_t;
 
-#endif
+#endif /* !__ASSEMBLY__ */
 
 #endif
 
diff -r b866ed85fad3 -r 299d6ff8fdb2 xen/include/public/arch-x86_64.h
--- a/xen/include/public/arch-x86_64.h  Sat Jan  7 17:17:13 2006
+++ b/xen/include/public/arch-x86_64.h  Mon Jan  9 10:31:19 2006
@@ -59,9 +59,12 @@
 /* And the trap vector is... */
 #define TRAP_INSTR "syscall"
 
+#define __HYPERVISOR_VIRT_START 0xFFFF800000000000
+#define __HYPERVISOR_VIRT_END   0xFFFF880000000000
+
 #ifndef HYPERVISOR_VIRT_START
-#define HYPERVISOR_VIRT_START (0xFFFF800000000000UL)
-#define HYPERVISOR_VIRT_END   (0xFFFF880000000000UL)
+#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
+#define HYPERVISOR_VIRT_END   mk_unsigned_long(__HYPERVISOR_VIRT_END)
 #endif
 
 /* Maximum number of virtual CPUs in multi-processor guests. */
diff -r b866ed85fad3 -r 299d6ff8fdb2 xen/include/public/xen.h
--- a/xen/include/public/xen.h  Sat Jan  7 17:17:13 2006
+++ b/xen/include/public/xen.h  Mon Jan  9 10:31:19 2006
@@ -426,6 +426,15 @@
 
 typedef uint8_t xen_domain_handle_t[16];
 
+/* Turn a plain number into a C unsigned long constant. */
+#define __mk_unsigned_long(x) x ## UL
+#define mk_unsigned_long(x) __mk_unsigned_long(x)
+
+#else /* __ASSEMBLY__ */
+
+/* In assembly code we cannot use C numeric constant suffixes. */
+#define mk_unsigned_long(x) x
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __XEN_PUBLIC_XEN_H__ */
diff -r b866ed85fad3 -r 299d6ff8fdb2 xen/include/xen/config.h
--- a/xen/include/xen/config.h  Sat Jan  7 17:17:13 2006
+++ b/xen/include/xen/config.h  Mon Jan  9 10:31:19 2006
@@ -43,4 +43,13 @@
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
 
+#ifndef __ASSEMBLY__
+/* Turn a plain number into a C unsigned long constant. */
+#define __mk_unsigned_long(x) x ## UL
+#define mk_unsigned_long(x) __mk_unsigned_long(x)
+#else /* __ASSEMBLY__ */
+/* In assembly code we cannot use C numeric constant suffixes. */
+#define mk_unsigned_long(x) x
+#endif /* !__ASSEMBLY__ */
+
 #endif /* __XEN_CONFIG_H__ */

_______________________________________________
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®.