summaryrefslogtreecommitdiff
path: root/sys/arch/luna88k/ddb/db_interface.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-09-30 21:48:58 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-09-30 21:48:58 +0000
commit7c3ee3ebb6da78ff2aefcb237aea70a1d0fc2f40 (patch)
tree8ff9e88b5f7080b6bad1f96b4103154d7b1bef66 /sys/arch/luna88k/ddb/db_interface.c
parent7f2ae2b10eb947643499a0bcecfd336db623f653 (diff)
Introduce sparc-like CPU_ISFOO macros, to short-circuit evaluations when
compiling for one flavour only. This makes code slightly smaller on all m88k-based platforms (my roughly 1KB), and saves more than meets the eye on luna88k, which is m88100-based.
Diffstat (limited to 'sys/arch/luna88k/ddb/db_interface.c')
-rw-r--r--sys/arch/luna88k/ddb/db_interface.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/arch/luna88k/ddb/db_interface.c b/sys/arch/luna88k/ddb/db_interface.c
index 1e1af156d84..7a301b19c78 100644
--- a/sys/arch/luna88k/ddb/db_interface.c
+++ b/sys/arch/luna88k/ddb/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.2 2004/06/19 18:29:45 miod Exp $ */
+/* $OpenBSD: db_interface.c,v 1.3 2004/09/30 21:48:53 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -239,7 +239,7 @@ m88k_db_print_frame(addr, have_addr, count, modif)
db_printf("R30-31: 0x%08x 0x%08x\n", R(30), R(31));
db_printf("%cxip: 0x%08x ",
- cputyp == CPU_88110 ? 'e' : 's', s->tf_sxip & ~3);
+ CPU_IS88110 ? 'e' : 's', s->tf_sxip & ~3);
db_find_xtrn_sym_and_offset((db_addr_t)IPMASK(s->tf_sxip),
&name, &offset);
if (name != NULL && (unsigned)offset <= db_maxoff)
@@ -248,7 +248,7 @@ m88k_db_print_frame(addr, have_addr, count, modif)
if (s->tf_snip != s->tf_sxip + 4) {
db_printf("%cnip: 0x%08x ",
- cputyp == CPU_88110 ? 'e' : 's', s->tf_snip);
+ CPU_IS88110 ? 'e' : 's', s->tf_snip);
db_find_xtrn_sym_and_offset((db_addr_t)IPMASK(s->tf_snip),
&name, &offset);
if (name != NULL && (unsigned)offset <= db_maxoff)
@@ -256,7 +256,8 @@ m88k_db_print_frame(addr, have_addr, count, modif)
db_printf("\n");
}
- if (cputyp != CPU_88110) {
+#ifdef M88100
+ if (CPU_IS88100) {
if (s->tf_sfip != s->tf_snip + 4) {
db_printf("sfip: 0x%08x ", s->tf_sfip);
db_find_xtrn_sym_and_offset((db_addr_t)IPMASK(s->tf_sfip),
@@ -265,7 +266,10 @@ m88k_db_print_frame(addr, have_addr, count, modif)
db_printf("%s+0x%08x", name, (unsigned)offset);
db_printf("\n");
}
- } else {
+ }
+#endif
+#ifdef M88110
+ if (CPU_IS88110) {
db_printf("fpsr: 0x%08x fpcr: 0x%08x fpecr: 0x%08x\n",
s->tf_fpsr, s->tf_fpcr, s->tf_fpecr);
db_printf("dsap 0x%08x duap 0x%08x dsr 0x%08x dlar 0x%08x dpar 0x%08x\n",
@@ -273,6 +277,7 @@ m88k_db_print_frame(addr, have_addr, count, modif)
db_printf("isap 0x%08x iuap 0x%08x isr 0x%08x ilar 0x%08x ipar 0x%08x\n",
s->tf_isap, s->tf_iuap, s->tf_isr, s->tf_ilar, s->tf_ipar);
}
+#endif
db_printf("epsr: 0x%08x current process: %p\n",
s->tf_epsr, curproc);
@@ -292,7 +297,7 @@ m88k_db_print_frame(addr, have_addr, count, modif)
}
#ifdef M88100
- if (cputyp != CPU_88110) {
+ if (CPU_IS88100) {
if (s->tf_vector == /*data*/3 || s->tf_dmt0 & DMT_VALID) {
db_printf("dmt,d,a0: 0x%08x 0x%08x 0x%08x ",
s->tf_dmt0, s->tf_dmd0, s->tf_dma0);
@@ -339,7 +344,7 @@ m88k_db_print_frame(addr, have_addr, count, modif)
db_printf("fpecr: 0x%08x fpsr: 0x%08x fpcr: 0x%08x\n",
s->tf_fpecr, s->tf_fpsr, s->tf_fpcr);
#ifdef M88100
- if (cputyp != CPU_88110) {
+ if (CPU_IS88100) {
db_printf("fcr1-4: 0x%08x 0x%08x 0x%08x 0x%08x\n",
s->tf_fphs1, s->tf_fpls1, s->tf_fphs2, s->tf_fpls2);
db_printf("fcr5-8: 0x%08x 0x%08x 0x%08x 0x%08x\n",
@@ -470,9 +475,9 @@ ddb_break_trap(type, eframe)
* at the breakpoint address. mc88110's exip reg
* already has the address of the exception instruction.
*/
- if (cputyp != CPU_88110) {
- eframe->sfip = eframe->snip;
- eframe->snip = eframe->sxip;
+ if (CPU_IS88100) {
+ eframe->sfip = eframe->snip;
+ eframe->snip = eframe->sxip;
}
}