* include/grub/misc.h (grub_reboot): Declare as noreturn.

* kern/efi/efi.c (grub_reboot): Don't return, even if reset_system
fails.
(grub_halt): Likewise.
* kern/ieee1275/openfw.c (grub_reboot): Don't return, even if
reset-all fails.
(grub_halt): Don't return, even if all of shut-down, power-off, and
poweroff fail.
This commit is contained in:
Colin Watson 2010-07-02 13:47:14 +01:00
parent 47695765a4
commit e03ed6c1ee
4 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,14 @@
2010-07-02 Colin Watson <cjwatson@ubuntu.com>
* include/grub/misc.h (grub_reboot): Declare as noreturn.
* kern/efi/efi.c (grub_reboot): Don't return, even if reset_system
fails.
(grub_halt): Likewise.
* kern/ieee1275/openfw.c (grub_reboot): Don't return, even if
reset-all fails.
(grub_halt): Don't return, even if all of shut-down, power-off, and
poweroff fail.
2010-07-02 Colin Watson <cjwatson@ubuntu.com> 2010-07-02 Colin Watson <cjwatson@ubuntu.com>
* kern/efi/init.c (grub_efi_init): set_watchdog_timer takes four * kern/efi/init.c (grub_efi_init): set_watchdog_timer takes four

View file

@ -298,7 +298,7 @@ grub_div_roundup (unsigned int x, unsigned int y)
} }
/* Reboot the machine. */ /* Reboot the machine. */
void EXPORT_FUNC (grub_reboot) (void); void EXPORT_FUNC (grub_reboot) (void) __attribute__ ((noreturn));
#ifdef GRUB_MACHINE_PCBIOS #ifdef GRUB_MACHINE_PCBIOS
/* Halt the system, using APM if possible. If NO_APM is true, don't /* Halt the system, using APM if possible. If NO_APM is true, don't

View file

@ -170,6 +170,7 @@ grub_reboot (void)
grub_efi_fini (); grub_efi_fini ();
efi_call_4 (grub_efi_system_table->runtime_services->reset_system, efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL); GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL);
for (;;) ;
} }
#endif #endif
@ -179,6 +180,7 @@ grub_halt (void)
grub_efi_fini (); grub_efi_fini ();
efi_call_4 (grub_efi_system_table->runtime_services->reset_system, efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL); GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL);
for (;;) ;
} }
int int

View file

@ -420,6 +420,7 @@ void
grub_reboot (void) grub_reboot (void)
{ {
grub_ieee1275_interpret ("reset-all", 0); grub_ieee1275_interpret ("reset-all", 0);
for (;;) ;
} }
#endif #endif
@ -431,4 +432,5 @@ grub_halt (void)
grub_ieee1275_interpret ("shut-down", 0); grub_ieee1275_interpret ("shut-down", 0);
grub_ieee1275_interpret ("power-off", 0); grub_ieee1275_interpret ("power-off", 0);
grub_ieee1275_interpret ("poweroff", 0); grub_ieee1275_interpret ("poweroff", 0);
for (;;) ;
} }