From: Kevin O'Connor Date: Sun, 18 Jan 2009 02:52:52 +0000 (-0500) Subject: Add CONFIG_S3_RESUME to control support for S3 resume. X-Git-Tag: rel-0.4.0~20 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b24c574496eecaa7a8be91ec3653f0bc8c3b8f88;p=seabios.git Add CONFIG_S3_RESUME to control support for S3 resume. --- 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();