diff options
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/uio_machdep.c | 2 | ||||
-rw-r--r-- | sys/powerpc/include/cpu.h | 6 | ||||
-rw-r--r-- | sys/powerpc/include/kdb.h | 7 | ||||
-rw-r--r-- | sys/powerpc/include/md_var.h | 6 | ||||
-rw-r--r-- | sys/powerpc/powerpc/db_interface.c | 16 | ||||
-rw-r--r-- | sys/powerpc/powerpc/syncicache.c | 2 | ||||
-rw-r--r-- | sys/powerpc/powerpc/uio_machdep.c | 2 |
7 files changed, 22 insertions, 19 deletions
diff --git a/sys/powerpc/aim/uio_machdep.c b/sys/powerpc/aim/uio_machdep.c index a52f729..070ad98 100644 --- a/sys/powerpc/aim/uio_machdep.c +++ b/sys/powerpc/aim/uio_machdep.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include <vm/vm.h> #include <vm/vm_page.h> -#include <machine/cpu.h> +#include <machine/md_var.h> #include <machine/vmparam.h> /* diff --git a/sys/powerpc/include/cpu.h b/sys/powerpc/include/cpu.h index dc7ae3d..a8fea27 100644 --- a/sys/powerpc/include/cpu.h +++ b/sys/powerpc/include/cpu.h @@ -45,12 +45,6 @@ #define cpu_swapout(p) #define cpu_number() 0 -#if defined(_KERNEL) || defined(_STANDALONE) -#define CACHELINESIZE 32 -#endif - -extern void __syncicache(void *, int); - /* * CTL_MACHDEP definitions. */ diff --git a/sys/powerpc/include/kdb.h b/sys/powerpc/include/kdb.h index 2cfc063..2cb49a8 100644 --- a/sys/powerpc/include/kdb.h +++ b/sys/powerpc/include/kdb.h @@ -31,6 +31,7 @@ #include <machine/cpufunc.h> #include <machine/frame.h> +#include <machine/md_var.h> #include <machine/psl.h> static __inline void @@ -46,6 +47,12 @@ kdb_cpu_set_singlestep(void) } static __inline void +kdb_cpu_sync_icache(unsigned char *addr, size_t size) +{ + __syncicache(addr, size); +} + +static __inline void kdb_cpu_trap(int vector, int _) { } diff --git a/sys/powerpc/include/md_var.h b/sys/powerpc/include/md_var.h index fa868c1..7248e4b 100644 --- a/sys/powerpc/include/md_var.h +++ b/sys/powerpc/include/md_var.h @@ -50,6 +50,12 @@ struct reg; struct cam_sim; struct pcicfg; +#if defined(_KERNEL) || defined(_STANDALONE) +#define CACHELINESIZE 32 +#endif + +void __syncicache(void *, int); + void busdma_swi(void); int is_physical_memory(vm_offset_t addr); int mem_valid(vm_offset_t addr, int len); diff --git a/sys/powerpc/powerpc/db_interface.c b/sys/powerpc/powerpc/db_interface.c index a46ead6..3dae648 100644 --- a/sys/powerpc/powerpc/db_interface.c +++ b/sys/powerpc/powerpc/db_interface.c @@ -13,7 +13,7 @@ #include <sys/proc.h> #include <sys/smp.h> -#include <machine/cpu.h> +#include <machine/kdb.h> #include <machine/md_var.h> #include <vm/vm.h> @@ -58,23 +58,19 @@ db_write_bytes(vm_offset_t addr, size_t size, char *data) jmp_buf jb; void *prev_jb; char *dst; + size_t cnt; int ret; prev_jb = kdb_jmpbuf(jb); ret = setjmp(jb); if (ret == 0) { dst = (char *)addr; + cnt = size; - if (size == 4) - *((int *)dst) = *((int *)data); - else if (size == 2) - *((short *)dst) = *((short *)data); - else - while (size-- > 0) - *dst++ = *data++; + while (cnt-- > 0) + *dst++ = *data++; + kdb_cpu_sync_icache((void *)addr, size); } - __syncicache((void *)addr, size); - (void)kdb_jmpbuf(prev_jb); return (ret); } diff --git a/sys/powerpc/powerpc/syncicache.c b/sys/powerpc/powerpc/syncicache.c index 9a5b8c6..3d4f732 100644 --- a/sys/powerpc/powerpc/syncicache.c +++ b/sys/powerpc/powerpc/syncicache.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #endif #include <sys/sysctl.h> -#include <machine/cpu.h> +#include <machine/md_var.h> #if defined(_KERNEL) || defined(_STANDALONE) #ifndef CACHELINESIZE diff --git a/sys/powerpc/powerpc/uio_machdep.c b/sys/powerpc/powerpc/uio_machdep.c index a52f729..070ad98 100644 --- a/sys/powerpc/powerpc/uio_machdep.c +++ b/sys/powerpc/powerpc/uio_machdep.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include <vm/vm.h> #include <vm/vm_page.h> -#include <machine/cpu.h> +#include <machine/md_var.h> #include <machine/vmparam.h> /* |