a55d42e0e0
* conf/i386-coreboot.rmk (pkglib_MODULES): Add `reboot.mod' and `halt.mod'. (reboot_mod_SOURCES, reboot_mod_CFLAGS, reboot_mod_LDFLAGS) (halt_mod_SOURCES, halt_mod_CFLAGS, halt_mod_LDFLAGS): New variables. * kern/i386/halt.c: New file. * kern/i386/reboot.c: Likewise. * include/grub/i386/reboot.h: Likewise. * include/grub/i386/halt.h: Likewise. * commands/halt.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI]: Include `<grub/cpu/halt.h>'. * commands/reboot.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI] [! GRUB_MACHINE_PCBIOS]: Include `<grub/cpu/reboot.h>'. * term/i386/pc/at_keyboard.c: Include `<grub/cpu/at_keyboard.h>'. (SHIFT_L, SHIFT_R, CTRL, ALT, CAPS_LOCK, KEYBOARD_REG_DATA) (KEYBOARD_REG_STATUS, KEYBOARD_COMMAND_ISREADY, KEYBOARD_COMMAND_READ) (KEYBOARD_COMMAND_WRITE, KEYBOARD_COMMAND_REBOOT) (KEYBOARD_SCANCODE_SET1, KEYBOARD_ISMAKE, KEYBOARD_ISREADY) (KEYBOARD_SCANCODE, OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): Move from here ... * include/grub/i386/at_keyboard.h: ... to here.
54 lines
1.6 KiB
C
54 lines
1.6 KiB
C
/* halt.c - command to halt the computer. */
|
||
/*
|
||
* GRUB -- GRand Unified Bootloader
|
||
* Copyright (C) 2005,2007,2008 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
|
||
* the Free Software Foundation, either version 3 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* GRUB is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU General Public License
|
||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||
*/
|
||
|
||
#include <grub/normal.h>
|
||
#include <grub/dl.h>
|
||
#include <grub/machine/machine.h>
|
||
|
||
#if defined(GRUB_MACHINE_IEEE1275)
|
||
#include <grub/machine/kernel.h>
|
||
#elif defined(GRUB_MACHINE_EFI)
|
||
#include <grub/efi/efi.h>
|
||
#else
|
||
/* Platforms shipping standalone halt, such as coreboot. */
|
||
#include <grub/cpu/halt.h>
|
||
#endif
|
||
|
||
static grub_err_t
|
||
grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)),
|
||
int argc __attribute__ ((unused)),
|
||
char **args __attribute__ ((unused)))
|
||
{
|
||
grub_halt ();
|
||
return 0;
|
||
}
|
||
|
||
|
||
GRUB_MOD_INIT(halt)
|
||
{
|
||
(void)mod; /* To stop warning. */
|
||
grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH,
|
||
"halt", "halts the computer. This command does not"
|
||
" work on all firmware.", 0);
|
||
}
|
||
|
||
GRUB_MOD_FINI(halt)
|
||
{
|
||
grub_unregister_command ("halt");
|
||
}
|