Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 229441
Collapse All | Expand All

(-)linux-2.6.27.7.orig/arch/sparc/include/asm/reboot.h (-6 lines)
Removed Link Here
1
#ifndef _SPARC64_REBOOT_H
2
#define _SPARC64_REBOOT_H
3
4
extern void machine_alt_power_off(void);
5
6
#endif /* _SPARC64_REBOOT_H */
(-)linux-2.6.27.7.orig/arch/sparc64/kernel/Makefile (-1 / +1 lines)
Lines 7-13 Link Here
7
7
8
extra-y		:= head.o init_task.o vmlinux.lds
8
extra-y		:= head.o init_task.o vmlinux.lds
9
9
10
obj-y		:= process.o setup.o cpu.o idprom.o \
10
obj-y		:= process.o setup.o cpu.o idprom.o reboot.o \
11
		   traps.o auxio.o una_asm.o sysfs.o iommu.o \
11
		   traps.o auxio.o una_asm.o sysfs.o iommu.o \
12
		   irq.o ptrace.o time.o sys_sparc.o signal.o \
12
		   irq.o ptrace.o time.o sys_sparc.o signal.o \
13
		   unaligned.o central.o pci.o starfire.o \
13
		   unaligned.o central.o pci.o starfire.o \
(-)linux-2.6.27.7.orig/arch/sparc64/kernel/power.c (-36 lines)
Lines 10-34 Link Here
10
#include <linux/signal.h>
10
#include <linux/signal.h>
11
#include <linux/delay.h>
11
#include <linux/delay.h>
12
#include <linux/interrupt.h>
12
#include <linux/interrupt.h>
13
#include <linux/pm.h>
14
#include <linux/syscalls.h>
13
#include <linux/syscalls.h>
15
#include <linux/reboot.h>
14
#include <linux/reboot.h>
16
#include <linux/of_device.h>
15
#include <linux/of_device.h>
17
16
18
#include <asm/system.h>
17
#include <asm/system.h>
19
#include <asm/auxio.h>
20
#include <asm/prom.h>
18
#include <asm/prom.h>
21
#include <asm/io.h>
19
#include <asm/io.h>
22
#include <asm/sstate.h>
23
#include <asm/reboot.h>
24
20
25
#include <linux/unistd.h>
21
#include <linux/unistd.h>
26
22
27
/*
28
 * sysctl - toggle power-off restriction for serial console 
29
 * systems in machine_power_off()
30
 */
31
int scons_pwroff = 1; 
32
23
33
static void __iomem *power_reg;
24
static void __iomem *power_reg;
34
25
Lines 40-70 Link Here
40
	return IRQ_HANDLED;
31
	return IRQ_HANDLED;
