diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-08 15:01:16 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-08 15:01:16 +0000 |
commit | 9d0b43a105f2da209266b7273188850aef414305 (patch) | |
tree | da2942a168bfe74d7a108ecb6de4b009b4b96c8c | |
parent | ddfbbdd49f56630d55866519a45bc2fd094f0fbf (diff) |
Substitute boolean_t/TRUE/FALSE/db_addr_t by int/1/0/vaddr_t.
Tested by miod@, ok aoyama@
-rw-r--r-- | sys/arch/m88k/m88k/db_disasm.c | 6 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/db_interface.c | 20 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/db_sstep.c | 26 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/db_trace.c | 8 |
4 files changed, 30 insertions, 30 deletions
diff --git a/sys/arch/m88k/m88k/db_disasm.c b/sys/arch/m88k/m88k/db_disasm.c index b9806c8e1f1..30a4c06f678 100644 --- a/sys/arch/m88k/m88k/db_disasm.c +++ b/sys/arch/m88k/m88k/db_disasm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_disasm.c,v 1.9 2007/10/27 20:31:19 miod Exp $ */ +/* $OpenBSD: db_disasm.c,v 1.10 2019/11/08 15:01:15 mpi Exp $ */ /* * Copyright (c) 2006, Miodrag Vallat * @@ -1068,8 +1068,8 @@ m88k_print_instruction(int cpu, u_int iadr, u_int32_t inst) } } -db_addr_t -db_disasm(db_addr_t loc, boolean_t altfmt) +vaddr_t +db_disasm(vaddr_t loc, int altfmt) { int cpu; diff --git a/sys/arch/m88k/m88k/db_interface.c b/sys/arch/m88k/m88k/db_interface.c index 2931e23090b..c312c36d3a1 100644 --- a/sys/arch/m88k/m88k/db_interface.c +++ b/sys/arch/m88k/m88k/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.23 2019/07/20 23:03:55 mpi Exp $ */ +/* $OpenBSD: db_interface.c,v 1.24 2019/11/08 15:01:15 mpi Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -235,7 +235,7 @@ m88k_db_print_frame(addr, have_addr, count, modif) db_printf("%cxip: 0x%08lx ", CPU_IS88110 ? 'e' : 's', s->tf_sxip & XIP_ADDR); - db_find_xtrn_sym_and_offset((db_addr_t)IPMASK(s->tf_sxip), + db_find_xtrn_sym_and_offset((vaddr_t)IPMASK(s->tf_sxip), &name, &offset); if (name != NULL && (u_int)offset <= db_maxoff) db_printf("%s+0x%08x", name, (u_int)offset); @@ -244,7 +244,7 @@ m88k_db_print_frame(addr, have_addr, count, modif) if (s->tf_snip != s->tf_sxip + 4) { db_printf("%cnip: 0x%08lx ", CPU_IS88110 ? 'e' : 's', s->tf_snip); - db_find_xtrn_sym_and_offset((db_addr_t)IPMASK(s->tf_snip), + db_find_xtrn_sym_and_offset((vaddr_t)IPMASK(s->tf_snip), &name, &offset); if (name != NULL && (u_int)offset <= db_maxoff) db_printf("%s+0x%08x", name, (u_int)offset); @@ -255,7 +255,7 @@ m88k_db_print_frame(addr, have_addr, count, modif) if (CPU_IS88100) { if (s->tf_sfip != s->tf_snip + 4) { db_printf("sfip: 0x%08lx ", s->tf_sfip); - db_find_xtrn_sym_and_offset((db_addr_t)IPMASK(s->tf_sfip), + db_find_xtrn_sym_and_offset((vaddr_t)IPMASK(s->tf_sfip), &name, &offset); if (name != NULL && (u_int)offset <= db_maxoff) db_printf("%s+0x%08x", name, (u_int)offset); @@ -296,7 +296,7 @@ m88k_db_print_frame(addr, have_addr, count, modif) if (s->tf_vector == /*data*/3 || s->tf_dmt0 & DMT_VALID) { db_printf("dmt,d,a0: 0x%08lx 0x%08lx 0x%08lx ", s->tf_dmt0, s->tf_dmd0, s->tf_dma0); - db_find_xtrn_sym_and_offset((db_addr_t)s->tf_dma0, + db_find_xtrn_sym_and_offset((vaddr_t)s->tf_dma0, &name, &offset); if (name != NULL && (u_int)offset <= db_maxoff) db_printf("%s+0x%08x", name, (u_int)offset); @@ -309,7 +309,7 @@ m88k_db_print_frame(addr, have_addr, count, modif) if ((s->tf_dmt1 & DMT_VALID) && (!suppress1)) { db_printf("dmt,d,a1: 0x%08lx 0x%08lx 0x%08lx ", s->tf_dmt1, s->tf_dmd1, s->tf_dma1); - db_find_xtrn_sym_and_offset((db_addr_t)s->tf_dma1, + db_find_xtrn_sym_and_offset((vaddr_t)s->tf_dma1, &name, &offset); if (name != NULL && (u_int)offset <= db_maxoff) db_printf("%s+0x%08x", name, @@ -322,7 +322,7 @@ m88k_db_print_frame(addr, have_addr, count, modif) if ((s->tf_dmt2 & DMT_VALID) && (!suppress2)) { db_printf("dmt,d,a2: 0x%08lx 0x%08lx 0x%08lx ", s->tf_dmt2, s->tf_dmd2, s->tf_dma2); - db_find_xtrn_sym_and_offset((db_addr_t)s->tf_dma2, + db_find_xtrn_sym_and_offset((vaddr_t)s->tf_dma2, &name, &offset); if (name != 0 && (u_int)offset <= db_maxoff) @@ -487,7 +487,7 @@ ddb_entry_trap(level, eframe) * Read bytes from kernel address space for debugger. */ void -db_read_bytes(db_addr_t addr, size_t size, char *data) +db_read_bytes(vaddr_t addr, size_t size, char *data) { char *src; @@ -502,7 +502,7 @@ db_read_bytes(db_addr_t addr, size_t size, char *data) * Write bytes to kernel address space for debugger. */ void -db_write_bytes(db_addr_t addr, size_t size, char *data) +db_write_bytes(vaddr_t addr, size_t size, char *data) { extern pt_entry_t *pmap_pte(pmap_t, vaddr_t); char *dst = (char *)addr; @@ -557,7 +557,7 @@ m88k_db_where(addr, have_addr, count, modif) { char *name; db_expr_t offset; - db_addr_t l; + vaddr_t l; l = PC_REGS(&ddb_regs); /* clear low bits */ diff --git a/sys/arch/m88k/m88k/db_sstep.c b/sys/arch/m88k/m88k/db_sstep.c index 7c02d3d2f8c..366bff04fb6 100644 --- a/sys/arch/m88k/m88k/db_sstep.c +++ b/sys/arch/m88k/m88k/db_sstep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_sstep.c,v 1.7 2010/11/27 19:57:23 miod Exp $ */ +/* $OpenBSD: db_sstep.c,v 1.8 2019/11/08 15:01:15 mpi Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -51,17 +51,17 @@ #ifdef M88100 -boolean_t inst_branch_or_call(u_int); -db_addr_t branch_taken(u_int, db_addr_t, db_regs_t *); +int inst_branch_or_call(u_int); +vaddr_t branch_taken(u_int, vaddr_t, db_regs_t *); db_breakpoint_t db_not_taken_bkpt = 0; db_breakpoint_t db_taken_bkpt = 0; /* - * Returns TRUE is the instruction a branch, jump or call instruction + * Returns `1' is the instruction a branch, jump or call instruction * (br, bb0, bb1, bcnd, jmp, bsr, jsr) */ -boolean_t +int inst_branch_or_call(u_int ins) { /* check high five bits */ @@ -71,13 +71,13 @@ inst_branch_or_call(u_int ins) case 0x1a: /* bb0 */ case 0x1b: /* bb1 */ case 0x1d: /* bcnd */ - return (TRUE); + return 1; case 0x1e: /* could be jmp or jsr */ if ((ins & 0xfffff3e0) == 0xf400c000) - return (TRUE); + return 1; } - return (FALSE); + return 0; } /* @@ -87,14 +87,14 @@ inst_branch_or_call(u_int ins) * Branch taken is supposed to return the address to which the instruction * would jump if the branch is taken. */ -db_addr_t -branch_taken(u_int inst, db_addr_t pc, db_regs_t *regs) +vaddr_t +branch_taken(u_int inst, vaddr_t pc, db_regs_t *regs) { u_int regno; /* * Quick check of the instruction. Note that we know we are only - * invoked if inst_branch_or_call() returns TRUE, so we do not + * invoked if inst_branch_or_call() returns `1', so we do not * need to repeat the jmp and jsr stricter checks here. */ switch (inst >> (32 - 5)) { @@ -141,8 +141,8 @@ db_set_single_step(db_regs_t *regs) /* * ... while the 88100 will use two breakpoints. */ - db_addr_t pc = PC_REGS(regs); - db_addr_t brpc; + vaddr_t pc = PC_REGS(regs); + vaddr_t brpc; u_int inst; /* diff --git a/sys/arch/m88k/m88k/db_trace.c b/sys/arch/m88k/m88k/db_trace.c index 2cadcab6136..10a719d7962 100644 --- a/sys/arch/m88k/m88k/db_trace.c +++ b/sys/arch/m88k/m88k/db_trace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_trace.c,v 1.17 2017/05/30 15:39:04 mpi Exp $ */ +/* $OpenBSD: db_trace.c,v 1.18 2019/11/08 15:01:15 mpi Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -456,13 +456,13 @@ static int next_address_likely_wrong = 0; * stack pointer can be adjusted. */ static vaddr_t -stack_decode(db_addr_t addr, vaddr_t *stack, int (*pr)(const char *, ...)) +stack_decode(vaddr_t addr, vaddr_t *stack, int (*pr)(const char *, ...)) { Elf_Sym *proc; db_expr_t offset_from_proc; uint instructions_to_search; - db_addr_t check_addr; - db_addr_t function_addr; /* start of function */ + vaddr_t check_addr; + vaddr_t function_addr; /* start of function */ uint32_t r31; uint32_t inst; vaddr_t ret_addr; /* address to which we return */ |