Skip to content
Snippets Groups Projects
Commit 1c424d26 authored by Michal Simek's avatar Michal Simek
Browse files

microblaze: Show return address from exception


Show also return address from exception which should
suggest where the problem is.

Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent cd8574c0
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@ void _hw_exception_handler (void)
/* loading excetpion state register ESR */
MFS (state, resr);
printf ("Hardware exception at 0x%x address\n", address);
R17(address);
printf("Return address from exception 0x%x\n", address);
switch (state & 0x1f) { /* mask on exception cause */
case 0x1:
puts ("Unaligned data access exception\n");
......
......@@ -43,6 +43,10 @@
#define R14(val) \
__asm__ __volatile__ ("addi %0, r14, 0":"=r" (val));
/* get return address from interrupt */
#define R17(val) \
__asm__ __volatile__ ("addi %0, r17, 0" : "=r" (val));
#define NOP __asm__ __volatile__ ("nop");
/* use machine status registe USE_MSR_REG */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment