From: Pavel Machek <pavel@ucw.cz>
To: Andrew Grover <andrew.grover@intel.com>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Make restoring of graphics state on S3 resume run-time settable
Date: Sun, 19 Jan 2003 22:40:48 +0100 [thread overview]
Message-ID: <20030119214047.GA27865@elf.ucw.cz> (raw)
Hi!
This makes it possible to select method of bios restoring after S3
resume. [=> no more ugly ifdefs]. Please apply,
Pavel
--- clean/arch/i386/kernel/acpi.c 2003-01-17 23:13:33.000000000 +0100
+++ linux-swsusp/arch/i386/kernel/acpi.c 2003-01-19 19:10:48.000000000 +0100
@@ -454,6 +454,7 @@
/* 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));
@@ -520,4 +547,20 @@
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*/
--- clean/arch/i386/kernel/acpi_wakeup.S 2002-12-18 22:20:47.000000000 +0100
+++ linux-swsusp/arch/i386/kernel/acpi_wakeup.S 2003-01-19 17:39:21.000000000 +0100
@@ -41,20 +41,19 @@
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_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 @@
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
--
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
reply other threads:[~2003-01-20 19:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030119214047.GA27865@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=andrew.grover@intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox