Commit 267b59f5 authored by Pavel Machek's avatar Pavel Machek Committed by Linus Torvalds

[PATCH] suspend-to-ram: clean up according to Andy

Andy did not quite like the comments, please apply this.
parent 8085cd28
...@@ -625,22 +625,14 @@ void __init acpi_reserve_bootmem(void) ...@@ -625,22 +625,14 @@ void __init acpi_reserve_bootmem(void)
printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address); printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
} }
/*
* (KG): Since we affect stack here, we make this function as flat and easy void do_suspend_lowlevel(int resume)
* as possible in order to not provoke gcc to use local variables on the stack.
* Note that on resume, all (expect nosave) variables will have the state from
* the time of writing (suspend_save_image) and the registers (including the
* stack pointer, but excluding the instruction pointer) will be loaded with
* the values saved at save_processor_context() time.
*/
void do_suspend_magic(int resume)
{ {
/* DANGER WILL ROBINSON! /*
* * FIXME: This function should really be written in assembly. Actually
* If this function is too difficult for gcc to optimize, it will crash and burn! * requirement is that it does not touch stack, because %esp will be
* see above. * wrong during resume before restore_processor_context(). Check
* * assembly if you modify this.
* DO NOT TOUCH.
*/ */
if (!resume) { if (!resume) {
save_processor_context(); save_processor_context();
...@@ -650,7 +642,6 @@ void do_suspend_magic(int resume) ...@@ -650,7 +642,6 @@ void do_suspend_magic(int resume)
} }
acpi_sleep_done: acpi_sleep_done:
restore_processor_context(); restore_processor_context();
printk("CPU context restored...\n");
} }
#endif /*CONFIG_ACPI_SLEEP*/ #endif /*CONFIG_ACPI_SLEEP*/
......
...@@ -179,7 +179,7 @@ wakeup_pmode_return: ...@@ -179,7 +179,7 @@ wakeup_pmode_return:
rep lodsb rep lodsb
movw $0x0e00 + 'O', %ds:(0xb8018) movw $0x0e00 + 'O', %ds:(0xb8018)
movl %cs:saved_magic2, %eax movl %cs:saved_magic, %eax
cmpl $0x12345678, %eax cmpl $0x12345678, %eax
jne bogus_magic jne bogus_magic
...@@ -243,7 +243,7 @@ ENTRY(acpi_copy_wakeup_routine) ...@@ -243,7 +243,7 @@ ENTRY(acpi_copy_wakeup_routine)
movl saved_videomode, %edx movl saved_videomode, %edx
movl %edx, video_mode - wakeup_start (%eax) movl %edx, video_mode - wakeup_start (%eax)
movl $0x12345678, real_magic - wakeup_start (%eax) movl $0x12345678, real_magic - wakeup_start (%eax)
movl $0x12345678, saved_magic2 movl $0x12345678, saved_magic
# restore the regs we used # restore the regs we used
popl %edi popl %edi
...@@ -261,7 +261,6 @@ ENTRY(saved_eip) .long 0 ...@@ -261,7 +261,6 @@ ENTRY(saved_eip) .long 0
ENTRY(saved_esp) .long 0 ENTRY(saved_esp) .long 0
ENTRY(saved_magic) .long 0 ENTRY(saved_magic) .long 0
ENTRY(saved_magic2) .long 0
ALIGN ALIGN
# saved registers # saved registers
......
...@@ -268,7 +268,7 @@ acpi_system_suspend( ...@@ -268,7 +268,7 @@ acpi_system_suspend(
case ACPI_STATE_S2: case ACPI_STATE_S2:
case ACPI_STATE_S3: case ACPI_STATE_S3:
do_suspend_magic(0); do_suspend_lowlevel(0);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment