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

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH] linux: use __initdata where possible

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: use __initdata where possible
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: 2006年10月30日 14:23:04 +0100
Delivery-date: 2006年10月30日 05:21:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Probably still not catching all possible cases, but using static (where not
already the case) makes the code size smaller, and using __initdata has
the usual advantages.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Index: head-2006年10月16日/arch/i386/kernel/sysenter.c
===================================================================
--- head-2006年10月16日.orig/arch/i386/kernel/sysenter.c 2006年10月26日 
10:29:04.000000000 +0200
+++ head-2006年10月16日/arch/i386/kernel/sysenter.c 2006年10月23日 15:35:17.000000000 
+0200
@@ -60,7 +60,7 @@ extern asmlinkage void sysenter_entry(vo
 
 #ifdef CONFIG_XEN
 if (boot_cpu_has(X86_FEATURE_SEP)) {
- struct callback_register sysenter = {
+ static struct callback_register __initdata sysenter = {
 .type = CALLBACKTYPE_sysenter,
 .address = { __KERNEL_CS, (unsigned long)sysenter_entry 
},
 };
Index: head-2006年10月16日/include/asm-i386/mach-xen/setup_arch_post.h
===================================================================
--- head-2006年10月16日.orig/include/asm-i386/mach-xen/setup_arch_post.h 
2006年10月16日 10:36:03.000000000 +0200
+++ head-2006年10月16日/include/asm-i386/mach-xen/setup_arch_post.h 2006年10月26日 
11:37:26.000000000 +0200
@@ -56,15 +56,15 @@ void __init machine_specific_arch_setup(
 struct xen_machphys_mapping mapping;
 unsigned long machine_to_phys_nr_ents;
 struct xen_platform_parameters pp;
- struct callback_register event = {
+ static struct callback_register __initdata event = {
 .type = CALLBACKTYPE_event,
 .address = { __KERNEL_CS, (unsigned long)hypervisor_callback },
 };
- struct callback_register failsafe = {
+ static struct callback_register __initdata failsafe = {
 .type = CALLBACKTYPE_failsafe,
 .address = { __KERNEL_CS, (unsigned long)failsafe_callback },
 };
- struct callback_register nmi_cb = {
+ static struct callback_register __initdata nmi_cb = {
 .type = CALLBACKTYPE_nmi,
 .address = { __KERNEL_CS, (unsigned long)nmi },
 };
@@ -80,9 +80,10 @@ void __init machine_specific_arch_setup(
 
 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb);
 if (ret == -ENOSYS) {
- struct xennmi_callback cb;
+ static struct xennmi_callback __initdata cb = {
+ .handler_address = (unsigned long)nmi;
+ };
 
- cb.handler_address = nmi_cb.address.eip;
 HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
 }
 
Index: head-2006年10月16日/include/asm-x86_64/mach-xen/setup_arch_post.h
===================================================================
--- head-2006年10月16日.orig/include/asm-x86_64/mach-xen/setup_arch_post.h 
2006年10月26日 10:30:56.000000000 +0200
+++ head-2006年10月16日/include/asm-x86_64/mach-xen/setup_arch_post.h 
2006年10月26日 11:37:26.000000000 +0200
@@ -15,20 +15,20 @@ extern void nmi(void);
 static void __init machine_specific_arch_setup(void)
 {
 int ret;
- struct callback_register event = {
+ static struct callback_register __initdata event = {
 .type = CALLBACKTYPE_event,
 .address = (unsigned long) hypervisor_callback,
 };
- struct callback_register failsafe = {
+ static struct callback_register __initdata failsafe = {
 .type = CALLBACKTYPE_failsafe,
 .address = (unsigned long)failsafe_callback,
 };
- struct callback_register syscall = {
+ static struct callback_register __initdata syscall = {
 .type = CALLBACKTYPE_syscall,
 .address = (unsigned long)system_call,
 };
 #ifdef CONFIG_X86_LOCAL_APIC
- struct callback_register nmi_cb = {
+ static struct callback_register __initdata nmi_cb = {
 .type = CALLBACKTYPE_nmi,
 .address = (unsigned long)nmi,
 };
@@ -49,9 +49,10 @@ static void __init machine_specific_arch
 #ifdef CONFIG_X86_LOCAL_APIC
 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb);
 if (ret == -ENOSYS) {
- struct xennmi_callback cb;
+ static struct xennmi_callback __initdata cb = {
+ .handler_address = (unsigned long)nmi;
+ };
 
- cb.handler_address = nmi_cb.address;
 HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
 }
 #endif
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: use __initdata where possible, Jan Beulich <=
Previous by Date: [Xen-devel] [PATCH] linux: range-check hypercall index in privcmd , Jan Beulich
Next by Date: [Xen-devel] [PATCH] linux: use CONFIG_XEN_COMPAT_030002 where possible , Jan Beulich
Previous by Thread: [Xen-devel] [PATCH] linux: range-check hypercall index in privcmd , Jan Beulich
Next by Thread: [Xen-devel] [PATCH] linux: use CONFIG_XEN_COMPAT_030002 where possible , Jan Beulich
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /