]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
linux/x86: don't build cstate.o and wakeup.o
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 22 Nov 2007 14:28:31 +0000 (14:28 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 22 Nov 2007 14:28:31 +0000 (14:28 +0000)
The code in arch/i386/kernel/acpi/cstate.c is (at best) irrelevant for
VMs. The code in arch/{i386,x86_64}/kernel/acpi/wakeup.S is even
dangerous; while not being actively used, its inadvertant use would go
unnoticed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/i386/kernel/acpi/Makefile
arch/i386/kernel/acpi/sleep-xen.c
arch/x86_64/kernel/acpi/Makefile
arch/x86_64/kernel/acpi/sleep-xen.c
include/asm-i386/acpi.h
include/asm-x86_64/acpi.h
kernel/sysctl.c

index 7e9ac99354f43212bbbb6aa959642b0ec7dce91c..c48bcdcb591a004feec5aa08520310fb265d3ba3 100644 (file)
@@ -6,3 +6,4 @@ ifneq ($(CONFIG_ACPI_PROCESSOR),)
 obj-y                          += cstate.o processor.o
 endif
 
+disabled-obj-$(CONFIG_XEN)     := cstate.o wakeup.o
index 488bfaf10dd31894056180d897651696be1c6af4..e1dec9956c67cdc0ac35b67b557c6b30b9080287 100644 (file)
 
 #include <asm/smp.h>
 
+#ifndef CONFIG_ACPI_PV_SLEEP
 /* address in low memory of the wakeup routine. */
 unsigned long acpi_wakeup_address = 0;
 unsigned long acpi_video_flags;
 extern char wakeup_start, wakeup_end;
 
 extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
+#endif
 
 /**
  * acpi_save_state_mem - save kernel state
@@ -54,6 +56,7 @@ void acpi_restore_state_mem(void)
  */
 void __init acpi_reserve_bootmem(void)
 {
+#ifndef CONFIG_ACPI_PV_SLEEP
        if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) {
                printk(KERN_ERR
                       "ACPI: Wakeup code way too big, S3 disabled.\n");
@@ -63,8 +66,10 @@ void __init acpi_reserve_bootmem(void)
        acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
        if (!acpi_wakeup_address)
                printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n");
+#endif
 }
 
+#ifndef CONFIG_ACPI_PV_SLEEP
 static int __init acpi_sleep_setup(char *str)
 {
        while ((str != NULL) && (*str != '\0')) {
@@ -106,7 +111,7 @@ static int __init acpisleep_dmi_init(void)
 
 core_initcall(acpisleep_dmi_init);
 
-#ifdef CONFIG_ACPI_PV_SLEEP
+#else /* CONFIG_ACPI_PV_SLEEP */
 #include <asm/hypervisor.h>
 #include <xen/interface/platform.h>
 int acpi_notify_hypervisor_state(u8 sleep_state,
index 604e62bfc105a31a126267d038acf83a679d4911..6ecd9d2bac8d1f7154480a0a787d38d342742b3f 100644 (file)
@@ -5,4 +5,7 @@ obj-$(CONFIG_ACPI_SLEEP)        += sleep.o wakeup.o
 ifneq ($(CONFIG_ACPI_PROCESSOR),)
 obj-y                  += processor.o
 processor-y            := ../../../i386/kernel/acpi/processor.o ../../../i386/kernel/acpi/cstate.o
+processor-$(CONFIG_XEN)        := ../../../i386/kernel/acpi/processor.o
 endif
+
+disabled-obj-$(CONFIG_XEN) := wakeup.o
index b073793f4b35fd807e986935cbf0c768bc9d3dc3..c40baa4afab8fba8f944fbd943a5d02b2c136661 100644 (file)
@@ -53,6 +53,7 @@
 
 #ifdef CONFIG_ACPI_SLEEP
 
+#ifndef CONFIG_ACPI_PV_SLEEP
 /* address in low memory of the wakeup routine. */
 unsigned long acpi_wakeup_address = 0;
 unsigned long acpi_video_flags;
@@ -70,6 +71,7 @@ static void init_low_mapping(void)
        WARN_ON(num_online_cpus() != 1);
        local_flush_tlb();
 }
+#endif
 
 /**
  * acpi_save_state_mem - save kernel state
@@ -110,12 +112,15 @@ void acpi_restore_state_mem(void)
  */
 void __init acpi_reserve_bootmem(void)
 {
+#ifndef CONFIG_ACPI_PV_SLEEP
        acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
        if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
                printk(KERN_CRIT
                       "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
+#endif
 }
 
+#ifndef CONFIG_ACPI_PV_SLEEP
 static int __init acpi_sleep_setup(char *str)
 {
        while ((str != NULL) && (*str != '\0')) {
@@ -133,7 +138,7 @@ static int __init acpi_sleep_setup(char *str)
 
 __setup("acpi_sleep=", acpi_sleep_setup);
 
-#ifdef CONFIG_ACPI_PV_SLEEP
+#else /* CONFIG_ACPI_PV_SLEEP */
 #include <asm/hypervisor.h>
 #include <xen/interface/platform.h>
 int acpi_notify_hypervisor_state(u8 sleep_state,
index 8c855284c0f4b204c7e1f9415d2d1b43bfc93989..f2f10cc3356c4ca7320dbb8a91604815b8db2e0b 100644 (file)
@@ -185,7 +185,9 @@ extern int acpi_notify_hypervisor_state(u8 sleep_state,
 
 extern u8 x86_acpiid_to_apicid[];
 
+#ifndef CONFIG_XEN
 #define ARCH_HAS_POWER_INIT    1
+#endif
 
 #endif /*__KERNEL__*/
 
index d1a1faf5fb5cdf20ec39d7aa4ce462c41fedca39..690997819d2808ad4f35f6400ac679f5cf0b9f51 100644 (file)
@@ -166,7 +166,9 @@ extern int acpi_pci_disabled;
 
 extern u8 x86_acpiid_to_apicid[];
 
+#ifndef CONFIG_XEN
 #define ARCH_HAS_POWER_INIT 1
+#endif
 
 extern int acpi_skip_timer_override;
 
index fd43c3e6786b5b19c8ff173b45638c56392c7d86..27dc4b1c53cbb82104186603ded3d502394083e8 100644 (file)
@@ -661,7 +661,7 @@ static ctl_table kern_table[] = {
                .proc_handler   = &proc_dointvec,
        },
 #endif
-#ifdef CONFIG_ACPI_SLEEP
+#if defined(CONFIG_ACPI_SLEEP) && !defined(CONFIG_ACPI_PV_SLEEP)
        {
                .ctl_name       = KERN_ACPI_VIDEO_FLAGS,
                .procname       = "acpi_video_flags",