From: Len Brown Date: Wed, 23 Mar 2011 06:34:54 +0000 (-0400) Subject: Merge branch 'linus' into release X-Git-Tag: v2.6.39-rc1~90^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02e2407858fd62053bf60349c0e72cd1c7a4a60e;p=profile%2Fivi%2Fkernel-x86-ivi.git Merge branch 'linus' into release Conflicts: arch/x86/kernel/acpi/sleep.c Signed-off-by: Len Brown --- 02e2407858fd62053bf60349c0e72cd1c7a4a60e diff --cc arch/x86/include/asm/acpi.h index ef14da1,448d73a..12e0e7d --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h @@@ -113,10 -114,12 +114,11 @@@ static inline void acpi_disable_pci(voi acpi_noirq_set(); } -/* routines for saving/restoring kernel state */ -extern int acpi_save_state_mem(void); -extern void acpi_restore_state_mem(void); +/* Low-level suspend routine. */ +extern int acpi_suspend_lowlevel(void); - extern unsigned long acpi_wakeup_address; + extern const unsigned char acpi_wakeup_code[]; + #define acpi_wakeup_address (__pa(TRAMPOLINE_SYM(acpi_wakeup_code))) /* early initialization routine */ extern void acpi_reserve_wakeup_memory(void); diff --cc arch/x86/kernel/acpi/sleep.c index 5f1b747,4572c58..ff93bc1 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c @@@ -33,22 -29,17 +29,17 @@@ static char temp_stack[4096] * * Create an identity mapped page table and copy the wakeup routine to * low memory. - * - * Note that this is too late to change acpi_wakeup_address. */ -int acpi_save_state_mem(void) +int acpi_suspend_lowlevel(void) { struct wakeup_header *header; + /* address in low memory of the wakeup routine. */ + char *acpi_realmode; - if (!acpi_realmode) { - printk(KERN_ERR "Could not allocate memory during boot, " - "S3 disabled\n"); - return -ENOMEM; - } - memcpy((void *)acpi_realmode, &wakeup_code_start, WAKEUP_SIZE); + acpi_realmode = TRAMPOLINE_SYM(acpi_wakeup_code); - header = (struct wakeup_header *)(acpi_realmode + HEADER_OFFSET); - if (header->signature != 0x51ee1111) { + header = (struct wakeup_header *)(acpi_realmode + WAKEUP_HEADER_OFFSET); + if (header->signature != WAKEUP_HEADER_SIGNATURE) { printk(KERN_ERR "wakeup header does not match\n"); return -EINVAL; } @@@ -111,45 -99,13 +100,6 @@@ return 0; } - /** - * acpi_reserve_wakeup_memory - do _very_ early ACPI initialisation - * - * We allocate a page from the first 1MB of memory for the wakeup - * routine for when we come back from a sleep state. The - * runtime allocator allows specification of <16MB pages, but not - * <1MB pages. -/* - * acpi_restore_state - undo effects of acpi_save_state_mem -- */ - void __init acpi_reserve_wakeup_memory(void) - { - phys_addr_t mem; - - if ((&wakeup_code_end - &wakeup_code_start) > WAKEUP_SIZE) { - printk(KERN_ERR - "ACPI: Wakeup code way too big, S3 disabled.\n"); - return; - } - - mem = memblock_find_in_range(0, 1<<20, WAKEUP_SIZE, PAGE_SIZE); - - if (mem == MEMBLOCK_ERROR) { - printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n"); - return; - } - acpi_realmode = (unsigned long) phys_to_virt(mem); - acpi_wakeup_address = mem; - memblock_x86_reserve_range(mem, mem + WAKEUP_SIZE, "ACPI WAKEUP"); - } - - int __init acpi_configure_wakeup_memory(void) -void acpi_restore_state_mem(void) --{ - if (acpi_realmode) - set_memory_x(acpi_realmode, WAKEUP_SIZE >> PAGE_SHIFT); - - return 0; --} - arch_initcall(acpi_configure_wakeup_memory); - -- static int __init acpi_sleep_setup(char *str) { while ((str != NULL) && (*str != '\0')) {