diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 18 | ||||
-rw-r--r-- | arch/powerpc/kernel/ppc_ksyms.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/ptrace-common.h | 164 | ||||
-rw-r--r-- | arch/powerpc/kernel/ptrace.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/ptrace32.c | 3 |
5 files changed, 169 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 5a5b24685081..8b6008ab217d 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | unsigned long pci_probe_only = 1; | 42 | unsigned long pci_probe_only = 1; |
43 | unsigned long pci_assign_all_buses = 0; | 43 | int pci_assign_all_buses = 0; |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * legal IO pages under MAX_ISA_PORT. This is to ensure we don't touch | 46 | * legal IO pages under MAX_ISA_PORT. This is to ensure we don't touch |
@@ -55,11 +55,6 @@ static void fixup_resource(struct resource *res, struct pci_dev *dev); | |||
55 | static void do_bus_setup(struct pci_bus *bus); | 55 | static void do_bus_setup(struct pci_bus *bus); |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | unsigned int pcibios_assign_all_busses(void) | ||
59 | { | ||
60 | return pci_assign_all_buses; | ||
61 | } | ||
62 | |||
63 | /* pci_io_base -- the base address from which io bars are offsets. | 58 | /* pci_io_base -- the base address from which io bars are offsets. |
64 | * This is the lowest I/O base address (so bar values are always positive), | 59 | * This is the lowest I/O base address (so bar values are always positive), |
65 | * and it *must* be the start of ISA space if an ISA bus exists because | 60 | * and it *must* be the start of ISA space if an ISA bus exists because |
@@ -1186,17 +1181,6 @@ void phbs_remap_io(void) | |||
1186 | remap_bus_range(hose->bus); | 1181 | remap_bus_range(hose->bus); |
1187 | } | 1182 | } |
1188 | 1183 | ||
1189 | /* | ||
1190 | * ppc64 can have multifunction devices that do not respond to function 0. | ||
1191 | * In this case we must scan all functions. | ||
1192 | * XXX this can go now, we use the OF device tree in all the | ||
1193 | * cases that caused problems. -- paulus | ||
1194 | */ | ||
1195 | int pcibios_scan_all_fns(struct pci_bus *bus, int devfn) | ||
1196 | { | ||
1197 | return 0; | ||
1198 | } | ||
1199 | |||
1200 | static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) | 1184 | static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) |
1201 | { | 1185 | { |
1202 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | 1186 | struct pci_controller *hose = pci_bus_to_host(dev->bus); |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index 59846b40d521..af4d1bc9a2eb 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -146,9 +146,6 @@ EXPORT_SYMBOL(pci_bus_io_base); | |||
146 | EXPORT_SYMBOL(pci_bus_io_base_phys); | 146 | EXPORT_SYMBOL(pci_bus_io_base_phys); |
147 | EXPORT_SYMBOL(pci_bus_mem_base_phys); | 147 | EXPORT_SYMBOL(pci_bus_mem_base_phys); |
148 | EXPORT_SYMBOL(pci_bus_to_hose); | 148 | EXPORT_SYMBOL(pci_bus_to_hose); |
149 | EXPORT_SYMBOL(pci_resource_to_bus); | ||
150 | EXPORT_SYMBOL(pci_phys_to_bus); | ||
151 | EXPORT_SYMBOL(pci_bus_to_phys); | ||
152 | #endif /* CONFIG_PCI */ | 149 | #endif /* CONFIG_PCI */ |
153 | 150 | ||
154 | #ifdef CONFIG_NOT_COHERENT_CACHE | 151 | #ifdef CONFIG_NOT_COHERENT_CACHE |
diff --git a/arch/powerpc/kernel/ptrace-common.h b/arch/powerpc/kernel/ptrace-common.h new file mode 100644 index 000000000000..b1babb729673 --- /dev/null +++ b/arch/powerpc/kernel/ptrace-common.h | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | * linux/arch/ppc64/kernel/ptrace-common.h | ||
3 | * | ||
4 | * Copyright (c) 2002 Stephen Rothwell, IBM Coproration | ||
5 | * Extracted from ptrace.c and ptrace32.c | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General | ||
8 | * Public License. See the file README.legal in the main directory of | ||
9 | * this archive for more details. | ||
10 | */ | ||
11 | |||
12 | #ifndef _PPC64_PTRACE_COMMON_H | ||
13 | #define _PPC64_PTRACE_COMMON_H | ||
14 | |||
15 | #include <linux/config.h> | ||
16 | #include <asm/system.h> | ||
17 | |||
18 | /* | ||
19 | * Set of msr bits that gdb can change on behalf of a process. | ||
20 | */ | ||
21 | #define MSR_DEBUGCHANGE (MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1) | ||
22 | |||
23 | /* | ||
24 | * Get contents of register REGNO in task TASK. | ||
25 | */ | ||
26 | static inline unsigned long get_reg(struct task_struct *task, int regno) | ||
27 | { | ||
28 | unsigned long tmp = 0; | ||
29 | |||
30 | /* | ||
31 | * Put the correct FP bits in, they might be wrong as a result | ||
32 | * of our lazy FP restore. | ||
33 | */ | ||
34 | if (regno == PT_MSR) { | ||
35 | tmp = ((unsigned long *)task->thread.regs)[PT_MSR]; | ||
36 | tmp |= task->thread.fpexc_mode; | ||
37 | } else if (regno < (sizeof(struct pt_regs) / sizeof(unsigned long))) { | ||
38 | tmp = ((unsigned long *)task->thread.regs)[regno]; | ||
39 | } | ||
40 | |||
41 | return tmp; | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * Write contents of register REGNO in task TASK. | ||
46 | */ | ||
47 | static inline int put_reg(struct task_struct *task, int regno, | ||
48 | unsigned long data) | ||
49 | { | ||
50 | if (regno < PT_SOFTE) { | ||
51 | if (regno == PT_MSR) | ||
52 | data = (data & MSR_DEBUGCHANGE) | ||
53 | | (task->thread.regs->msr & ~MSR_DEBUGCHANGE); | ||
54 | ((unsigned long *)task->thread.regs)[regno] = data; | ||
55 | return 0; | ||
56 | } | ||
57 | return -EIO; | ||
58 | } | ||
59 | |||
60 | static inline void set_single_step(struct task_struct *task) | ||
61 | { | ||
62 | struct pt_regs *regs = task->thread.regs; | ||
63 | if (regs != NULL) | ||
64 | regs->msr |= MSR_SE; | ||
65 | set_ti_thread_flag(task->thread_info, TIF_SINGLESTEP); | ||
66 | } | ||
67 | |||
68 | static inline void clear_single_step(struct task_struct *task) | ||
69 | { | ||
70 | struct pt_regs *regs = task->thread.regs; | ||
71 | if (regs != NULL) | ||
72 | regs->msr &= ~MSR_SE; | ||
73 | clear_ti_thread_flag(task->thread_info, TIF_SINGLESTEP); | ||
74 | } | ||
75 | |||
76 | #ifdef CONFIG_ALTIVEC | ||
77 | /* | ||
78 | * Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go. | ||
79 | * The transfer totals 34 quadword. Quadwords 0-31 contain the | ||
80 | * corresponding vector registers. Quadword 32 contains the vscr as the | ||
81 | * last word (offset 12) within that quadword. Quadword 33 contains the | ||
82 | * vrsave as the first word (offset 0) within the quadword. | ||
83 | * | ||
84 | * This definition of the VMX state is compatible with the current PPC32 | ||
85 | * ptrace interface. This allows signal handling and ptrace to use the | ||
86 | * same structures. This also simplifies the implementation of a bi-arch | ||
87 | * (combined (32- and 64-bit) gdb. | ||
88 | */ | ||
89 | |||
90 | /* | ||
91 | * Get contents of AltiVec register state in task TASK | ||
92 | */ | ||
93 | static inline int get_vrregs(unsigned long __user *data, | ||
94 | struct task_struct *task) | ||
95 | { | ||
96 | unsigned long regsize; | ||
97 | |||
98 | /* copy AltiVec registers VR[0] .. VR[31] */ | ||
99 | regsize = 32 * sizeof(vector128); | ||
100 | if (copy_to_user(data, task->thread.vr, regsize)) | ||
101 | return -EFAULT; | ||
102 | data += (regsize / sizeof(unsigned long)); | ||
103 | |||
104 | /* copy VSCR */ | ||
105 | regsize = 1 * sizeof(vector128); | ||
106 | if (copy_to_user(data, &task->thread.vscr, regsize)) | ||
107 | return -EFAULT; | ||
108 | data += (regsize / sizeof(unsigned long)); | ||
109 | |||
110 | /* copy VRSAVE */ | ||
111 | if (put_user(task->thread.vrsave, (u32 __user *)data)) | ||
112 | return -EFAULT; | ||
113 | |||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | /* | ||
118 | * Write contents of AltiVec register state into task TASK. | ||
119 | */ | ||
120 | static inline int set_vrregs(struct task_struct *task, | ||
121 | unsigned long __user *data) | ||
122 | { | ||
123 | unsigned long regsize; | ||
124 | |||
125 | /* copy AltiVec registers VR[0] .. VR[31] */ | ||
126 | regsize = 32 * sizeof(vector128); | ||
127 | if (copy_from_user(task->thread.vr, data, regsize)) | ||
128 | return -EFAULT; | ||
129 | data += (regsize / sizeof(unsigned long)); | ||
130 | |||
131 | /* copy VSCR */ | ||
132 | regsize = 1 * sizeof(vector128); | ||
133 | if (copy_from_user(&task->thread.vscr, data, regsize)) | ||
134 | return -EFAULT; | ||
135 | data += (regsize / sizeof(unsigned long)); | ||
136 | |||
137 | /* copy VRSAVE */ | ||
138 | if (get_user(task->thread.vrsave, (u32 __user *)data)) | ||
139 | return -EFAULT; | ||
140 | |||
141 | return 0; | ||
142 | } | ||
143 | #endif | ||
144 | |||
145 | static inline int ptrace_set_debugreg(struct task_struct *task, | ||
146 | unsigned long addr, unsigned long data) | ||
147 | { | ||
148 | /* We only support one DABR and no IABRS at the moment */ | ||
149 | if (addr > 0) | ||
150 | return -EINVAL; | ||
151 | |||
152 | /* The bottom 3 bits are flags */ | ||
153 | if ((data & ~0x7UL) >= TASK_SIZE) | ||
154 | return -EIO; | ||
155 | |||
156 | /* Ensure translation is on */ | ||
157 | if (data && !(data & DABR_TRANSLATION)) | ||
158 | return -EIO; | ||
159 | |||
160 | task->thread.dabr = data; | ||
161 | return 0; | ||
162 | } | ||
163 | |||
164 | #endif /* _PPC64_PTRACE_COMMON_H */ | ||
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 3d2abd95c7ae..400793c71304 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -36,8 +36,9 @@ | |||
36 | #include <asm/page.h> | 36 | #include <asm/page.h> |
37 | #include <asm/pgtable.h> | 37 | #include <asm/pgtable.h> |
38 | #include <asm/system.h> | 38 | #include <asm/system.h> |
39 | |||
39 | #ifdef CONFIG_PPC64 | 40 | #ifdef CONFIG_PPC64 |
40 | #include <asm/ptrace-common.h> | 41 | #include "ptrace-common.h" |
41 | #endif | 42 | #endif |
42 | 43 | ||
43 | #ifdef CONFIG_PPC32 | 44 | #ifdef CONFIG_PPC32 |
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c index 91eb952e0293..61762640b877 100644 --- a/arch/powerpc/kernel/ptrace32.c +++ b/arch/powerpc/kernel/ptrace32.c | |||
@@ -33,7 +33,8 @@ | |||
33 | #include <asm/page.h> | 33 | #include <asm/page.h> |
34 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
35 | #include <asm/system.h> | 35 | #include <asm/system.h> |
36 | #include <asm/ptrace-common.h> | 36 | |
37 | #include "ptrace-common.h" | ||
37 | 38 | ||
38 | /* | 39 | /* |
39 | * does not yet catch signals sent when the child dies. | 40 | * does not yet catch signals sent when the child dies. |