File tree Expand file tree Collapse file tree 1 file changed +22
-16
lines changed Expand file tree Collapse file tree 1 file changed +22
-16
lines changed Original file line number Diff line number Diff line change 11
11
#include <linux/init.h>
12
12
#include <linux/kexec.h>
13
13
#include <linux/pm.h>
14
- #include <linux/reboot.h>
15
14
#include <linux/slab.h>
16
15
17
16
#include <asm/bootinfo.h>
22
21
#include <loongson.h>
23
22
#include <boot_param.h>
24
23
25
- static int firmware_restart ( struct sys_off_data * unusedd )
24
+ static void loongson_restart ( char * command )
26
25
{
27
26
28
27
void (* fw_restart )(void ) = (void * )loongson_sysconf .restart_addr ;
29
28
30
29
fw_restart ();
31
- return NOTIFY_DONE ;
30
+ while (1 ) {
31
+ if (cpu_wait )
32
+ cpu_wait ();
33
+ }
32
34
}
33
35
34
- static int firmware_poweroff ( struct sys_off_data * unused )
36
+ static void loongson_poweroff ( void )
35
37
{
36
38
void (* fw_poweroff )(void ) = (void * )loongson_sysconf .poweroff_addr ;
37
39
38
40
fw_poweroff ();
39
- return NOTIFY_DONE ;
41
+ while (1 ) {
42
+ if (cpu_wait )
43
+ cpu_wait ();
44
+ }
45
+ }
46
+
47
+ static void loongson_halt (void )
48
+ {
49
+ pr_notice ("\n\n** You can safely turn off the power now **\n\n" );
50
+ while (1 ) {
51
+ if (cpu_wait )
52
+ cpu_wait ();
53
+ }
40
54
}
41
55
42
56
#ifdef CONFIG_KEXEC
@@ -140,17 +154,9 @@ static void loongson_crash_shutdown(struct pt_regs *regs)
140
154
141
155
static int __init mips_reboot_setup (void )
142
156
{
143
- if (loongson_sysconf .restart_addr ) {
144
- register_sys_off_handler (SYS_OFF_MODE_RESTART ,
145
- SYS_OFF_PRIO_FIRMWARE ,
146
- firmware_restart , NULL );
147
- }
148
-
149
- if (loongson_sysconf .poweroff_addr ) {
150
- register_sys_off_handler (SYS_OFF_MODE_POWER_OFF ,
151
- SYS_OFF_PRIO_FIRMWARE ,
152
- firmware_poweroff , NULL );
153
- }
157
+ _machine_restart = loongson_restart ;
158
+ _machine_halt = loongson_halt ;
159
+ pm_power_off = loongson_poweroff ;
154
160
155
161
#ifdef CONFIG_KEXEC
156
162
kexec_argv = kmalloc (KEXEC_ARGV_SIZE , GFP_KERNEL );
You can’t perform that action at this time.
0 commit comments