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-devel

[Xen-devel] [PATCH 1/2] x86: get the offset at compile time instead of r

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/2] x86: get the offset at compile time instead of raw value
From: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>
Date: Fri, 07 May 2010 16:51:26 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 07 May 2010 01:55:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)
Get the offset form the struct instead of raw value

Signed-off-by: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>

diff -r 632487ba7f63 -r 5ca49b1a6077 xen/arch/x86/boot/cmdline.S
--- a/xen/arch/x86/boot/cmdline.S       Fri May 07 22:48:33 2010 +0800
+++ b/xen/arch/x86/boot/cmdline.S       Fri May 07 23:56:27 2010 +0800
@@ -147,10 +147,6 @@
 3:      pop     %ebx
         ret
 
-/* multiboot_info structure offsets. */
-#define MB_flags   0
-#define MB_cmdline 16
-
 cmdline_parse_early:
         pusha
 
diff -r 632487ba7f63 -r 5ca49b1a6077 xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c Fri May 07 22:48:33 2010 +0800
+++ b/xen/arch/x86/x86_32/asm-offsets.c Fri May 07 23:56:27 2010 +0800
@@ -9,6 +9,7 @@
 #include <xen/sched.h>
 #include <asm/fixmap.h>
 #include <asm/hardirq.h>
+#include <xen/multiboot.h>
 
 #define DEFINE(_sym, _val) \
     __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
@@ -127,4 +128,8 @@
     BLANK();
 
     OFFSET(CPUINFO_ext_features, struct cpuinfo_x86, x86_capability[1]);
+    BLANK();
+
+    OFFSET(MB_flags, multiboot_info_t, flags);
+    OFFSET(MB_cmdline, multiboot_info_t, cmdline);
 }
diff -r 632487ba7f63 -r 5ca49b1a6077 xen/arch/x86/x86_64/asm-offsets.c
--- a/xen/arch/x86/x86_64/asm-offsets.c Fri May 07 22:48:33 2010 +0800
+++ b/xen/arch/x86/x86_64/asm-offsets.c Fri May 07 23:56:27 2010 +0800
@@ -10,6 +10,7 @@
 #include <compat/xen.h>
 #include <asm/fixmap.h>
 #include <asm/hardirq.h>
+#include <xen/multiboot.h>
 
 #define DEFINE(_sym, _val) \
     __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
@@ -151,4 +152,8 @@
     BLANK();
 
     OFFSET(CPUINFO_ext_features, struct cpuinfo_x86, x86_capability[1]);
+    BLANK();
+
+    OFFSET(MB_flags, multiboot_info_t, flags);
+    OFFSET(MB_cmdline, multiboot_info_t, cmdline);
 }

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

<Prev in Thread] Current Thread [Next in Thread>