Commit 7e13b754 authored by Andy Grover's avatar Andy Grover

ACPI: This makes it possible to select method of bios restoring after S3

resume. [=> no more ugly ifdefs] (Pavel Machek)
parent 1539af85
......@@ -453,6 +453,7 @@ acpi_boot_init (void)
/* 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));
......@@ -519,4 +520,20 @@ void __init acpi_reserve_bootmem(void)
printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
}
static int __init acpi_sleep_setup(char *str)
{
while ((str != NULL) && (*str != '\0')) {
if (strncmp(str, "s3_bios", 7) == 0)
acpi_video_flags = 1;
if (strncmp(str, "s3_mode", 7) == 0)
acpi_video_flags |= 2;
str = strchr(str, ',');
if (str != NULL)
str += strspn(str, ", \t");
}
return 1;
}
__setup("acpi_sleep=", acpi_sleep_setup);
#endif /*CONFIG_ACPI_SLEEP*/
......@@ -41,20 +41,19 @@ wakeup_code:
cmpl $0x12345678, %eax
jne bogus_real_magic
#if 1
testl $1, video_flags - wakeup_code
jz 1f
lcall $0xc000,$3
#endif
#if 0
1:
testl $2, video_flags - wakeup_code
jz 1f
mov video_mode - wakeup_code, %ax
call mode_set
#endif
1:
# set up page table
#if 1
movl $swapper_pg_dir-__PAGE_OFFSET, %eax
#else
movl (real_save_cr3 - wakeup_data), %eax
#endif
movl %eax, %cr3
# make sure %cr4 is set correctly (features, etc)
......@@ -86,6 +85,7 @@ real_save_cr3: .long 0
real_save_cr4: .long 0
real_magic: .long 0
video_mode: .long 0
video_flags: .long 0
bogus_real_magic:
movw $0x0e00 + 'B', %fs:(0x12)
......@@ -254,6 +254,8 @@ ENTRY(acpi_copy_wakeup_routine)
movl saved_videomode, %edx
movl %edx, video_mode - wakeup_start (%eax)
movl acpi_video_flags, %edx
movl %edx, video_flags - wakeup_start (%eax)
movl $0x12345678, real_magic - wakeup_start (%eax)
movl $0x12345678, saved_magic
ret
......
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