diff options
Diffstat (limited to 'arch/sh/kernel/process.c')
-rw-r--r-- | arch/sh/kernel/process.c | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 0b1d5dd7a93b..a52b13ac6b7f 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * Copyright (C) 1995 Linus Torvalds | 5 | * Copyright (C) 1995 Linus Torvalds |
6 | * | 6 | * |
7 | * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima | 7 | * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima |
8 | * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC | ||
8 | */ | 9 | */ |
9 | 10 | ||
10 | /* | 11 | /* |
@@ -104,7 +105,7 @@ void show_regs(struct pt_regs * regs) | |||
104 | { | 105 | { |
105 | printk("\n"); | 106 | printk("\n"); |
106 | printk("Pid : %d, Comm: %20s\n", current->pid, current->comm); | 107 | printk("Pid : %d, Comm: %20s\n", current->pid, current->comm); |
107 | print_symbol("PC is at %s\n", regs->pc); | 108 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
108 | printk("PC : %08lx SP : %08lx SR : %08lx ", | 109 | printk("PC : %08lx SP : %08lx SR : %08lx ", |
109 | regs->pc, regs->regs[15], regs->sr); | 110 | regs->pc, regs->regs[15], regs->sr); |
110 | #ifdef CONFIG_MMU | 111 | #ifdef CONFIG_MMU |
@@ -129,15 +130,7 @@ void show_regs(struct pt_regs * regs) | |||
129 | printk("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n", | 130 | printk("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n", |
130 | regs->mach, regs->macl, regs->gbr, regs->pr); | 131 | regs->mach, regs->macl, regs->gbr, regs->pr); |
131 | 132 | ||
132 | /* | 133 | show_trace(NULL, (unsigned long *)regs->regs[15], regs); |
133 | * If we're in kernel mode, dump the stack too.. | ||
134 | */ | ||
135 | if (!user_mode(regs)) { | ||
136 | extern void show_task(unsigned long *sp); | ||
137 | unsigned long sp = regs->regs[15]; | ||
138 | |||
139 | show_task((unsigned long *)sp); | ||
140 | } | ||
141 | } | 134 | } |
142 | 135 | ||
143 | /* | 136 | /* |
@@ -290,6 +283,24 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | |||
290 | static void | 283 | static void |
291 | ubc_set_tracing(int asid, unsigned long pc) | 284 | ubc_set_tracing(int asid, unsigned long pc) |
292 | { | 285 | { |
286 | #if defined(CONFIG_CPU_SH4A) | ||
287 | unsigned long val; | ||
288 | |||
289 | val = (UBC_CBR_ID_INST | UBC_CBR_RW_READ | UBC_CBR_CE); | ||
290 | val |= (UBC_CBR_AIE | UBC_CBR_AIV_SET(asid)); | ||
291 | |||
292 | ctrl_outl(val, UBC_CBR0); | ||
293 | ctrl_outl(pc, UBC_CAR0); | ||
294 | ctrl_outl(0x0, UBC_CAMR0); | ||
295 | ctrl_outl(0x0, UBC_CBCR); | ||
296 | |||
297 | val = (UBC_CRR_RES | UBC_CRR_PCB | UBC_CRR_BIE); | ||
298 | ctrl_outl(val, UBC_CRR0); | ||
299 | |||
300 | /* Read UBC register that we writed last. For chekking UBC Register changed */ | ||
301 | val = ctrl_inl(UBC_CRR0); | ||
302 | |||
303 | #else /* CONFIG_CPU_SH4A */ | ||
293 | ctrl_outl(pc, UBC_BARA); | 304 | ctrl_outl(pc, UBC_BARA); |
294 | 305 | ||
295 | #ifdef CONFIG_MMU | 306 | #ifdef CONFIG_MMU |
@@ -307,6 +318,7 @@ ubc_set_tracing(int asid, unsigned long pc) | |||
307 | ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA); | 318 | ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA); |
308 | ctrl_outw(BRCR_PCBA, UBC_BRCR); | 319 | ctrl_outw(BRCR_PCBA, UBC_BRCR); |
309 | } | 320 | } |
321 | #endif /* CONFIG_CPU_SH4A */ | ||
310 | } | 322 | } |
311 | 323 | ||
312 | /* | 324 | /* |
@@ -359,8 +371,13 @@ struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *ne | |||
359 | #endif | 371 | #endif |
360 | ubc_set_tracing(asid, next->thread.ubc_pc); | 372 | ubc_set_tracing(asid, next->thread.ubc_pc); |
361 | } else { | 373 | } else { |
374 | #if defined(CONFIG_CPU_SH4A) | ||
375 | ctrl_outl(UBC_CBR_INIT, UBC_CBR0); | ||
376 | ctrl_outl(UBC_CRR_INIT, UBC_CRR0); | ||
377 | #else | ||
362 | ctrl_outw(0, UBC_BBRA); | 378 | ctrl_outw(0, UBC_BBRA); |
363 | ctrl_outw(0, UBC_BBRB); | 379 | ctrl_outw(0, UBC_BBRB); |
380 | #endif | ||
364 | } | 381 | } |
365 | 382 | ||
366 | return prev; | 383 | return prev; |
@@ -460,8 +477,13 @@ asmlinkage void break_point_trap(unsigned long r4, unsigned long r5, | |||
460 | struct pt_regs regs) | 477 | struct pt_regs regs) |
461 | { | 478 | { |
462 | /* Clear tracing. */ | 479 | /* Clear tracing. */ |
480 | #if defined(CONFIG_CPU_SH4A) | ||
481 | ctrl_outl(UBC_CBR_INIT, UBC_CBR0); | ||
482 | ctrl_outl(UBC_CRR_INIT, UBC_CRR0); | ||
483 | #else | ||
463 | ctrl_outw(0, UBC_BBRA); | 484 | ctrl_outw(0, UBC_BBRA); |
464 | ctrl_outw(0, UBC_BBRB); | 485 | ctrl_outw(0, UBC_BBRB); |
486 | #endif | ||
465 | current->thread.ubc_pc = 0; | 487 | current->thread.ubc_pc = 0; |
466 | ubc_usercnt -= 1; | 488 | ubc_usercnt -= 1; |
467 | 489 | ||