Skip to content

Commit

Permalink
microblaze: Clear i/dcache for sw breakpoints
Browse files Browse the repository at this point in the history
There is necessary to flush dcache and invalidate
icache for address where breakpoint (brki r16, 0x18)
was. The reason is that for some cases icache line
still keeps brki instruction and it is not updated
by origin instruction maintains by gdbserver.

Signed-off-by: Michal Simek <monstr@monstr.eu>
  • Loading branch information
Michal Simek committed Jan 3, 2011
1 parent 27cbe8d commit 17b9314
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/microblaze/kernel/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <asm/current.h>
#include <asm/cacheflush.h>

#define MICROBLAZE_ILL_OPCODE_EXCEPTION 0x02
#define MICROBLAZE_IBUS_EXCEPTION 0x03
Expand Down Expand Up @@ -52,6 +53,8 @@ void die(const char *str, struct pt_regs *fp, long err)
void sw_exception(struct pt_regs *regs)
{
_exception(SIGTRAP, regs, TRAP_BRKPT, regs->r16);
flush_dcache_range(regs->r16, regs->r16 + 0x4);
flush_icache_range(regs->r16, regs->r16 + 0x4);
}

void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
Expand Down

0 comments on commit 17b9314

Please sign in to comment.