pkglib_PROGRAMS += kernel.img
kernel_img_SOURCES = kern/i386/coreboot/startup.S \
- kern/i386/misc.S \
kern/i386/coreboot/init.c \
kern/i386/coreboot/mmap.c \
- kern/i386/halt.c \
kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/term.c \
grub_mkrescue_SOURCES = util/grub-mkrescue.in
# Modules.
-pkglib_MODULES = linux.mod aout.mod halt.mod datetime.mod mmap.mod
+pkglib_MODULES = linux.mod aout.mod datetime.mod mmap.mod
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
-halt_mod_SOURCES = commands/halt.c
+pkglib_MODULES += halt.mod
+halt_mod_SOURCES = commands/halt.c lib/i386/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For kernel.img.
kernel_img_SOURCES = kern/i386/ieee1275/startup.S \
- kern/i386/misc.S \
kern/ieee1275/init.c \
kern/ieee1275/mmap.c \
kern/ieee1275/cmain.c kern/ieee1275/openfw.c \
grub_install_SOURCES = util/ieee1275/grub-install.in
# Modules.
-pkglib_MODULES = halt.mod suspend.mod \
+pkglib_MODULES = suspend.mod \
aout.mod linux.mod \
nand.mod datetime.mod \
mmap.mod
suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod
-halt_mod_SOURCES = commands/halt.c
+pkglib_MODULES += halt.mod
+halt_mod_SOURCES = commands/halt.c lib/ieee1275/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_PROGRAMS += kernel.img
kernel_img_SOURCES = kern/i386/coreboot/startup.S \
- kern/i386/misc.S \
kern/i386/coreboot/init.c \
kern/i386/multiboot_mmap.c \
- kern/i386/halt.c \
kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/term.c \
grub_mkrescue_SOURCES = util/grub-mkrescue.in
# Modules.
-pkglib_MODULES = linux.mod aout.mod halt.mod datetime.mod mmap.mod
+pkglib_MODULES = linux.mod aout.mod datetime.mod mmap.mod
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
-halt_mod_SOURCES = commands/halt.c
+pkglib_MODULES += halt.mod
+halt_mod_SOURCES = commands/halt.c lib/i386/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
grub_mkrescue_SOURCES = util/grub-mkrescue.in
pkglib_MODULES = biosdisk.mod chain.mod \
- halt.mod \
vbe.mod vbetest.mod vbeinfo.mod \
vga.mod \
aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod \
xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
# For halt.mod.
+pkglib_MODULES += halt.mod
halt_mod_SOURCES = commands/i386/pc/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_IMAGES += kernel.img
kernel_img_SOURCES = kern/i386/qemu/startup.S \
- kern/i386/misc.S \
kern/i386/coreboot/init.c \
kern/i386/qemu/mmap.c \
- kern/i386/halt.c \
kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/term.c \
grub_mkrescue_SOURCES = util/grub-mkrescue.in
# Modules.
-pkglib_MODULES = linux.mod aout.mod halt.mod datetime.mod mmap.mod
+pkglib_MODULES = linux.mod aout.mod datetime.mod mmap.mod
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
-halt_mod_SOURCES = commands/halt.c
+pkglib_MODULES += halt.mod
+halt_mod_SOURCES = commands/halt.c lib/i386/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod
pkglib_MODULES += halt.mod
-halt_mod_SOURCES = commands/halt.c
+halt_mod_SOURCES = commands/halt.c lib/ieee1275/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
pkglib_MODULES += halt.mod
-halt_mod_SOURCES = commands/halt.c
+halt_mod_SOURCES = commands/halt.c lib/ieee1275/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# Modules.
pkglib_PROGRAMS = kernel.img
pkglib_MODULES = chain.mod appleldr.mod \
- linux.mod halt.mod \
+ linux.mod \
datetime.mod loadbios.mod \
fixvideo.mod mmap.mod acpi.mod
endif
# For halt.mod.
-halt_mod_SOURCES = commands/halt.c
+pkglib_MODULES += halt.mod
+halt_mod_SOURCES = commands/halt.c lib/efi/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
* use APM even if it is available. */
void grub_halt (int no_apm);
#else
-void EXPORT_FUNC (grub_halt) (void);
+void grub_halt (void);
#endif
#endif /* ! GRUB_MISC_HEADER */
}
#endif
-void
-grub_halt (void)
-{
- grub_efi_fini ();
- efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
- GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL);
-}
-
int
grub_efi_exit_boot_services (grub_efi_uintn_t map_key)
{
#include <grub/kernel.h>
#include <grub/mm.h>
#include <grub/machine/time.h>
-#include <grub/machine/init.h>
#include <grub/machine/memory.h>
#include <grub/machine/console.h>
#include <grub/machine/kernel.h>
#include <grub/time.h>
#include <grub/symbol.h>
#include <grub/cpu/io.h>
+#include <grub/cpu/floppy.h>
#include <grub/cpu/kernel.h>
#include <grub/cpu/tsc.h>
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <grub/machine/init.h>
#include <grub/machine/memory.h>
#include <grub/machine/boot.h>
#include <grub/types.h>
call EXT_C(grub_main)
/* This should never happen. */
- jmp EXT_C(grub_stop)
+ cli
+1:
+ hlt
+ jmp 1b
#include "../realmode.S"
grub_ieee1275_interpret ("reset-all", 0);
}
#endif
-
-void
-grub_halt (void)
-{
- /* Not standardized. We try three known commands. */
-
- grub_ieee1275_interpret ("shut-down", 0);
- grub_ieee1275_interpret ("power-off", 0);
- grub_ieee1275_interpret ("poweroff", 0);
-}
+/* efi.c - generic EFI support */
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc.
+ * Copyright (C) 2006,2007,2008,2009,2010 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
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <grub/symbol.h>
+#include <grub/efi/api.h>
+#include <grub/efi/efi.h>
+#include <grub/misc.h>
+#include <grub/mm.h>
+#include <grub/kernel.h>
- .text
-/*
- * This call is special... it never returns... in fact it should simply
- * hang at this point!
- */
-FUNCTION(grub_stop)
- cli
-1: hlt
- jmp 1b
+void
+grub_halt (void)
+{
+ grub_machine_fini ();
+ efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
+ GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL);
+}
*/
#include <grub/cpu/io.h>
-#include <grub/machine/init.h>
#include <grub/misc.h>
const char bochs_shutdown[] = "Shutdown";
+/*
+ * This call is special... it never returns... in fact it should simply
+ * hang at this point!
+ */
+static inline void __attribute__ ((noreturn))
+stop (void)
+{
+ asm volatile ("cli");
+ while (1)
+ {
+ asm volatile ("hlt");
+ }
+}
+
void
grub_halt (void)
{
/* In order to return we'd have to check what the previous status of IF
flag was. But user most likely doesn't want to return anyway ... */
- grub_stop ();
+ stop ();
}
+/* openfw.c -- Open firmware support functions. */
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2003,2004,2005,2007,2008,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
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef GRUB_INIT_I386_LINUXBIOS_HEADER
-#define GRUB_INIT_I386_LINUXBIOS_HEADER 1
+#include <grub/ieee1275/ieee1275.h>
+#include <grub/misc.h>
-#include <grub/symbol.h>
-#include <grub/i386/pc/memory.h>
-#include <grub/i386/floppy.h>
+void
+grub_halt (void)
+{
+ /* Not standardized. We try three known commands. */
-void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn));
-
-#endif
+ grub_ieee1275_interpret ("shut-down", 0);
+ grub_ieee1275_interpret ("power-off", 0);
+ grub_ieee1275_interpret ("poweroff", 0);
+}
#include <grub/cpu/loader.h>
#include <grub/cpu/bsd.h>
#include <grub/i386/cpuid.h>
-#include <grub/machine/init.h>
#include <grub/machine/memory.h>
#include <grub/memory.h>
#include <grub/file.h>