Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113090
b: refs/heads/master
c: cdb3592
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Sep 2, 2008
1 parent dcde51c commit 8bb12d3
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 78 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e822358ac24550d889895d5866797ae8c9b188c2
refs/heads/master: cdb3592a20b41377a28a0737dc9af95e53024470
6 changes: 0 additions & 6 deletions trunk/arch/sparc/include/asm/reboot.h

This file was deleted.

2 changes: 1 addition & 1 deletion trunk/arch/sparc64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EXTRA_CFLAGS := -Werror

extra-y := head.o init_task.o vmlinux.lds

obj-y := process.o setup.o cpu.o idprom.o \
obj-y := process.o setup.o cpu.o idprom.o reboot.o \
traps.o auxio.o una_asm.o sysfs.o iommu.o \
irq.o ptrace.o time.o sys_sparc.o signal.o \
unaligned.o central.o starfire.o \
Expand Down
37 changes: 0 additions & 37 deletions trunk/arch/sparc64/kernel/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,11 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/reboot.h>
#include <linux/of_device.h>

#include <asm/auxio.h>
#include <asm/prom.h>
#include <asm/io.h>
#include <asm/sstate.h>
#include <asm/reboot.h>

/*
* sysctl - toggle power-off restriction for serial console
* systems in machine_power_off()
*/
int scons_pwroff = 1;

static void __iomem *power_reg;

Expand All @@ -33,31 +23,6 @@ static irqreturn_t power_handler(int irq, void *dev_id)
return IRQ_HANDLED;
}

static void (*poweroff_method)(void) = machine_alt_power_off;

void machine_power_off(void)
{
sstate_poweroff();
if (strcmp(of_console_device->type, "serial") || scons_pwroff) {
if (power_reg) {
/* Both register bits seem to have the
* same effect, so until I figure out
* what the difference is...
*/
writel(AUXIO_PCIO_CPWR_OFF | AUXIO_PCIO_SPWR_OFF, power_reg);
} else {
if (poweroff_method != NULL) {
poweroff_method();
/* not reached */
}
}
}
machine_halt();
}

void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);

static int __init has_button_interrupt(unsigned int irq, struct device_node *dp)
{
if (irq == 0xffffffff)
Expand All @@ -78,8 +43,6 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
printk(KERN_INFO "%s: Control reg at %lx\n",
op->node->name, res->start);

poweroff_method = machine_halt; /* able to use the standard halt */

if (has_button_interrupt(irq, op->node)) {
if (request_irq(irq,
power_handler, 0, "power", NULL) < 0)
Expand Down
33 changes: 0 additions & 33 deletions trunk/arch/sparc64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/user.h>
#include <linux/reboot.h>
#include <linux/delay.h>
#include <linux/compat.h>
#include <linux/tick.h>
Expand All @@ -31,7 +30,6 @@
#include <linux/elfcore.h>
#include <linux/sysrq.h>

#include <asm/oplib.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/page.h>
Expand All @@ -46,8 +44,6 @@
#include <asm/mmu_context.h>
#include <asm/unistd.h>
#include <asm/hypervisor.h>
#include <asm/sstate.h>
#include <asm/reboot.h>
#include <asm/syscalls.h>
#include <asm/irq_regs.h>
#include <asm/smp.h>
Expand Down Expand Up @@ -115,35 +111,6 @@ void cpu_idle(void)
}
}

void machine_halt(void)
{
sstate_halt();
prom_halt();
panic("Halt failed!");
}

void machine_alt_power_off(void)
{
sstate_poweroff();
prom_halt_power_off();
panic("Power-off failed!");
}

void machine_restart(char * cmd)
{
char *p;

sstate_reboot();
p = strchr (reboot_command, '\n');
if (p) *p = 0;
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
prom_reboot(reboot_command);
prom_reboot("");
panic("Reboot failed!");
}

#ifdef CONFIG_COMPAT
static void show_regwindow32(struct pt_regs *regs)
{
Expand Down
56 changes: 56 additions & 0 deletions trunk/arch/sparc64/kernel/reboot.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* reboot.c: reboot/shutdown/halt/poweroff handling
*
* Copyright (C) 2008 David S. Miller <davem@davemloft.net>
*/
#include <linux/kernel.h>
#include <linux/reboot.h>
#include <linux/module.h>
#include <linux/pm.h>

#include <asm/sstate.h>
#include <asm/oplib.h>
#include <asm/prom.h>

/* sysctl - toggle power-off restriction for serial console
* systems in machine_power_off()
*/
int scons_pwroff = 1;

/* This isn't actually used, it exists merely to satisfy the
* reference in kernel/sys.c
*/
void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);

void machine_power_off(void)
{
sstate_poweroff();
if (strcmp(of_console_device->type, "serial") || scons_pwroff)
prom_halt_power_off();

prom_halt();
}

void machine_halt(void)
{
sstate_halt();
prom_halt();
panic("Halt failed!");
}

void machine_restart(char *cmd)
{
char *p;

sstate_reboot();
p = strchr(reboot_command, '\n');
if (p)
*p = 0;
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
prom_reboot(reboot_command);
prom_reboot("");
panic("Reboot failed!");
}

0 comments on commit 8bb12d3

Please sign in to comment.