summaryrefslogtreecommitdiff
path: root/sys/arch/mips64/include
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-03-21 23:05:42 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-03-21 23:05:42 +0000
commitb941904a5b0de9a7d65cfc03df38b3fac84e937d (patch)
treee01fe863cdbb8cd3f2e1f4ca1b06df0c8b270110 /sys/arch/mips64/include
parent8b94d80adb28708667f9499981981bc733a9bdbf (diff)
Rename db_inst_type() into classify_insn() and make that function available
outside of ddb. It will be used by regular kernel code shortly.
Diffstat (limited to 'sys/arch/mips64/include')
-rw-r--r--sys/arch/mips64/include/cpu.h7
-rw-r--r--sys/arch/mips64/include/db_machdep.h12
2 files changed, 10 insertions, 9 deletions
diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h
index 138675e4528..dadb80c45e6 100644
--- a/sys/arch/mips64/include/cpu.h
+++ b/sys/arch/mips64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.96 2014/03/09 10:12:17 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.97 2014/03/21 23:05:41 miod Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -428,6 +428,11 @@ int guarded_write_4(paddr_t, uint32_t);
void MipsFPTrap(struct trap_frame *);
register_t MipsEmulateBranch(struct trap_frame *, vaddr_t, uint32_t, uint32_t);
+int classify_insn(uint32_t);
+#define INSNCLASS_NEUTRAL 0
+#define INSNCLASS_CALL 1
+#define INSNCLASS_BRANCH 2
+
/*
* Low level access routines to CPU registers
*/
diff --git a/sys/arch/mips64/include/db_machdep.h b/sys/arch/mips64/include/db_machdep.h
index 3f235c55fd5..b707ac376fe 100644
--- a/sys/arch/mips64/include/db_machdep.h
+++ b/sys/arch/mips64/include/db_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.h,v 1.14 2014/03/16 20:31:46 guenther Exp $ */
+/* $OpenBSD: db_machdep.h,v 1.15 2014/03/21 23:05:41 miod Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
@@ -58,15 +58,11 @@ db_addr_t next_instr_address(db_addr_t, boolean_t);
/*
* Test of instructions to see class.
*/
-#define IT_CALL 0x01
-#define IT_BRANCH 0x02
-
-#define inst_branch(i) (db_inst_type(i) == IT_BRANCH)
+#define inst_branch(i) (classify_insn(i) == INSNCLASS_BRANCH)
#define inst_trap_return(i) ((i) & 0)
-#define inst_call(i) (db_inst_type(i) == IT_CALL)
-#define inst_return(i) ((i) == 0x03e00008)
+#define inst_call(i) (classify_insn(i) == INSNCLASS_CALL)
+#define inst_return(i) ((i) == 0x03e00008)
-int db_inst_type(int);
void db_machine_init(void);
int db_enter_ddb(void);