diff options
author | marcel <marcel@FreeBSD.org> | 2007-06-09 21:55:17 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2007-06-09 21:55:17 +0000 |
commit | 75588c5a15dad18e2f69aee6a984065d314bffb7 (patch) | |
tree | a56b45624c5012a67b32e122f42c41c6b2e7d8a4 /sys/gdb | |
parent | 12d804e413f2c44d9e10f25ee1b546f2b48c598b (diff) | |
download | FreeBSD-src-75588c5a15dad18e2f69aee6a984065d314bffb7.zip FreeBSD-src-75588c5a15dad18e2f69aee6a984065d314bffb7.tar.gz |
Add kdb_cpu_sync_icache(), intended to synchronize instruction
caches with data caches after writing to memory. This typically
is required to make breakpoints work on ia64 and powerpc. For
those architectures the function is implemented.
Diffstat (limited to 'sys/gdb')
-rw-r--r-- | sys/gdb/gdb_packet.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/gdb/gdb_packet.c b/sys/gdb/gdb_packet.c index 753c9b7..d3e5a0a 100644 --- a/sys/gdb/gdb_packet.c +++ b/sys/gdb/gdb_packet.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kdb.h> #include <machine/gdb_machdep.h> +#include <machine/kdb.h> #include <gdb/gdb.h> #include <gdb/gdb_int.h> @@ -129,8 +130,10 @@ gdb_rx_equal(const char *str) int gdb_rx_mem(unsigned char *addr, size_t size) { + unsigned char *p; void *prev; jmp_buf jb; + size_t cnt; int ret; unsigned char c; @@ -140,13 +143,16 @@ gdb_rx_mem(unsigned char *addr, size_t size) prev = kdb_jmpbuf(jb); ret = setjmp(jb); if (ret == 0) { - while (size-- > 0) { + p = addr; + cnt = size; + while (cnt-- > 0) { c = (C2N(gdb_rxp[0]) << 4) & 0xf0; c |= C2N(gdb_rxp[1]) & 0x0f; - *addr++ = c; + *p++ = c; gdb_rxsz -= 2; gdb_rxp += 2; } + kdb_cpu_sync_icache(addr, size); } (void)kdb_jmpbuf(prev); return ((ret == 0) ? 1 : 0); |