summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-11-07 14:44:54 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-11-07 14:44:54 +0000
commit392203bfde253fa050437ddaa8ee3b1318f548f8 (patch)
tree7025a8dd1e49169e376e12822c39e8182ba29451 /sys/arch/amd64
parent042875a50fdec4ba9787feb4ef9e130b4aa00d0b (diff)
Convert db_addr_t -> vaddr_t but leave the typedef for now.
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/db_disasm.c34
-rw-r--r--sys/arch/amd64/amd64/db_trace.c30
-rw-r--r--sys/arch/amd64/include/db_machdep.h4
3 files changed, 34 insertions, 34 deletions
diff --git a/sys/arch/amd64/amd64/db_disasm.c b/sys/arch/amd64/amd64/db_disasm.c
index d5318475c9f..9764510fd33 100644
--- a/sys/arch/amd64/amd64/db_disasm.c
+++ b/sys/arch/amd64/amd64/db_disasm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_disasm.c,v 1.19 2019/11/06 07:34:35 mpi Exp $ */
+/* $OpenBSD: db_disasm.c,v 1.20 2019/11/07 14:44:52 mpi Exp $ */
/* $NetBSD: db_disasm.c,v 1.11 1996/05/03 19:41:58 christos Exp $ */
/*
@@ -891,16 +891,16 @@ int db_lengths[] = {
} while (0)
-db_addr_t db_read_address(db_addr_t, int, int, int, struct i_addr *);
+vaddr_t db_read_address(vaddr_t, int, int, int, struct i_addr *);
void db_print_address(char *, int, struct i_addr *);
-db_addr_t db_disasm_esc(db_addr_t, int, int, int, int, char *);
-db_addr_t db_disasm_3dnow(db_addr_t, int, int, int, char *);
+vaddr_t db_disasm_esc(vaddr_t, int, int, int, int, char *);
+vaddr_t db_disasm_3dnow(vaddr_t, int, int, int, char *);
/*
* Read address at location and return updated location.
*/
-db_addr_t
-db_read_address(db_addr_t loc, int short_addr, int regmodrm, int rex,
+vaddr_t
+db_read_address(vaddr_t loc, int short_addr, int regmodrm, int rex,
struct i_addr *addrp)
{
int mod, rm, sib, index, disp, size;
@@ -961,7 +961,7 @@ db_print_address(char *seg, int size, struct i_addr *addrp)
if (seg)
db_printf("%s:", seg);
- db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY, db_printf);
+ db_printsym((vaddr_t)addrp->disp, DB_STGY_ANY, db_printf);
if (addrp->base != 0 || addrp->index != 0) {
db_printf("(");
if (addrp->base)
@@ -975,8 +975,8 @@ db_print_address(char *seg, int size, struct i_addr *addrp)
/*
* Disassemble 3DNow! instruction and return updated location.
*/
-db_addr_t
-db_disasm_3dnow(db_addr_t loc, int short_addr, int size, int rex, char *seg)
+vaddr_t
+db_disasm_3dnow(vaddr_t loc, int short_addr, int size, int rex, char *seg)
{
int regmodrm, sib, displacement, opcode;
@@ -995,8 +995,8 @@ db_disasm_3dnow(db_addr_t loc, int short_addr, int size, int rex, char *seg)
* Disassemble floating-point ("escape") instruction
* and return updated location.
*/
-db_addr_t
-db_disasm_esc(db_addr_t loc, int inst, int short_addr, int size, int rex,
+vaddr_t
+db_disasm_esc(vaddr_t loc, int inst, int short_addr, int size, int rex,
char *seg)
{
int regmodrm;
@@ -1087,8 +1087,8 @@ db_disasm_esc(db_addr_t loc, int inst, int short_addr, int size, int rex,
* (optional) alternate format. Return address of start of
* next instruction.
*/
-db_addr_t
-db_disasm(db_addr_t loc, int altfmt)
+vaddr_t
+db_disasm(vaddr_t loc, int altfmt)
{
int inst;
int size;
@@ -1109,7 +1109,7 @@ db_disasm(db_addr_t loc, int altfmt)
int segovr_grp;
int repe, repne;
struct i_addr address;
- db_addr_t loc_orig = loc;
+ vaddr_t loc_orig = loc;
char tmpfmt[28];
get_value_inc(inst, loc, 1, FALSE);
@@ -1407,7 +1407,7 @@ db_disasm(db_addr_t loc, int altfmt)
db_printf("%s:%s", seg, db_format(tmpfmt,
sizeof tmpfmt, displ, DB_FORMAT_R, 1, 0));
else
- db_printsym((db_addr_t)displ, DB_STGY_ANY,
+ db_printsym((vaddr_t)displ, DB_STGY_ANY,
db_printf);
break;
case Db: //XXX
@@ -1415,7 +1415,7 @@ db_disasm(db_addr_t loc, int altfmt)
displ += loc;
if (size == WORD)
displ &= 0xFFFF;
- db_printsym((db_addr_t)displ, DB_STGY_XTRN, db_printf);
+ db_printsym((vaddr_t)displ, DB_STGY_XTRN, db_printf);
break;
case Dl: //XXX
len = db_lengths[size];
@@ -1423,7 +1423,7 @@ db_disasm(db_addr_t loc, int altfmt)
displ += loc;
if (size == WORD)
displ &= 0xFFFF;
- db_printsym((db_addr_t)displ, DB_STGY_XTRN, db_printf);
+ db_printsym((vaddr_t)displ, DB_STGY_XTRN, db_printf);
break;
case o1: //XXX
db_printf("$1");
diff --git a/sys/arch/amd64/amd64/db_trace.c b/sys/arch/amd64/amd64/db_trace.c
index c02ca2fef07..da35207c904 100644
--- a/sys/arch/amd64/amd64/db_trace.c
+++ b/sys/arch/amd64/amd64/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.45 2019/11/06 07:34:35 mpi Exp $ */
+/* $OpenBSD: db_trace.c,v 1.46 2019/11/07 14:44:52 mpi Exp $ */
/* $NetBSD: db_trace.c,v 1.1 2003/04/26 18:39:27 fvdl Exp $ */
/*
@@ -89,7 +89,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
{
struct callframe *frame, *lastframe;
unsigned long *argp, *arg0;
- db_addr_t callpc;
+ vaddr_t callpc;
unsigned int cr4save = CR4_SMEP|CR4_SMAP;
int kernel_only = 1;
int trace_proc = 0;
@@ -121,16 +121,16 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
if (!have_addr) {
frame = (struct callframe *)ddb_regs.tf_rbp;
- callpc = (db_addr_t)ddb_regs.tf_rip;
+ callpc = (vaddr_t)ddb_regs.tf_rip;
} else if (trace_proc) {
frame = (struct callframe *)p->p_addr->u_pcb.pcb_rbp;
- callpc = (db_addr_t)
- db_get_value((db_addr_t)&frame->f_retaddr, 8, FALSE);
+ callpc = (vaddr_t)
+ db_get_value((vaddr_t)&frame->f_retaddr, 8, FALSE);
frame = (struct callframe *)frame->f_frame;
} else {
frame = (struct callframe *)addr;
- callpc = (db_addr_t)
- db_get_value((db_addr_t)&frame->f_retaddr, 8, FALSE);
+ callpc = (vaddr_t)
+ db_get_value((vaddr_t)&frame->f_retaddr, 8, FALSE);
frame = (struct callframe *)frame->f_frame;
}
@@ -187,7 +187,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
argp = (unsigned long *)frame;
for (i = narg; i > 0; i--) {
argp--;
- (*pr)("%lx", db_get_value((db_addr_t)argp,
+ (*pr)("%lx", db_get_value((vaddr_t)argp,
sizeof(*argp), FALSE));
if (--narg != 0)
(*pr)(",");
@@ -197,7 +197,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
}
for (argp = arg0; narg > 0; ) {
- (*pr)("%lx", db_get_value((db_addr_t)argp,
+ (*pr)("%lx", db_get_value((vaddr_t)argp,
sizeof(*argp), FALSE));
argp++;
if (--narg != 0)
@@ -210,17 +210,17 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
if (lastframe == 0 && offset == 0 && !have_addr) {
/* Frame really belongs to next callpc */
lastframe = (struct callframe *)(ddb_regs.tf_rsp-8);
- callpc = (db_addr_t)
- db_get_value((db_addr_t)&lastframe->f_retaddr,
+ callpc = (vaddr_t)
+ db_get_value((vaddr_t)&lastframe->f_retaddr,
8, FALSE);
continue;
}
lastframe = frame;
- callpc = (db_addr_t)db_get_value(
- (db_addr_t)&frame->f_retaddr, 8, FALSE);
+ callpc = (vaddr_t)db_get_value(
+ (vaddr_t)&frame->f_retaddr, 8, FALSE);
frame = (struct callframe *)db_get_value(
- (db_addr_t)&frame->f_frame, 8, FALSE);
+ (vaddr_t)&frame->f_frame, 8, FALSE);
if (frame == 0) {
/* end of chain */
@@ -281,7 +281,7 @@ db_get_pc(struct trapframe *tf)
{
struct callframe *cf = (struct callframe *)(tf->tf_rsp - sizeof(long));
- return db_get_value((db_addr_t)&cf->f_retaddr, sizeof(long), 0);
+ return db_get_value((vaddr_t)&cf->f_retaddr, sizeof(long), 0);
}
vaddr_t
diff --git a/sys/arch/amd64/include/db_machdep.h b/sys/arch/amd64/include/db_machdep.h
index 72c7334de1d..48f119a74c8 100644
--- a/sys/arch/amd64/include/db_machdep.h
+++ b/sys/arch/amd64/include/db_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.h,v 1.17 2019/03/23 05:47:22 visa Exp $ */
+/* $OpenBSD: db_machdep.h,v 1.18 2019/11/07 14:44:52 mpi Exp $ */
/* $NetBSD: db_machdep.h,v 1.2 2003/04/29 17:06:04 scw Exp $ */
/*
@@ -46,7 +46,7 @@ typedef struct trapframe db_regs_t;
extern db_regs_t ddb_regs; /* register state */
-#define PC_REGS(regs) ((db_addr_t)(regs)->tf_rip)
+#define PC_REGS(regs) ((vaddr_t)(regs)->tf_rip)
#define SET_PC_REGS(regs, value) (regs)->tf_rip = (int64_t)(value)
#define BKPT_ADDR(addr) (addr) /* breakpoint address */