diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2008-03-27 11:38:31 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-01 20:43:07 +1100 |
commit | ca052f7924141f34998ab440bb4d908dc021a46b (patch) | |
tree | f84280e5932f214794afcbbe95d866eabcf0a3a7 /drivers/ps3/sys-manager-core.c | |
parent | 5761eaa3a5ae3c7ea796add73b86176b7c963cca (diff) | |
download | lwn-ca052f7924141f34998ab440bb4d908dc021a46b.tar.gz lwn-ca052f7924141f34998ab440bb4d908dc021a46b.zip |
[POWERPC] PS3: Save power in busy loops on halt
PS3 save power on halt:
- Replace infinite busy loops by smarter loops calling
lv1_pause() to save power.
- Add ps3_halt() and ps3_sys_manager_halt().
- Add __noreturn annotations.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/ps3/sys-manager-core.c')
-rw-r--r-- | drivers/ps3/sys-manager-core.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/ps3/sys-manager-core.c b/drivers/ps3/sys-manager-core.c index 31648f7d9ae1..474225852b63 100644 --- a/drivers/ps3/sys-manager-core.c +++ b/drivers/ps3/sys-manager-core.c @@ -19,6 +19,7 @@ */ #include <linux/kernel.h> +#include <asm/lv1call.h> #include <asm/ps3.h> /** @@ -50,10 +51,7 @@ void ps3_sys_manager_power_off(void) if (ps3_sys_manager_ops.power_off) ps3_sys_manager_ops.power_off(ps3_sys_manager_ops.dev); - printk(KERN_EMERG "System Halted, OK to turn off power\n"); - local_irq_disable(); - while (1) - (void)0; + ps3_sys_manager_halt(); } void ps3_sys_manager_restart(void) @@ -61,8 +59,14 @@ void ps3_sys_manager_restart(void) if (ps3_sys_manager_ops.restart) ps3_sys_manager_ops.restart(ps3_sys_manager_ops.dev); - printk(KERN_EMERG "System Halted, OK to turn off power\n"); + ps3_sys_manager_halt(); +} + +void ps3_sys_manager_halt(void) +{ + pr_emerg("System Halted, OK to turn off power\n"); local_irq_disable(); while (1) - (void)0; + lv1_pause(1); } + |