xref: /openbmc/linux/arch/csky/kernel/power.c (revision b868a02e)
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 	do_kernel_power_off();
13 	asm volatile ("bkpt");
14 }
15 
16 void machine_halt(void)
17 {
18 	local_irq_disable();
19 	do_kernel_power_off();
20 	asm volatile ("bkpt");
21 }
22 
23 void machine_restart(char *cmd)
24 {
25 	local_irq_disable();
26 	do_kernel_restart(cmd);
27 	asm volatile ("bkpt");
28 }
29