vaseboot/VasEBoot-core/lib/efi/halt.c

42 lines
1.4 KiB
C

/* efi.c - generic EFI support */
/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* VAS_EBOOT 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.
*
* VAS_EBOOT 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 VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#include <VasEBoot/efi/api.h>
#include <VasEBoot/efi/efi.h>
#include <VasEBoot/misc.h>
#include <VasEBoot/mm.h>
#include <VasEBoot/kernel.h>
#include <VasEBoot/acpi.h>
#include <VasEBoot/loader.h>
void
VasEBoot_halt (void)
{
VasEBoot_machine_fini (VAS_EBOOT_LOADER_FLAG_NORETURN |
VAS_EBOOT_LOADER_FLAG_EFI_KEEP_ALLOCATED_MEMORY);
#if !defined(__ia64__) && !defined(__arm__) && !defined(__aarch64__) && \
!defined(__loongarch__) && !defined(__riscv)
VasEBoot_acpi_halt ();
#endif
VasEBoot_efi_system_table->runtime_services->reset_system (VAS_EBOOT_EFI_RESET_SHUTDOWN,
VAS_EBOOT_EFI_SUCCESS, 0, NULL);
while (1);
}