aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r--arch/cris/arch-v32/drivers/i2c.c1
-rw-r--r--arch/cris/arch-v32/drivers/pci/bios.c2
-rw-r--r--arch/cris/arch-v32/drivers/pci/dma.c1
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c1
-rw-r--r--arch/cris/arch-v32/kernel/entry.S2
-rw-r--r--arch/cris/arch-v32/kernel/process.c2
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c109
-rw-r--r--arch/cris/arch-v32/kernel/signal.c1
-rw-r--r--arch/cris/arch-v32/mm/tlb.c2
9 files changed, 36 insertions, 85 deletions
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c
index 179e7b804331..506826399ae7 100644
--- a/arch/cris/arch-v32/drivers/i2c.c
+++ b/arch/cris/arch-v32/drivers/i2c.c
@@ -27,7 +27,6 @@
27 27
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/slab.h>
31#include <linux/errno.h> 30#include <linux/errno.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/fs.h> 32#include <linux/fs.h>
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
index d4b9c36ddc0f..bc0cfdad1cbc 100644
--- a/arch/cris/arch-v32/drivers/pci/bios.c
+++ b/arch/cris/arch-v32/drivers/pci/bios.c
@@ -50,7 +50,7 @@ pcibios_align_resource(void *data, const struct resource *res,
50 if ((res->flags & IORESOURCE_IO) && (start & 0x300)) 50 if ((res->flags & IORESOURCE_IO) && (start & 0x300))
51 start = (start + 0x3ff) & ~0x3ff; 51 start = (start + 0x3ff) & ~0x3ff;
52 52
53 return start 53 return start;
54} 54}
55 55
56int pcibios_enable_resources(struct pci_dev *dev, int mask) 56int pcibios_enable_resources(struct pci_dev *dev, int mask)
diff --git a/arch/cris/arch-v32/drivers/pci/dma.c b/arch/cris/arch-v32/drivers/pci/dma.c
index fbe65954ee6c..ee55578d9834 100644
--- a/arch/cris/arch-v32/drivers/pci/dma.c
+++ b/arch/cris/arch-v32/drivers/pci/dma.c
@@ -13,6 +13,7 @@
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/gfp.h>
16#include <asm/io.h> 17#include <asm/io.h>
17 18
18void *dma_alloc_coherent(struct device *dev, size_t size, 19void *dma_alloc_coherent(struct device *dev, size_t size,
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index d2a0fbf5341f..4889f196ecd6 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -13,7 +13,6 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/major.h> 14#include <linux/major.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/slab.h>
17#include <linux/smp_lock.h> 16#include <linux/smp_lock.h>
18#include <linux/interrupt.h> 17#include <linux/interrupt.h>
19#include <linux/poll.h> 18#include <linux/poll.h>
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
index 435b9671bd4b..1f39861eac8c 100644
--- a/arch/cris/arch-v32/kernel/entry.S
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -615,7 +615,7 @@ sys_call_table:
615 .long sys_swapon 615 .long sys_swapon
616 .long sys_reboot 616 .long sys_reboot
617 .long sys_old_readdir 617 .long sys_old_readdir
618 .long old_mmap /* 90 */ 618 .long sys_old_mmap /* 90 */
619 .long sys_munmap 619 .long sys_munmap
620 .long sys_truncate 620 .long sys_truncate
621 .long sys_ftruncate 621 .long sys_ftruncate
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c
index 120e7f796fea..2661a9529d70 100644
--- a/arch/cris/arch-v32/kernel/process.c
+++ b/arch/cris/arch-v32/kernel/process.c
@@ -9,9 +9,9 @@
9 */ 9 */
10 10
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/slab.h>
12#include <linux/err.h> 13#include <linux/err.h>
13#include <linux/fs.h> 14#include <linux/fs.h>
14#include <linux/slab.h>
15#include <hwregs/reg_rdwr.h> 15#include <hwregs/reg_rdwr.h>
16#include <hwregs/reg_map.h> 16#include <hwregs/reg_map.h>
17#include <hwregs/timer_defs.h> 17#include <hwregs/timer_defs.h>
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index dd401473f5b5..f4ebd1e7d0f5 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -78,6 +78,35 @@ int put_reg(struct task_struct *task, unsigned int regno, unsigned long data)
78 return 0; 78 return 0;
79} 79}
80 80
81void user_enable_single_step(struct task_struct *child)
82{
83 unsigned long tmp;
84
85 /*
86 * Set up SPC if not set already (in which case we have no other
87 * choice but to trust it).
88 */
89 if (!get_reg(child, PT_SPC)) {
90 /* In case we're stopped in a delay slot. */
91 tmp = get_reg(child, PT_ERP) & ~1;
92 put_reg(child, PT_SPC, tmp);
93 }
94 tmp = get_reg(child, PT_CCS) | SBIT_USER;
95 put_reg(child, PT_CCS, tmp);
96}
97
98void user_disable_single_step(struct task_struct *child)
99{
100 put_reg(child, PT_SPC, 0);
101
102 if (!get_debugreg(child->pid, PT_BP_CTRL)) {
103 unsigned long tmp;
104 /* If no h/w bp configured, disable S bit. */
105 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
106 put_reg(child, PT_CCS, tmp);
107 }
108}
109
81/* 110/*
82 * Called by kernel/ptrace.c when detaching. 111 * Called by kernel/ptrace.c when detaching.
83 * 112 *
@@ -89,8 +118,7 @@ ptrace_disable(struct task_struct *child)
89 unsigned long tmp; 118 unsigned long tmp;
90 119
91 /* Deconfigure SPC and S-bit. */ 120 /* Deconfigure SPC and S-bit. */
92 tmp = get_reg(child, PT_CCS) & ~SBIT_USER; 121 user_disable_single_step(child);
93 put_reg(child, PT_CCS, tmp);
94 put_reg(child, PT_SPC, 0); 122 put_reg(child, PT_SPC, 0);
95 123
96 /* Deconfigure any watchpoints associated with the child. */ 124 /* Deconfigure any watchpoints associated with the child. */
@@ -169,83 +197,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
169 ret = 0; 197 ret = 0;
170 break; 198 break;
171 199
172 case PTRACE_SYSCALL:
173 case PTRACE_CONT:
174 ret = -EIO;
175
176 if (!valid_signal(data))
177 break;
178
179 /* Continue means no single-step. */
180 put_reg(child, PT_SPC, 0);
181
182 if (!get_debugreg(child->pid, PT_BP_CTRL)) {
183 unsigned long tmp;
184 /* If no h/w bp configured, disable S bit. */
185 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
186 put_reg(child, PT_CCS, tmp);
187 }
188
189 if (request == PTRACE_SYSCALL) {
190 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
191 }
192 else {
193 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
194 }
195
196 child->exit_code = data;
197
198 /* TODO: make sure any pending breakpoint is killed */
199 wake_up_process(child);
200 ret = 0;
201
202 break;
203
204 /* Make the child exit by sending it a sigkill. */
205 case PTRACE_KILL:
206 ret = 0;
207
208 if (child->exit_state == EXIT_ZOMBIE)
209 break;
210
211 child->exit_code = SIGKILL;
212
213 /* Deconfigure single-step and h/w bp. */
214 ptrace_disable(child);
215
216 /* TODO: make sure any pending breakpoint is killed */
217 wake_up_process(child);
218 break;
219
220 /* Set the trap flag. */
221 case PTRACE_SINGLESTEP: {
222 unsigned long tmp;
223 ret = -EIO;
224
225 /* Set up SPC if not set already (in which case we have
226 no other choice but to trust it). */
227 if (!get_reg(child, PT_SPC)) {
228 /* In case we're stopped in a delay slot. */
229 tmp = get_reg(child, PT_ERP) & ~1;
230 put_reg(child, PT_SPC, tmp);
231 }
232 tmp = get_reg(child, PT_CCS) | SBIT_USER;
233 put_reg(child, PT_CCS, tmp);
234
235 if (!valid_signal(data))
236 break;
237
238 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
239
240 /* TODO: set some clever breakpoint mechanism... */
241
242 child->exit_code = data;
243 wake_up_process(child);
244 ret = 0;
245 break;
246
247 }
248
249 /* Get all GP registers from the child. */ 200 /* Get all GP registers from the child. */
250 case PTRACE_GETREGS: { 201 case PTRACE_GETREGS: {
251 int i; 202 int i;
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index 372d0ca6efbc..0b7e3f143281 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -4,6 +4,7 @@
4 4
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/slab.h>
7#include <linux/kernel.h> 8#include <linux/kernel.h>
8#include <linux/signal.h> 9#include <linux/signal.h>
9#include <linux/errno.h> 10#include <linux/errno.h>
diff --git a/arch/cris/arch-v32/mm/tlb.c b/arch/cris/arch-v32/mm/tlb.c
index 6779bcb28ab0..c030d020660a 100644
--- a/arch/cris/arch-v32/mm/tlb.c
+++ b/arch/cris/arch-v32/mm/tlb.c
@@ -189,7 +189,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
189 spin_unlock(&mmu_context_lock); 189 spin_unlock(&mmu_context_lock);
190 190
191 /* 191 /*
192 * Remember the pgd for the fault handlers. Keep a seperate 192 * Remember the pgd for the fault handlers. Keep a separate
193 * copy of it because current and active_mm might be invalid 193 * copy of it because current and active_mm might be invalid
194 * at points where * there's still a need to derefer the pgd. 194 * at points where * there's still a need to derefer the pgd.
195 */ 195 */