]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - wimboot/wimboot-2.7.3/src/die.c
2 * Copyright (C) 2014 Michael Brown <mbrown@fensystems.co.uk>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
35 * @v fmt Error message format string
38 void die ( const char *fmt
, ... ) {
39 EFI_BOOT_SERVICES
*bs
;
40 EFI_RUNTIME_SERVICES
*rs
;
44 va_start ( args
, fmt
);
45 vprintf ( fmt
, args
);
48 /* Reboot or exit as applicable */
52 bs
= efi_systab
->BootServices
;
53 bs
->Exit ( efi_image_handle
, EFI_LOAD_ERROR
, 0, NULL
);
54 printf ( "Failed to exit\n" );
55 rs
= efi_systab
->RuntimeServices
;
56 rs
->ResetSystem ( EfiResetWarm
, 0, 0, NULL
);
57 printf ( "Failed to reboot\n" );
61 /* Wait for keypress */
62 printf ( "Press a key to reboot..." );
70 /* Should be impossible to reach this */
71 __builtin_unreachable();