2009-07-07 Robert Millan
* conf/i386-coreboot.rmk (reboot_mod_SOURCES): Remove
`kern/i386/reboot.c'.
* kern/i386/qemu/startup.S: Include `"../realmode.S"'.
(grub_reboot): New function.
* kern/i386/realmode.S: Include `'.
(prot_to_real): Only enable i8086 interrupts on i386-pc.
* include/grub/i386/coreboot/init.h (grub_reboot): New function
prototype.
Index: conf/i386-coreboot.rmk
===================================================================
--- conf/i386-coreboot.rmk (revision 2398)
+++ conf/i386-coreboot.rmk (working copy)
@@ -174,7 +174,7 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod.
-reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c
+reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
Index: kern/i386/qemu/startup.S
===================================================================
--- kern/i386/qemu/startup.S (revision 2398)
+++ kern/i386/qemu/startup.S (working copy)
@@ -95,3 +95,11 @@ codestart:
/* This should never happen. */
jmp EXT_C(grub_stop)
+
+#include "../realmode.S"
+
+FUNCTION(grub_reboot)
+ call prot_to_real
+ .code16
+ ljmp $0xf000, $0xfff0
+ .code32
Index: kern/i386/realmode.S
===================================================================
--- kern/i386/realmode.S (revision 2398)
+++ kern/i386/realmode.S (working copy)
@@ -41,6 +41,8 @@
* with "ret $N" where N is ((the number of arguments) - 3) * 4.
*/
+#include
+
/*
* This is the area for all of the special variables.
*/
@@ -215,8 +217,10 @@ realcseg:
movw %ax, %gs
movw %ax, %ss
+#ifdef GRUB_MACHINE_PCBIOS
/* restore interrupts */
sti
+#endif
/* return on new stack! */
DATA32 ret
Index: include/grub/i386/coreboot/init.h
===================================================================
--- include/grub/i386/coreboot/init.h (revision 2398)
+++ include/grub/i386/coreboot/init.h (working copy)
@@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,5 +24,6 @@
void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn));
void EXPORT_FUNC(grub_stop_floppy) (void);
+void EXPORT_FUNC (grub_reboot) (void) __attribute__ ((noreturn));
#endif