From 801e4062fda6496fe9bee3e6915a2aa108f974e5 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 8 Dec 2007 02:12:39 +0100 Subject: Hibernation: Clean up Kconfig (V2) This cleans up the hibernation Kconfig and removes the need to declare centrally which architectures support hibernation. All architectures that currently support hibernation are modified accordingly. Signed-off-by: Johannes Berg Acked-by: Paul Mackerras Cc: Pavel Machek Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- arch/x86/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/x86') diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 93e66678e15..120070cbedd 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -112,6 +112,10 @@ config ARCH_SUPPORTS_OPROFILE select HAVE_KVM +config ARCH_HIBERNATION_POSSIBLE + def_bool y + depends on !SMP || !X86_VOYAGER + config ZONE_DMA32 bool default X86_64 -- cgit v1.2.3 From f4cb57007662a4ec3c2de3c027900223e0299bdd Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 8 Dec 2007 02:14:00 +0100 Subject: Suspend: Clean up Kconfig (V2) This cleans up the suspend Kconfig and removes the need to declare centrally which architectures support suspend. All architectures that currently support suspend are modified accordingly. Signed-off-by: Johannes Berg Acked-by: Russell King Acked-by: Paul Mackerras Acked-by: Ralf Baechle Acked-by: Paul Mundt Cc: Pavel Machek Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- arch/x86/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/x86') diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 120070cbedd..34401f45ade 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -116,6 +116,10 @@ config ARCH_HIBERNATION_POSSIBLE def_bool y depends on !SMP || !X86_VOYAGER +config ARCH_SUSPEND_POSSIBLE + def_bool y + depends on !X86_VOYAGER + config ZONE_DMA32 bool default X86_64 -- cgit v1.2.3 From 17b7a89cfb6ea2ff103785f9b2580e5138b6cfd1 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Mon, 17 Dec 2007 00:30:22 +0100 Subject: Suspend: Clean up suspend_64.c There's a freakishly long comment in suspend_64.c, shorten it. Signed-off-by: Borislav Petkov Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- arch/x86/kernel/suspend_64.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/x86') diff --git a/arch/x86/kernel/suspend_64.c b/arch/x86/kernel/suspend_64.c index 09199511c25..7ac7130022f 100644 --- a/arch/x86/kernel/suspend_64.c +++ b/arch/x86/kernel/suspend_64.c @@ -140,7 +140,12 @@ static void fix_processor_context(void) int cpu = smp_processor_id(); struct tss_struct *t = &per_cpu(init_tss, cpu); - set_tss_desc(cpu,t); /* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */ + /* + * This just modifies memory; should not be necessary. But... This + * is necessary, because 386 hardware has concept of busy TSS or some + * similar stupidity. + */ + set_tss_desc(cpu, t); get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9; @@ -160,7 +165,6 @@ static void fix_processor_context(void) loaddebug(¤t->thread, 6); loaddebug(¤t->thread, 7); } - } #ifdef CONFIG_HIBERNATION -- cgit v1.2.3 From a6eb84bc1e069e1d285167e09035ed6c27978feb Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 1 Feb 2008 15:28:16 +0100 Subject: suspend: cleanup reference to swsusp_pg_dir[] swsusp_pg_dir[] is used for suspend, but not for hibernation. clean-up the ifdefs which worked by accident, while implying the opposite. Delete the __nosavedata, which also implied the opposite. Some day we may optimize CONFIG_ACPI_SLEEP to build minimal kernels for just hibernate or just suspend but not both, but today isn't that day. Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- arch/x86/mm/init_32.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'arch/x86') diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index da524fb2242..f2f36f8dae5 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -423,23 +423,23 @@ static void __init pagetable_init(void) paravirt_pagetable_setup_done(pgd_base); } -#if defined(CONFIG_HIBERNATION) || defined(CONFIG_ACPI) +#ifdef CONFIG_ACPI_SLEEP /* - * Swap suspend & friends need this for resume because things like the intel-agp + * ACPI suspend needs this for resume, because things like the intel-agp * driver might have split up a kernel 4MB mapping. */ -char __nosavedata swsusp_pg_dir[PAGE_SIZE] +char swsusp_pg_dir[PAGE_SIZE] __attribute__ ((aligned(PAGE_SIZE))); static inline void save_pg_dir(void) { memcpy(swsusp_pg_dir, swapper_pg_dir, PAGE_SIZE); } -#else +#else /* !CONFIG_ACPI_SLEEP */ static inline void save_pg_dir(void) { } -#endif +#endif /* !CONFIG_ACPI_SLEEP */ void zap_low_mappings(void) { -- cgit v1.2.3