2 /* $NetBSD: db_interface.c,v 1.20 2002/05/13 20:30:09 matt Exp $ */
3 /* $OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $ */
16 #include <machine/kdb.h>
17 #include <machine/md_var.h>
23 #include <ddb/db_sym.h>
24 #include <ddb/db_command.h>
25 #include <ddb/db_access.h>
26 #include <ddb/db_output.h>
28 #include <dev/ofw/openfirm.h>
31 db_read_bytes(vm_offset_t addr, size_t size, char *data)
38 prev_jb = kdb_jmpbuf(jb);
44 *((int *)data) = *((int *)src);
46 *((short *)data) = *((short *)src);
51 (void)kdb_jmpbuf(prev_jb);
56 db_write_bytes(vm_offset_t addr, size_t size, char *data)
64 prev_jb = kdb_jmpbuf(jb);
70 if (size == 4 && (addr & 3) == 0 && ((uintptr_t)data & 3) == 0)
71 *((int*)dst) = *((int*)data);
73 if (size == 2 && (addr & 1) == 0 && ((uintptr_t)data & 1) == 0)
74 *((short*)dst) = *((short*)data);
78 kdb_cpu_sync_icache((void *)addr, size);
80 (void)kdb_jmpbuf(prev_jb);
85 db_show_mdpcpu(struct pcpu *pc)
88 db_printf("PPC: hwref = %#zx\n", pc->pc_hwref);
89 db_printf("PPC: ipimask = %#x\n", pc->pc_ipimask);
90 db_printf("PPC: pir = %#x\n", pc->pc_pir);