sparc64: Move reboot handling into seperate file and kill power reg programming.
[deliverable/linux.git] / arch / sparc64 / kernel / reboot.c
CommitLineData
cdb3592a
DM
1/* reboot.c: reboot/shutdown/halt/poweroff handling
2 *
3 * Copyright (C) 2008 David S. Miller <davem@davemloft.net>
4 */
5#include <linux/kernel.h>
6#include <linux/reboot.h>
7#include <linux/module.h>
8#include <linux/pm.h>
9
10#include <asm/sstate.h>
11#include <asm/oplib.h>
12#include <asm/prom.h>
13
14/* sysctl - toggle power-off restriction for serial console
15 * systems in machine_power_off()
16 */
17int scons_pwroff = 1;
18
19/* This isn't actually used, it exists merely to satisfy the
20 * reference in kernel/sys.c
21 */
22void (*pm_power_off)(void) = machine_power_off;
23EXPORT_SYMBOL(pm_power_off);
24
25void machine_power_off(void)
26{
27 sstate_poweroff();
28 if (strcmp(of_console_device->type, "serial") || scons_pwroff)
29 prom_halt_power_off();
30
31 prom_halt();
32}
33
34void machine_halt(void)
35{
36 sstate_halt();
37 prom_halt();
38 panic("Halt failed!");
39}
40
41void machine_restart(char *cmd)
42{
43 char *p;
44
45 sstate_reboot();
46 p = strchr(reboot_command, '\n');
47 if (p)
48 *p = 0;
49 if (cmd)
50 prom_reboot(cmd);
51 if (*reboot_command)
52 prom_reboot(reboot_command);
53 prom_reboot("");
54 panic("Reboot failed!");
55}
56
This page took 0.047272 seconds and 5 git commands to generate.