aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-01-17 21:52:52 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-01-17 21:52:52 -0500
commitb24c574496eecaa7a8be91ec3653f0bc8c3b8f88 (patch)
tree64130cb6dbc53f46fe4539bbf56fd8e9a0416444 /src
parent0b6f2eba0da352db6c365145271966c39217988b (diff)
downloadseabios-hppa-b24c574496eecaa7a8be91ec3653f0bc8c3b8f88.zip
seabios-hppa-b24c574496eecaa7a8be91ec3653f0bc8c3b8f88.tar.gz
seabios-hppa-b24c574496eecaa7a8be91ec3653f0bc8c3b8f88.tar.bz2
Add CONFIG_S3_RESUME to control support for S3 resume.
Diffstat (limited to 'src')
-rw-r--r--src/config.h9
-rw-r--r--src/resume.c25
2 files changed, 20 insertions, 14 deletions
diff --git a/src/config.h b/src/config.h
index 044e110..50dbd58 100644
--- a/src/config.h
+++ b/src/config.h
@@ -74,14 +74,15 @@
#define CONFIG_ACPI 1
// Support bios callbacks specific to via vgabios.
#define CONFIG_VGAHOOKS 0
+// Support S3 resume handler.
+#define CONFIG_S3_RESUME 1
+// define it if the (emulated) hardware supports SMM mode
+#define CONFIG_USE_SMM 1
// Maximum number of map entries in the e820 map
#define CONFIG_MAX_E820 32
// Space to reserve in f-segment for run-time built bios tables.
#define CONFIG_MAX_BIOSTABLE 512
-/* define it if the (emulated) hardware supports SMM mode */
-#define CONFIG_USE_SMM 1
-
#define CONFIG_MAX_ATA_INTERFACES 4
#define CONFIG_MAX_ATA_DEVICES (CONFIG_MAX_ATA_INTERFACES*2)
@@ -112,7 +113,7 @@
#define SEG_BDA 0x0040
#define SEG_BIOS 0xf000
-// Segment definitions in protected mode (see rombios32_gdt in romlayout.S)
+// Segment definitions in protected mode (see rombios32_gdt in misc.c)
#define SEG32_MODE32_CS (1 << 3)
#define SEG32_MODE32_DS (2 << 3)
#define SEG32_MODE16_CS (3 << 3)
diff --git a/src/resume.c b/src/resume.c
index 1bffd49..86c0555 100644
--- a/src/resume.c
+++ b/src/resume.c
@@ -36,16 +36,18 @@ handle_resume(u8 status)
struct bios_data_area_s *bda = MAKE_FARPTR(SEG_BDA, 0);
switch (status) {
case 0xfe:
- // S3 resume request. Jump to 32bit mode to handle the resume.
- asm volatile(
- "movw %%ax, %%ss\n"
- "movl %0, %%esp\n"
- "pushl $_code32_s3_resume\n"
- "jmp transition32\n"
- : : "i"(BUILD_S3RESUME_STACK_ADDR), "a"(0)
- );
- break;
-
+ if (CONFIG_S3_RESUME) {
+ // S3 resume request. Jump to 32bit mode to handle the resume.
+ asm volatile(
+ "movw %%ax, %%ss\n"
+ "movl %0, %%esp\n"
+ "pushl $_code32_s3_resume\n"
+ "jmp transition32\n"
+ : : "i"(BUILD_S3RESUME_STACK_ADDR), "a"(0)
+ );
+ break;
+ }
+ // NO BREAK
case 0x00:
case 0x09:
case 0x0d ... 0xfd:
@@ -97,6 +99,9 @@ handle_resume(u8 status)
void VISIBLE32
s3_resume()
{
+ if (!CONFIG_S3_RESUME)
+ BX_PANIC("S3 resume support not compiled in.\n");
+
dprintf(1, "In 32bit resume\n");
smm_init();