Add option for running vga rom during s3 resume.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 4 Jul 2009 08:10:32 +0000 (04:10 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 4 Jul 2009 08:10:32 +0000 (04:10 -0400)
Add support for running the vga rom when the option
    CONFIG_S3_RESUME_VGA_INIT is set (default is off).

src/config.h
src/optionroms.c
src/resume.c
src/util.h

index 5ed61ae1153f36dc72ad914b8ab353597863ccf4..a77fe0c10f2baf7ec8cebb11c196fe09b8979ede 100644 (file)
@@ -90,6 +90,8 @@
 #define CONFIG_VGAHOOKS 0
 // Support S3 resume handler.
 #define CONFIG_S3_RESUME 1
+// Run the vga rom during S3 resume.
+#define CONFIG_S3_RESUME_VGA_INIT 0
 // define it if the (emulated) hardware supports SMM mode
 #define CONFIG_USE_SMM 1
 // Maximum number of map entries in the e820 map
index 9769bc28e45510af1ffd2fa8be8da6a4b19ab054..24fc4c3c248b69c85cecd75646445160fb6af12b 100644 (file)
@@ -438,3 +438,14 @@ vga_setup()
     // Write to screen.
     printf("Starting SeaBIOS\n\n");
 }
+
+void
+s3_resume_vga_init()
+{
+    if (!CONFIG_S3_RESUME_VGA_INIT)
+        return;
+    struct rom_header *rom = (void*)OPTION_ROM_START;
+    if (! is_valid_rom(rom))
+        return;
+    callrom(rom, 0);
+}
index 76a8c50d6a679d98077a56f2678dc37673ab0efa..cfe26cda7c90f77b195a57213a816816ef101624 100644 (file)
@@ -104,6 +104,8 @@ s3_resume()
 
     smm_init();
 
+    s3_resume_vga_init();
+
     make_bios_readonly();
 
     u32 s3_resume_vector = find_resume_vector();
index 654cf31337e97dfef95cc69c289177b39a086f44..b32a517463c33e5b3b50e106ed266354072c7dab 100644 (file)
@@ -217,6 +217,7 @@ void handle_155f();
 void call_bcv(u16 seg, u16 ip);
 void optionrom_setup();
 void vga_setup();
+void s3_resume_vga_init();
 
 // resume.c
 void init_dma();