Skip to content

Commit

Permalink
sh: Make kgdb i-cache flushing less inept.
Browse files Browse the repository at this point in the history
kgdb had its own ranged I-cache flushing routine that attempted to
duplicate the flush_icache_range() functionality, but managed to do
an explicit D-cache writeback & invalidate twice on SH-4. This is
a no-op for SH-3, and the flush_icache_range() semantics already do
what kgdb was feebly attempting to do already, so just move over to
that and kill off the wrapper.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Oct 3, 2007
1 parent a90f354 commit 01bd5e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
8 changes: 4 additions & 4 deletions arch/sh/kernel/kgdb_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static short *get_step_address(void)
else
addr = trap_registers.pc + 2;

kgdb_flush_icache_range(addr, addr + 2);
flush_icache_range(addr, addr + 2);
return (short *) addr;
}

Expand All @@ -632,7 +632,7 @@ static void do_single_step(void)
*addr = STEP_OPCODE;

/* Flush and return */
kgdb_flush_icache_range((long) addr, (long) addr + 2);
flush_icache_range((long) addr, (long) addr + 2);
}

/* Undo a single step */
Expand All @@ -642,7 +642,7 @@ static void undo_single_step(void)
/* Use stepped_address in case we stopped elsewhere */
if (stepped_opcode != 0) {
*(short*)stepped_address = stepped_opcode;
kgdb_flush_icache_range(stepped_address, stepped_address + 2);
flush_icache_range(stepped_address, stepped_address + 2);
}
stepped_opcode = 0;
}
Expand Down Expand Up @@ -728,7 +728,7 @@ static void write_mem_msg(int binary)
ebin_to_mem(ptr, (char*)addr, length);
else
hex_to_mem(ptr, (char*)addr, length);
kgdb_flush_icache_range(addr, addr + length);
flush_icache_range(addr, addr + length);
ptr = 0;
send_ok_msg();
}
Expand Down
12 changes: 0 additions & 12 deletions include/asm-sh/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#define __KGDB_H

#include <asm/ptrace.h>
#include <asm/cacheflush.h>

/* Same as pt_regs but has vbr in place of syscall_nr */
struct kgdb_regs {
Expand Down Expand Up @@ -67,17 +66,6 @@ extern int setjmp(jmp_buf __jmpb);
/* Forced breakpoint */
#define breakpoint() __asm__ __volatile__("trapa #0x3c")

/* KGDB should be able to flush all kernel text space */
#if defined(CONFIG_CPU_SH4)
#define kgdb_flush_icache_range(start, end) \
{ \
__flush_purge_region((void*)(start), (int)(end) - (int)(start));\
flush_icache_range((start), (end)); \
}
#else
#define kgdb_flush_icache_range(start, end) do { } while (0)
#endif

/* Taken from sh-stub.c of GDB 4.18 */
static const char hexchars[] = "0123456789abcdef";

Expand Down

0 comments on commit 01bd5e9

Please sign in to comment.