mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
Since default_power_off() never returns, annotate it with the __noreturn attribute to improve compiler optimizations. Signed-off-by: Thorsten Blum <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paul Walmsley <[email protected]>
42 lines
719 B
C
42 lines
719 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2012 Regents of the University of California
|
|
*/
|
|
|
|
#include <linux/efi.h>
|
|
#include <linux/reboot.h>
|
|
#include <linux/pm.h>
|
|
|
|
static void __noreturn default_power_off(void)
|
|
{
|
|
while (1)
|
|
wait_for_interrupt();
|
|
}
|
|
|
|
void (*pm_power_off)(void) = NULL;
|
|
EXPORT_SYMBOL(pm_power_off);
|
|
|
|
void machine_restart(char *cmd)
|
|
{
|
|
/*
|
|
* UpdateCapsule() depends on the system being reset via ResetSystem().
|
|
*/
|
|
if (efi_enabled(EFI_RUNTIME_SERVICES))
|
|
efi_reboot(reboot_mode, NULL);
|
|
|
|
do_kernel_restart(cmd);
|
|
while (1);
|
|
}
|
|
|
|
void machine_halt(void)
|
|
{
|
|
do_kernel_power_off();
|
|
default_power_off();
|
|
}
|
|
|
|
void machine_power_off(void)
|
|
{
|
|
do_kernel_power_off();
|
|
default_power_off();
|
|
}
|