[PATCH 60/62] Blackfin: export the last exception cause via debugfs

From: Mike Frysinger
Date: Fri Jun 05 2009 - 04:26:24 EST


From: Robin Getz <robin.getz@xxxxxxxxxx>

We have some test code that runs in userspace that exercises the exception
handling of the Blackfin pretty thoroughly. Part of the validation process
is checking the exact exception triggered, so export the last one seen to
userspace via debugfs when debugging is enabled for the test code to check.

Signed-off-by: Robin Getz <robin.getz@xxxxxxxxxx>
Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
arch/blackfin/kernel/traps.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 331027a..5547795 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -70,6 +70,10 @@
({ if (0) printk(fmt, ##arg); 0; })
#endif

+#ifdef CONFIG_DEBUG_MMRS
+u32 last_seqstat;
+#endif
+
/* Initiate the event table handler */
void __init trap_init(void)
{
@@ -247,6 +251,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;

trace_buffer_save(j);
+#ifdef CONFIG_DEBUG_MMRS
+ last_seqstat = (u32)fp->seqstat;
+#endif

/* Important - be very careful dereferncing pointers - will lead to
* double faults if the stack has become corrupt
--
1.6.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/