diff options
author | Robin Getz <robin.getz@analog.com> | 2010-03-16 10:40:17 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-05-22 14:18:56 -0400 |
commit | 6ce3e9c2a2cfb8849dd471349fe5e6bc37c0f13f (patch) | |
tree | 9575e410b1fd9bbd3fab680ea4f5c3d7d8e832e0 /arch/blackfin/kernel/traps.c | |
parent | 2620c83668660d950cb4295aeb7147f1e599c638 (diff) |
Blackfin: add support for the DBGA (debug assert) pseudo insn
A few pseudo debug insns exist to make testing of simulators easier.
Since these don't actually exist in the hardware, we have to have the
exception handler take care of emulating these. This allows sim test
cases to be executed unmodified under Linux and thus simplify debugging
greatly.
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel/traps.c')
-rw-r--r-- | arch/blackfin/kernel/traps.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index fffcf8a516bf..9369836365bb 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
17 | #include <asm/trace.h> | 17 | #include <asm/trace.h> |
18 | #include <asm/fixed_code.h> | 18 | #include <asm/fixed_code.h> |
19 | #include <asm/pseudo_instructions.h> | ||
19 | 20 | ||
20 | #ifdef CONFIG_KGDB | 21 | #ifdef CONFIG_KGDB |
21 | # include <linux/kgdb.h> | 22 | # include <linux/kgdb.h> |
@@ -68,6 +69,9 @@ asmlinkage notrace void trap_c(struct pt_regs *fp) | |||
68 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON | 69 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON |
69 | int j; | 70 | int j; |
70 | #endif | 71 | #endif |
72 | #ifdef CONFIG_BFIN_PSEUDODBG_INSNS | ||
73 | int opcode; | ||
74 | #endif | ||
71 | unsigned int cpu = raw_smp_processor_id(); | 75 | unsigned int cpu = raw_smp_processor_id(); |
72 | const char *strerror = NULL; | 76 | const char *strerror = NULL; |
73 | int sig = 0; | 77 | int sig = 0; |
@@ -200,6 +204,17 @@ asmlinkage notrace void trap_c(struct pt_regs *fp) | |||
200 | } | 204 | } |
201 | } | 205 | } |
202 | #endif | 206 | #endif |
207 | #ifdef CONFIG_BFIN_PSEUDODBG_INSNS | ||
208 | /* | ||
209 | * Support for the fake instructions, if the instruction fails, | ||
210 | * then just execute a illegal opcode failure (like normal). | ||
211 | * Don't support these instructions inside the kernel | ||
212 | */ | ||
213 | if (!kernel_mode_regs(fp) && get_instruction(&opcode, (unsigned short *)fp->pc)) { | ||
214 | if (execute_pseudodbg_assert(fp, opcode)) | ||
215 | goto traps_done; | ||
216 | } | ||
217 | #endif | ||
203 | info.si_code = ILL_ILLOPC; | 218 | info.si_code = ILL_ILLOPC; |
204 | sig = SIGILL; | 219 | sig = SIGILL; |
205 | strerror = KERN_NOTICE EXC_0x21(KERN_NOTICE); | 220 | strerror = KERN_NOTICE EXC_0x21(KERN_NOTICE); |