xref: /openbmc/linux/arch/csky/kernel/power.c (revision fb574682)
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
3 
4 #include <linux/reboot.h>
5 
6 void (*pm_power_off)(void);
7 EXPORT_SYMBOL(pm_power_off);
8 
9 void machine_power_off(void)
10 {
11 	local_irq_disable();
12 	if (pm_power_off)
13 		pm_power_off();
14 	asm volatile ("bkpt");
15 }
16 
17 void machine_halt(void)
18 {
19 	local_irq_disable();
20 	if (pm_power_off)
21 		pm_power_off();
22 	asm volatile ("bkpt");
23 }
24 
25 void machine_restart(char *cmd)
26 {
27 	local_irq_disable();
28 	do_kernel_restart(cmd);
29 	asm volatile ("bkpt");
30 }
31