41
}
32
}
42
33
43
static void (*poweroff_method)(void) = machine_alt_power_off;
44
45
void machine_power_off(void)
46
{
47
	sstate_poweroff();
48
	if (strcmp(of_console_device->type, "serial") || scons_pwroff) {
49
		if (power_reg) {
50
			/* Both register bits seem to have the
51
			 * same effect, so until I figure out
52
			 * what the difference is...
53
			 */
54
			writel(AUXIO_PCIO_CPWR_OFF | AUXIO_PCIO_SPWR_OFF, power_reg);
55
		} else {
56
			if (poweroff_method != NULL) {
57
				poweroff_method();
58
				/* not reached */
59
			}
60
		}
61
	}
62
	machine_halt();
63
}
64
65
void (*pm_power_off)(void) = machine_power_off;
66
EXPORT_SYMBOL(pm_power_off);
67
68
static int __init has_button_interrupt(unsigned int irq, struct device_node *dp)
34
static int __init has_button_interrupt(unsigned int irq, struct device_node *dp)
69
{
35
{
70
	if (irq == 0xffffffff)
36
	if (irq == 0xffffffff)
Lines 85-92 Link Here
85
	printk(KERN_INFO "%s: Control reg at %lx\n",
51
	printk(KERN_INFO "%s: Control reg at %lx\n",
86
	       op->node->name, res->start);
52
	       op->node->name, res->start);
87
53
88
	poweroff_method = machine_halt;  /* able to use the standard halt */
89
90
	if (has_button_interrupt(irq, op->node)) {
54
	if (has_button_interrupt(irq, op->node)) {
91
		if (request_irq(irq,
55
		if (request_irq(irq,
92
				power_handler, 0, "power", NULL) < 0)
56
				power_handler, 0, "power", NULL) < 0)
(-)linux-2.6.27.7.orig/arch/sparc64/kernel/process.c (-33 lines)
Lines 22-28 Link Here
22
#include <linux/ptrace.h>
22
#include <linux/ptrace.h>
23
#include <linux/slab.h>
23
#include <linux/slab.h>
24
#include <linux/user.h>
24
#include <linux/user.h>
25
#include <linux/reboot.h>
26
#include <linux/delay.h>
25
#include <linux/delay.h>
27
#include <linux/compat.h>
26
#include <linux/compat.h>
28
#include <linux/tick.h>
27
#include <linux/tick.h>
Lines 31-37 Link Here
31
#include <linux/elfcore.h>
30
#include <linux/elfcore.h>
32
#include <linux/sysrq.h>
31
#include <linux/sysrq.h>
33
32
34
#include <asm/oplib.h>
35
#include <asm/uaccess.h>
33
#include <asm/uaccess.h>
36
#include <asm/system.h>
34
#include <asm/system.h>
37
#include <asm/page.h>
35
#include <asm/page.h>
Lines 46-53 Link Here
46
#include <asm/mmu_context.h>
44
#include <asm/mmu_context.h>
47
#include <asm/unistd.h>
45
#include <asm/unistd.h>
48
#include <asm/hypervisor.h>
46
#include <asm/hypervisor.h>
49
#include <asm/sstate.h>
50
#include <asm/reboot.h>
51
#include <asm/syscalls.h>
47
#include <asm/syscalls.h>
52
#include <asm/irq_regs.h>
48
#include <asm/irq_regs.h>
53
#include <asm/smp.h>
49
#include <asm/smp.h>
Lines 115-149 Link Here
115
	}
111
	}
116
}
112
}
117
113
118
void machine_halt(void)
119
{
120
	sstate_halt();
121
	prom_halt();
122
	panic("Halt failed!");
123
}
124
125
void machine_alt_power_off(void)
126
{
127
	sstate_poweroff();
128
	prom_halt_power_off();
129
	panic("Power-off failed!");
130
}
131
132
void machine_restart(char * cmd)
133
{
134
	char *p;
135
	
136
	sstate_reboot();
137
	p = strchr (reboot_command, '\n');
138
	if (p) *p = 0;
139
	if (cmd)
140
		prom_reboot(cmd);
141
	if (*reboot_command)
142
		prom_reboot(reboot_command);
143
	prom_reboot("");
144
	panic("Reboot failed!");
145
}
146
147
#ifdef CONFIG_COMPAT
114
#ifdef CONFIG_COMPAT
148
static void show_regwindow32(struct pt_regs *regs)
115
static void show_regwindow32(struct pt_regs *regs)
149
{
116
{
(-)linux-2.6.27.7/arch/sparc64/kernel/reboot.c (+56 lines)
Added Link Here
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
 */
17
int scons_pwroff = 1;
18
19
/* This isn't actually used, it exists merely to satisfy the
20
 * reference in kernel/sys.c
21
 */
22
void (*pm_power_off)(void) = machine_power_off;
23
EXPORT_SYMBOL(pm_power_off);
24
25
void 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
34
void machine_halt(void)
35
{
36
	sstate_halt();
37
	prom_halt();
38
	panic("Halt failed!");
39
}
40
41
void 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

Return to bug 229441