0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <linux/kernel.h>
0010 #include <linux/export.h>
0011 #include <asm/lv1call.h>
0012 #include <asm/ps3.h>
0013
0014
0015
0016
0017
0018
0019 static struct ps3_sys_manager_ops ps3_sys_manager_ops;
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops)
0031 {
0032 BUG_ON(!ops);
0033 BUG_ON(!ops->dev);
0034 ps3_sys_manager_ops = *ops;
0035 }
0036 EXPORT_SYMBOL_GPL(ps3_sys_manager_register_ops);
0037
0038 void __noreturn ps3_sys_manager_power_off(void)
0039 {
0040 if (ps3_sys_manager_ops.power_off)
0041 ps3_sys_manager_ops.power_off(ps3_sys_manager_ops.dev);
0042
0043 ps3_sys_manager_halt();
0044 }
0045
0046 void __noreturn ps3_sys_manager_restart(void)
0047 {
0048 if (ps3_sys_manager_ops.restart)
0049 ps3_sys_manager_ops.restart(ps3_sys_manager_ops.dev);
0050
0051 ps3_sys_manager_halt();
0052 }
0053
0054 void __noreturn ps3_sys_manager_halt(void)
0055 {
0056 pr_emerg("System Halted, OK to turn off power\n");
0057 local_irq_disable();
0058 while (1)
0059 lv1_pause(1);
0060 }
0061