blob: ee5878d968cc11c4398ef76dba90e0f5980e04c9 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-only
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2012 Regents of the University of California
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
6#include <linux/reboot.h>
David Brazdil0f672f62019-12-10 10:32:29 +00007#include <linux/pm.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00008
David Brazdil0f672f62019-12-10 10:32:29 +00009static void default_power_off(void)
10{
Olivier Deprez157378f2022-04-04 15:47:50 +020011 while (1)
12 wait_for_interrupt();
David Brazdil0f672f62019-12-10 10:32:29 +000013}
14
15void (*pm_power_off)(void) = default_power_off;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016EXPORT_SYMBOL(pm_power_off);
17
18void machine_restart(char *cmd)
19{
20 do_kernel_restart(cmd);
21 while (1);
22}
23
24void machine_halt(void)
25{
David Brazdil0f672f62019-12-10 10:32:29 +000026 pm_power_off();
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000027}
28
29void machine_power_off(void)
30{
David Brazdil0f672f62019-12-10 10:32:29 +000031 pm_power_off();
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000032}