diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-10-30 14:09:13 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-10-30 14:09:13 +0000 |
commit | fa088340b451b18f3a6023f986b09ed37800a652 (patch) | |
tree | fbe08fc25e2469fb4eb8f37bc8603419c8c9a9a9 /linux-2.6-xen-sparse | |
parent | 8ba0049cfc98d398386d8ff09fbfb967d792376e (diff) | |
download | xen-fa088340b451b18f3a6023f986b09ed37800a652.tar.gz xen-fa088340b451b18f3a6023f986b09ed37800a652.tar.bz2 xen-fa088340b451b18f3a6023f986b09ed37800a652.zip |
[LINUX] Declare structs as 'static __initdata' where possible.
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@novell.com>
Diffstat (limited to 'linux-2.6-xen-sparse')
3 files changed, 14 insertions, 12 deletions
diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c b/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c index 844c87e78c..f300bd159e 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c @@ -60,7 +60,7 @@ int __init sysenter_setup(void) #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 }, }; diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h index 0f1caa0604..b4507b120e 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h @@ -56,15 +56,15 @@ static void __init machine_specific_arch_setup(void) 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 @@ static void __init machine_specific_arch_setup(void) 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); } diff --git a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h index e21d4ee6f2..0a70d239c2 100644 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h @@ -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_setup(void) #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 |