diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-09-30 21:48:58 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-09-30 21:48:58 +0000 |
commit | 7c3ee3ebb6da78ff2aefcb237aea70a1d0fc2f40 (patch) | |
tree | 8ff9e88b5f7080b6bad1f96b4103154d7b1bef66 /sys | |
parent | 7f2ae2b10eb947643499a0bcecfd336db623f653 (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')
-rw-r--r-- | sys/arch/luna88k/ddb/db_interface.c | 25 | ||||
-rw-r--r-- | sys/arch/m88k/include/db_machdep.h | 4 | ||||
-rw-r--r-- | sys/arch/m88k/include/param.h | 15 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/db_disasm.c | 10 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/db_sstep.c | 19 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/db_trace.c | 24 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/m88k_machdep.c | 31 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/pmap.c | 6 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/sig_machdep.c | 11 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 21 | ||||
-rw-r--r-- | sys/arch/mvme88k/ddb/db_interface.c | 25 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore_c_routines.c | 14 |
12 files changed, 125 insertions, 80 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; } } diff --git a/sys/arch/m88k/include/db_machdep.h b/sys/arch/m88k/include/db_machdep.h index fb74007008c..ee29385ed97 100644 --- a/sys/arch/m88k/include/db_machdep.h +++ b/sys/arch/m88k/include/db_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.h,v 1.1 2004/04/26 12:34:05 miod Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.2 2004/09/30 21:48:56 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -50,7 +50,7 @@ * in them that need to masked to get the correct addresses */ #define PC_REGS(regs) \ - cputyp == CPU_88110 ? ((regs)->exip & ~3) : \ + CPU_IS88110 ? ((regs)->exip & ~3) : \ (((regs)->sxip & 2) ? (regs)->sxip & ~3 : \ ((regs)->snip & 2 ? (regs)->snip & ~3 : (regs)->sfip & ~3)) diff --git a/sys/arch/m88k/include/param.h b/sys/arch/m88k/include/param.h index 001c541d0b3..bc873673434 100644 --- a/sys/arch/m88k/include/param.h +++ b/sys/arch/m88k/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.3 2004/08/09 20:53:04 miod Exp $ */ +/* $OpenBSD: param.h,v 1.4 2004/09/30 21:48:56 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1988 University of Utah. @@ -147,4 +147,17 @@ extern int cputyp; #define CPU_88100 0x100 #define CPU_88110 0x110 +#ifdef M88100 +#ifdef M88110 +#define CPU_IS88100 (cputyp == CPU_88100) +#define CPU_IS88110 (cputyp != CPU_88100) +#else +#define CPU_IS88100 1 +#define CPU_IS88110 0 +#endif +#else +#define CPU_IS88100 0 +#define CPU_IS88110 1 +#endif + #endif /* !_M88K_PARAM_H_ */ diff --git a/sys/arch/m88k/m88k/db_disasm.c b/sys/arch/m88k/m88k/db_disasm.c index 17caf68ca3b..c27ed1db370 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.1 2004/06/19 18:28:37 miod Exp $ */ +/* $OpenBSD: db_disasm.c,v 1.2 2004/09/30 21:48:56 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -30,7 +30,7 @@ * m88k disassembler for use in ddb */ -#include <sys/param.h> /* cputyp and friends */ +#include <sys/param.h> #include <sys/types.h> #include <machine/db_machdep.h> @@ -206,13 +206,13 @@ ctrlregs(int inst, const char *opcode, long iadr) if ( L6inst == 010 || L6inst == 011 ) db_printf("\t\tr%-3d,%s", rd, - cputyp == CPU_88100 ? m88100_ctrlreg[creg] : m88110_ctrlreg[creg]); + CPU_IS88100 ? m88100_ctrlreg[creg] : m88110_ctrlreg[creg]); else if ( L6inst == 020 || L6inst == 021 ) db_printf("\t\tr%-3d,%s", rs1, - cputyp == CPU_88100 ? m88100_ctrlreg[creg] : m88110_ctrlreg[creg]); + CPU_IS88100 ? m88100_ctrlreg[creg] : m88110_ctrlreg[creg]); else db_printf("\t\tr%-3d,r%-3d,%s", rd, rs1, - cputyp == CPU_88100 ? m88100_ctrlreg[creg] : m88110_ctrlreg[creg]); + CPU_IS88100 ? m88100_ctrlreg[creg] : m88110_ctrlreg[creg]); } diff --git a/sys/arch/m88k/m88k/db_sstep.c b/sys/arch/m88k/m88k/db_sstep.c index ccb2380c8f2..e211d9fec6a 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.2 2004/06/25 20:18:06 miod Exp $ */ +/* $OpenBSD: db_sstep.c,v 1.3 2004/09/30 21:48:56 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -288,9 +288,12 @@ void db_set_single_step(regs) db_regs_t *regs; { - if (cputyp == CPU_88110) { +#ifdef M88110 + if (CPU_IS88110) (regs)->epsr |= PSR_TRACE | PSR_SER; - } else { +#endif +#ifdef M88100 + if (CPU_IS88100) { db_addr_t pc = PC_REGS(regs); #ifndef SOFTWARE_SSTEP_EMUL db_addr_t brpc; @@ -315,16 +318,21 @@ db_set_single_step(regs) pc = next_instr_address(pc, 0); db_not_taken_bkpt = db_set_temp_breakpoint(pc); } +#endif } void db_clear_single_step(regs) db_regs_t *regs; { - if (cputyp == CPU_88110) { +#ifdef M88110 + if (CPU_IS88110) { /* do not remove PSR_SER as we don't enable OoO */ (regs)->epsr &= ~PSR_TRACE; - } else { + } +#endif +#ifdef M88100 + if (CPU_IS88100) { if (db_taken_bkpt != 0) { db_delete_temp_breakpoint(db_taken_bkpt); db_taken_bkpt = 0; @@ -334,5 +342,6 @@ db_clear_single_step(regs) db_not_taken_bkpt = 0; } } +#endif } #endif diff --git a/sys/arch/m88k/m88k/db_trace.c b/sys/arch/m88k/m88k/db_trace.c index 11698f15380..f763e040284 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.2 2004/07/28 12:33:55 miod Exp $ */ +/* $OpenBSD: db_trace.c,v 1.3 2004/09/30 21:48:56 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -299,7 +299,8 @@ frame_is_sane(db_regs_t *regs, int quiet) return 0; } - if (cputyp != CPU_88110) { +#ifdef M88100 + if (CPU_IS88100) { /* sxip is reasonable */ #if 0 if ((regs->sxip & 1) == 1) @@ -312,6 +313,7 @@ frame_is_sane(db_regs_t *regs, int quiet) if ((regs->sfip & 3) != 2) return 0; } +#endif /* epsr sanity */ if ((regs->epsr & PSR_MODE)) { /* kernel mode */ @@ -809,13 +811,17 @@ db_stack_trace_cmd2(db_regs_t *regs, int (*pr)(const char *, ...)) /* fetch address */ /* use sxip if valid, otherwise try snip or sfip */ - if (cputyp == CPU_88110) { +#ifdef M88110 + if (CPU_IS88110) { where = regs->exip & ~3; - } else { + } +#endif +#ifdef M88100 + if (CPU_IS88100) { where = ((regs->sxip & 2) ? regs->sxip : - ((regs->snip & 2) ? regs->snip : - regs->sfip) ) & ~3; + ((regs->snip & 2) ? regs->snip : regs->sfip)) & ~3; } +#endif stack = regs->r[31]; (*pr)("stack base = 0x%x\n", stack); (*pr)("(0) "); /*depth of trace */ @@ -1128,13 +1134,15 @@ db_stack_trace_print(db_expr_t addr, } frame.r[31] = ptr; frame.epsr = 0x800003f0U; - if (cputyp != CPU_88110) { +#ifdef M88100 + if (CPU_IS88100) { frame.sxip = sxip | 2; frame.snip = frame.sxip + 4; frame.sfip = frame.snip + 4; } +#endif (*pr)("[r31=%x, %sxip=%x]\n", frame.r[31], - cputyp == CPU_88110 ? "e" : "s", frame.sxip); + CPU_IS88110 ? "e" : "s", frame.sxip); regs = &frame; } } diff --git a/sys/arch/m88k/m88k/m88k_machdep.c b/sys/arch/m88k/m88k/m88k_machdep.c index 6d6ee6d20ff..d8f89677efb 100644 --- a/sys/arch/m88k/m88k/m88k_machdep.c +++ b/sys/arch/m88k/m88k/m88k_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m88k_machdep.c,v 1.1 2004/09/30 14:55:54 miod Exp $ */ +/* $OpenBSD: m88k_machdep.c,v 1.2 2004/09/30 21:48:56 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -159,8 +159,8 @@ setregs(p, pack, stack, retval) bzero((caddr_t)tf, sizeof *tf); - if (cputyp == CPU_88110) { #ifdef M88110 + if (CPU_IS88110) { /* * user mode, serialize mem, interrupts enabled, * graphics unit, fp enabled @@ -170,16 +170,17 @@ setregs(p, pack, stack, retval) * XXX disable OoO for now... */ tf->tf_epsr |= PSR_SER; + } #endif - } else { #ifdef M88100 + if (CPU_IS88100) { /* * user mode, interrupts enabled, * no graphics unit, fp enabled */ tf->tf_epsr = PSR_SFD | PSR_SFD2; -#endif } +#endif /* * We want to start executing at pack->ep_entry. The way to @@ -188,16 +189,17 @@ setregs(p, pack, stack, retval) * And set sfip to ep_entry with valid bit on so that it will be * fetched. mc88110 - just set exip to pack->ep_entry. */ - if (cputyp == CPU_88110) { #ifdef M88110 + if (CPU_IS88110) { tf->tf_exip = pack->ep_entry & ~3; + } #endif - } else { #ifdef M88100 + if (CPU_IS88100) { tf->tf_snip = pack->ep_entry & ~3; tf->tf_sfip = (pack->ep_entry & ~3) | FIP_V; -#endif } +#endif tf->tf_r[2] = stack; tf->tf_r[31] = stack; retval[1] = 0; @@ -299,14 +301,17 @@ regdump(struct trapframe *f) printf("R24-29: 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", R(24),R(25),R(26),R(27),R(28),R(29)); printf("R30-31: 0x%08x 0x%08x\n",R(30),R(31)); - if (cputyp == CPU_88110) { +#ifdef M88110 + if (CPU_IS88110) { printf("exip %x enip %x\n", f->tf_exip, f->tf_enip); - } else { + } +#endif +#ifdef M88100 + if (CPU_IS88100) { printf("sxip %x snip %x sfip %x\n", f->tf_sxip, f->tf_snip, f->tf_sfip); } -#ifdef M88100 - if (f->tf_vector == 0x3 && cputyp != CPU_88110) { + if (CPU_IS88100 && f->tf_vector == 0x3) { /* print dmt stuff for data access fault */ printf("dmt0 %x dmd0 %x dma0 %x\n", f->tf_dmt0, f->tf_dmd0, f->tf_dma0); @@ -317,7 +322,7 @@ regdump(struct trapframe *f) printf("fault type %d\n", (f->tf_dpfsr >> 16) & 0x7); dae_print((unsigned *)f); } - if (longformat && cputyp != CPU_88110) { + if (CPU_IS88100 && longformat != 0) { printf("fpsr %x fpcr %x epsr %x ssbr %x\n", f->tf_fpsr, f->tf_fpcr, f->tf_epsr, f->tf_ssbr); printf("fpecr %x fphs1 %x fpls1 %x fphs2 %x fpls2 %x\n", @@ -331,7 +336,7 @@ regdump(struct trapframe *f) } #endif #ifdef M88110 - if (longformat && cputyp == CPU_88110) { + if (CPU_IS88110 && longformat != 0) { printf("fpsr %x fpcr %x fpecr %x epsr %x\n", f->tf_fpsr, f->tf_fpcr, f->tf_fpecr, f->tf_epsr); printf("dsap %x duap %x dsr %x dlar %x dpar %x\n", diff --git a/sys/arch/m88k/m88k/pmap.c b/sys/arch/m88k/m88k/pmap.c index 53d405b0a53..32ed08aa3d5 100644 --- a/sys/arch/m88k/m88k/pmap.c +++ b/sys/arch/m88k/m88k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.4 2004/08/04 15:54:38 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.5 2004/09/30 21:48:56 miod Exp $ */ /* * Copyright (c) 2001-2004, Miodrag Vallat * Copyright (c) 1998-2001 Steve Murphree, Jr. @@ -411,7 +411,7 @@ pmap_map(vaddr_t virt, paddr_t start, paddr_t end, vm_prot_t prot, u_int cmode) template = m88k_protection(prot) | cmode | PG_V; #ifdef M88110 - if (cputyp == CPU_88110 && m88k_protection(prot) != PG_RO) + if (CPU_IS88110 && m88k_protection(prot) != PG_RO) template |= PG_M; #endif @@ -2480,7 +2480,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot) template = m88k_protection(prot); #ifdef M88110 - if (cputyp == CPU_88110 && m88k_protection(prot) != PG_RO) + if (CPU_IS88110 && m88k_protection(prot) != PG_RO) template |= PG_M; #endif diff --git a/sys/arch/m88k/m88k/sig_machdep.c b/sys/arch/m88k/m88k/sig_machdep.c index c2c3b0457b4..19088953577 100644 --- a/sys/arch/m88k/m88k/sig_machdep.c +++ b/sys/arch/m88k/m88k/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.1 2004/09/30 09:20:48 miod Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.2 2004/09/30 21:48:56 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -164,19 +164,18 @@ sendsig(sig_t catcher, int sig, int mask, unsigned long code, int type, * Signal trampoline code is at base of user stack. */ addr = p->p_sigcode; - if (cputyp != CPU_88110) { #ifdef M88100 - /* mc88100 */ + if (CPU_IS88100) { tf->tf_snip = (addr & ~3) | NIP_V; tf->tf_sfip = (tf->tf_snip + 4) | FIP_V; + } #endif - } else { #ifdef M88110 - /* mc88110 */ + if (CPU_IS88110) { tf->tf_exip = (addr & ~3); tf->tf_enip = (tf->tf_exip + 4); -#endif } +#endif tf->tf_r[31] = (unsigned)fp; #ifdef DEBUG if ((sigdebug & SDB_FOLLOW) || diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index 45d0b207e8b..ecc4ac6889b 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.10 2004/07/26 10:42:56 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.11 2004/09/30 21:48:56 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -154,9 +154,8 @@ panictrap(int type, struct trapframe *frame) static int panicing = 0; if (panicing++ == 0) { - switch (cputyp) { #ifdef M88100 - case CPU_88100: + if (CPU_IS88100) { if (type == 2) { /* instruction exception */ printf("\nInstr access fault (%s) v = %x, " @@ -174,15 +173,14 @@ panictrap(int type, struct trapframe *frame) } else printf("\nTrap type %d, v = %x, frame %p\n", type, frame->tf_sxip & XIP_ADDR, frame); - break; + } #endif #ifdef M88110 - case CPU_88110: + if (CPU_IS88110) { printf("\nTrap type %d, v = %x, frame %p\n", type, frame->tf_exip, frame); - break; -#endif } +#endif #ifdef DDB regdump(frame); #endif @@ -1509,16 +1507,21 @@ child_return(arg) tf->tf_r[2] = 0; tf->tf_r[3] = 0; tf->tf_epsr &= ~PSR_C; - if (cputyp != CPU_88110) { +#ifdef M88100 + if (CPU_IS88100) { tf->tf_snip = tf->tf_sfip & XIP_ADDR; tf->tf_sfip = tf->tf_snip + 4; - } else { + } +#endif +#ifdef M88110 + if (CPU_IS88110) { /* skip two instructions */ if (tf->tf_exip & 1) tf->tf_exip = tf->tf_enip + 4; else tf->tf_exip += 4 + 4; } +#endif userret(p, tf, p->p_sticks); #ifdef KTRACE diff --git a/sys/arch/mvme88k/ddb/db_interface.c b/sys/arch/mvme88k/ddb/db_interface.c index 58e67b6028d..ee27b2afa45 100644 --- a/sys/arch/mvme88k/ddb/db_interface.c +++ b/sys/arch/mvme88k/ddb/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.42 2004/01/23 17:26:02 miod Exp $ */ +/* $OpenBSD: db_interface.c,v 1.43 2004/09/30 21:48:56 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -241,7 +241,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) @@ -250,7 +250,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) @@ -258,7 +258,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), @@ -267,7 +268,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", @@ -275,6 +279,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); @@ -294,7 +299,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); @@ -341,7 +346,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", @@ -472,9 +477,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; } } diff --git a/sys/arch/mvme88k/mvme88k/locore_c_routines.c b/sys/arch/mvme88k/mvme88k/locore_c_routines.c index 3a34927f9a3..ec52fab9bcf 100644 --- a/sys/arch/mvme88k/mvme88k/locore_c_routines.c +++ b/sys/arch/mvme88k/mvme88k/locore_c_routines.c @@ -1,4 +1,4 @@ -/* $OpenBSD: locore_c_routines.c,v 1.42 2004/08/02 08:35:00 miod Exp $ */ +/* $OpenBSD: locore_c_routines.c,v 1.43 2004/09/30 21:48:57 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -91,9 +91,8 @@ vector_init(m88k_exception_vector_area *vector, unsigned *vector_init_list) bugvec[0] = vector[MVMEPROM_VECTOR].word_one; bugvec[1] = vector[MVMEPROM_VECTOR].word_two; - switch (cputyp) { #ifdef M88110 - case CPU_88110: + if (CPU_IS88110) { for (; num <= SIGSYS_MAX; num++) SET_VECTOR(num, m88110_sigsys); @@ -104,10 +103,10 @@ vector_init(m88k_exception_vector_area *vector, unsigned *vector_init_list) SET_VECTOR(MVMEPROM_VECTOR, m88110_bugtrap); SET_VECTOR(504, m88110_stepbpt); SET_VECTOR(511, m88110_userbpt); - break; -#endif /* M88110 */ + } +#endif #ifdef M88100 - case CPU_88100: + if (CPU_IS88100) { for (; num <= SIGSYS_MAX; num++) SET_VECTOR(num, sigsys); @@ -118,9 +117,8 @@ vector_init(m88k_exception_vector_area *vector, unsigned *vector_init_list) SET_VECTOR(MVMEPROM_VECTOR, bugtrap); SET_VECTOR(504, stepbpt); SET_VECTOR(511, userbpt); - break; -#endif /* M88100 */ } +#endif /* GCC will by default produce explicit trap 503 for division by zero */ SET_VECTOR(503, vector_init_list[T_ZERODIV]); |