aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/video-vga.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@suse.cz>2008-04-10 17:28:10 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:37 -0400
commite44b7b7525ad9d43163ab5e60c784325419e0ea6 (patch)
treee2918917a97b4c9de4367e8778ed78afc762b9f8 /arch/x86/boot/video-vga.c
parentf49688d459c5eaa62db3597cbfd3cb13e361d415 (diff)
x86: move suspend wakeup code to C
Move wakeup code to .c, so that video mode setting code can be shared between boot and wakeup. Remove nasty assembly code in 64-bit case by re-using trampoline code. Stack setup was fixed to clear high 16bits of %esp, maybe that fixes some machines. .c code sharing and morse code was done H. Peter Anvin, Sam Ravnborg reviewed kbuild related stuff, and it seems okay to him. Rafael did some cleanups. [rjw: * Made the patch stop breaking compilation on x86-32 * Added arch/x86/kernel/acpi/sleep.h * Got rid of compiler warnings in arch/x86/kernel/acpi/sleep.c * Fixed 32-bit compilation on x86-64 systems * Added include/asm-x86/trampoline.h and fixed the non-SMP compilation on 64-bit x86 * Removed arch/x86/kernel/acpi/sleep_32.c which was not used * Fixed some breakage caused by the integration of smpboot.c done under us in the meantime] Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/boot/video-vga.c')
-rw-r--r--arch/x86/boot/video-vga.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/boot/video-vga.c b/arch/x86/boot/video-vga.c
index 7259387b7d19..330d6589a2ad 100644
--- a/arch/x86/boot/video-vga.c
+++ b/arch/x86/boot/video-vga.c
@@ -210,6 +210,8 @@ static int vga_set_mode(struct mode_info *mode)
210 */ 210 */
211static int vga_probe(void) 211static int vga_probe(void)
212{ 212{
213 u16 ega_bx;
214
213 static const char *card_name[] = { 215 static const char *card_name[] = {
214 "CGA/MDA/HGC", "EGA", "VGA" 216 "CGA/MDA/HGC", "EGA", "VGA"
215 }; 217 };
@@ -226,12 +228,16 @@ static int vga_probe(void)
226 u8 vga_flag; 228 u8 vga_flag;
227 229
228 asm(INT10 230 asm(INT10
229 : "=b" (boot_params.screen_info.orig_video_ega_bx) 231 : "=b" (ega_bx)
230 : "a" (0x1200), "b" (0x10) /* Check EGA/VGA */ 232 : "a" (0x1200), "b" (0x10) /* Check EGA/VGA */
231 : "ecx", "edx", "esi", "edi"); 233 : "ecx", "edx", "esi", "edi");
232 234
235#ifndef _WAKEUP
236 boot_params.screen_info.orig_video_ega_bx = ega_bx;
237#endif
238
233 /* If we have MDA/CGA/HGC then BL will be unchanged at 0x10 */ 239 /* If we have MDA/CGA/HGC then BL will be unchanged at 0x10 */
234 if ((u8)boot_params.screen_info.orig_video_ega_bx != 0x10) { 240 if ((u8)ega_bx != 0x10) {
235 /* EGA/VGA */ 241 /* EGA/VGA */
236 asm(INT10 242 asm(INT10
237 : "=a" (vga_flag) 243 : "=a" (vga_flag)
@@ -240,7 +246,9 @@ static int vga_probe(void)
240 246
241 if (vga_flag == 0x1a) { 247 if (vga_flag == 0x1a) {
242 adapter = ADAPTER_VGA; 248 adapter = ADAPTER_VGA;
249#ifndef _WAKEUP
243 boot_params.screen_info.orig_video_isVGA = 1; 250 boot_params.screen_info.orig_video_isVGA = 1;
251#endif
244 } else { 252 } else {
245 adapter = ADAPTER_EGA; 253 adapter = ADAPTER_EGA;
246 } 254 }