From: Pavel Machek <pavel@ucw.cz>
To: torvalds@transmeta.com, kernel list <linux-kernel@vger.kernel.org>
Subject: suspend-to-ram: clean up according to Andy
Date: Thu, 30 May 2002 00:18:48 +0200 [thread overview]
Message-ID: <20020529221847.GA7741@elf.ucw.cz> (raw)
Hi!
Andy did not quite like the comments, please apply this.
Pavel
--- linux-swsusp.test/arch/i386/kernel/acpi.c Sun May 26 19:31:44 2002
+++ linux-swsusp/arch/i386/kernel/acpi.c Wed May 29 22:22:53 2002
@@ -625,23 +625,15 @@
printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
}
+
+void do_suspend_lowlevel(int resume)
+{
/*
- * (KG): Since we affect stack here, we make this function as flat and easy
- * 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.
+ * FIXME: This function should really be written in assembly. Actually
+ * requirement is that it does not touch stack, because %esp will be
+ * wrong during resume before restore_processor_context(). Check
+ * assembly if you modify this.
*/
-void do_suspend_magic(int resume)
-{
- /* DANGER WILL ROBINSON!
- *
- * If this function is too difficult for gcc to optimize, it will crash and burn!
- * see above.
- *
- * DO NOT TOUCH.
- */
if (!resume) {
save_processor_context();
acpi_save_register_state((unsigned long)&&acpi_sleep_done);
@@ -650,7 +642,6 @@
}
acpi_sleep_done:
restore_processor_context();
- printk("CPU context restored...\n");
}
#endif /*CONFIG_ACPI_SLEEP*/
--- linux-swsusp.test/arch/i386/kernel/acpi_wakeup.S Sun May 26 20:27:44 2002
+++ linux-swsusp/arch/i386/kernel/acpi_wakeup.S Wed May 29 22:31:40 2002
@@ -179,7 +179,7 @@
rep lodsb
movw $0x0e00 + 'O', %ds:(0xb8018)
- movl %cs:saved_magic2, %eax
+ movl %cs:saved_magic, %eax
cmpl $0x12345678, %eax
jne bogus_magic
@@ -243,7 +243,7 @@
movl saved_videomode, %edx
movl %edx, video_mode - wakeup_start (%eax)
movl $0x12345678, real_magic - wakeup_start (%eax)
- movl $0x12345678, saved_magic2
+ movl $0x12345678, saved_magic
# restore the regs we used
popl %edi
@@ -261,7 +261,6 @@
ENTRY(saved_esp) .long 0
ENTRY(saved_magic) .long 0
-ENTRY(saved_magic2) .long 0
ALIGN
# saved registers
--- linux-swsusp.test/drivers/acpi/acpi_system.c Sun May 26 20:27:44 2002
+++ linux-swsusp/drivers/acpi/acpi_system.c Wed May 29 22:20:04 2002
@@ -268,7 +268,7 @@
case ACPI_STATE_S2:
case ACPI_STATE_S3:
- do_suspend_magic(0);
+ do_suspend_lowlevel(0);
break;
}
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
reply other threads:[~2002-05-29 22:19 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=20020529221847.GA7741@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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