-# $OpenBSD: files.m68k,v 1.2 1996/03/21 00:04:55 niklas Exp $
-# $NetBSD: files.m68k,v 1.12 1996/02/14 15:59:57 gwr Exp $
+# $OpenBSD: files.m68k,v 1.3 1996/04/19 06:18:12 niklas Exp $
+# $NetBSD: files.m68k,v 1.13 1996/02/24 12:59:47 briggs Exp $
#
file arch/m68k/m68k/db_disasm.c ddb
file arch/m68k/m68k/db_interface.c ddb
file arch/m68k/m68k/db_trace.c ddb
file arch/m68k/m68k/in_cksum.c inet
file arch/m68k/m68k/oc_cksum.s inet
+file arch/m68k/m68k/ns_cksum.c ns
file arch/m68k/m68k/process_machdep.c
file arch/m68k/m68k/random.s
-/* $NetBSD: ansi.h,v 1.5 1994/10/26 07:50:40 cgd Exp $ */
+/* $OpenBSD: ansi.h,v 1.2 1996/04/19 06:18:13 niklas Exp $ */
+/* $NetBSD: ansi.h,v 1.6 1996/03/16 01:31:52 jtc Exp $ */
/*-
* Copyright (c) 1990, 1993
* defined for ctype.h.
*/
#define _BSD_WCHAR_T_ int /* wchar_t */
+#define _BSD_WINT_T_ int /* wint_t */
#define _BSD_RUNE_T_ int /* rune_t */
#endif /* _ANSI_H_ */
-/* $NetBSD: frame.h,v 1.10 1995/05/12 12:45:24 mycroft Exp $ */
+/* $OpenBSD: frame.h,v 1.2 1996/04/19 06:18:14 niklas Exp $ */
+/* $NetBSD: frame.h,v 1.11 1996/03/12 22:21:51 is Exp $ */
/*
* Copyright (c) 1988 University of Utah.
u_int f_ea;
} F_fmt3;
+ struct fmt4 {
+ u_int f_fa;
+ u_int f_fslw;
+ /* for 060FP type 4 FP disabled frames: */
+#define f_fea f_fa
+#define f_pcfi f_fslw
+ } F_fmt4;
+
struct fmt7 {
u_int f_ea;
u_short f_ssw;
#define f_vector F_t.tf_vector
#define f_fmt2 F_u.F_fmt2
#define f_fmt3 F_u.F_fmt3
+#define f_fmt4 F_u.F_fmt4
#define f_fmt7 F_u.F_fmt7
#define f_fmt9 F_u.F_fmt9
#define f_fmtA F_u.F_fmtA
/* common frame size */
#define CFSIZE (sizeof(struct frame) - sizeof(union F_u))
-#define NFMTSIZE 8
+#define NFMTSIZE 9
#define FMT0 0x0
#define FMT1 0x1
#define FMT2 0x2
#define FMT3 0x3
+#define FMT4 0x4
#define FMT7 0x7
#define FMT9 0x9
#define FMTA 0xA
#define FMT1SIZE 0
#define FMT2SIZE sizeof(struct fmt2)
#define FMT3SIZE sizeof(struct fmt3)
+#define FMT4SIZE sizeof(struct fmt4)
#define FMT7SIZE sizeof(struct fmt7)
#define FMT9SIZE sizeof(struct fmt9)
#define FMTASIZE sizeof(struct fmtA)
#define SSW4_TMKD 0x0005
#define SSW4_TMKC 0x0006
+/* 060 Fault Status Long Word (FPSP) */
+
+#define FSLW_MA 0x08000000
+#define FSLW_LK 0x02000000
+#define FSLW_RW 0x01800000
+#define FSLW_SIZE 0x00600000
+
+/*
+ * We better define the FSLW_SIZE values here, as the table given in the
+ * MC68060UM/AD rev. 0/1 p. 8-23 is wrong, and was corrected in the errata
+ * document.
+ */
+#define FSLW_SIZE_LONG 0x00000000
+#define FSLW_SIZE_BYTE 0x00200000
+#define FSLW_SIZE_WORD 0x00400000
+#define FSLW_SIZE_MV16 0x00600000
+
+#define FLSW_TT 0x00180000
+#define FSLW_TM 0x00070000
+
+#define FSLW_IO 0x00008000
+#define FSLW_PBE 0x00004000
+#define FSLW_SBE 0x00002000
+#define FSLW_PTA 0x00001000
+#define FSLW_PTB 0x00000800
+#define FSLW_IL 0x00000400
+#define FSLW_PF 0x00000200
+#define FSLW_SP 0x00000100
+#define FSLW_WP 0x00000080
+#define FSLW_TWE 0x00000040
+#define FSLW_RE 0x00000020
+#define FSLW_WE 0x00000010
+#define FSLW_TTR 0x00000008
+#define FSLW_BPE 0x00000004
+#define FSLW_SEE 0x00000001
+
struct fpframe {
union FPF_u1 {
u_int FPF_null;
#define fpf_idle FPF_u2.FPF_idle
#define fpf_busy FPF_u2.FPF_busy
#define fpf_unimp FPF_u2.FPF_unimp
+
+/*
+ * This is incompatible with the earlier one; expecially, an earlier frame
+ * must not be FRESTOREd on a 060 or vv, because a frame error exception is
+ * not guaranteed.
+ */
+
+
+struct fpframe060 {
+ u_short fpf6_excp_exp;
+ u_char fpf6_frmfmt;
+#define FPF6_FMT_NULL 0x00
+#define FPF6_FMT_IDLE 0x60
+#define FPF6_FMT_EXCP 0xe0
+
+ u_char fpf6_v;
+#define FPF6_V_BSUN 0
+#define FPF6_V_INEX12 1
+#define FPF6_V_DZ 2
+#define FPF6_V_UNFL 3
+#define FPF6_V_OPERR 4
+#define FPF6_V_OVFL 5
+#define FPF6_V_SNAN 6
+#define FPF6_V_UNSUP 7
+
+ u_long fpf6_upper, fpf6_lower;
+};
-/* $OpenBSD: db_interface.c,v 1.2 1996/03/21 00:07:42 niklas Exp $ */
-/* $NetBSD: db_interface.c,v 1.17 1996/02/09 21:51:39 gwr Exp $ */
+/* $OpenBSD: db_interface.c,v 1.3 1996/04/19 06:18:15 niklas Exp $ */
+/* $NetBSD: db_interface.c,v 1.18 1996/02/22 23:23:23 gwr Exp $ */
/*
* Mach Operating System
*/
/*
- * Interface to new debugger.
+ * Interface to the "ddb" kernel debugger.
*/
#include <sys/param.h>
#include <sys/proc.h>
#include <machine/trap.h>
#include <machine/db_machdep.h>
-short exframesize[];
extern label_t *db_recover;
int db_active = 0;
-int ddb_regs_ssp; /* system stack pointer */
/*
* Received keyboard interrupt sequence.
int type;
register struct mc68020_saved_state *regs;
{
- int fsize;
switch (type) {
case T_TRACE: /* single-step */
db_error("Caught exception in ddb.\n");
/*NOTREACHED*/
}
+ /*
+ * Tell caller "We did NOT handle the trap."
+ * Caller should panic or whatever.
+ */
return (0);
}
- /* XXX - Should switch to kdb's own stack here. */
+ /*
+ * We'd like to be on a separate debug stack here, but
+ * that's easier to do in locore.s before we get here.
+ * See sun3/locore.s:T_TRACE for stack switch code.
+ */
ddb_regs = *regs;
- /* Get System Stack Pointer (SSP) */
- ddb_regs_ssp = (int)(®s[1]);
- fsize = exframesize[regs->stkfmt];
- if (fsize > 0)
- ddb_regs_ssp += fsize;
-
db_active++;
cnpollc(TRUE); /* set polling mode, unblank video */
cnpollc(FALSE); /* resume interrupt mode */
db_active--;
- /* Can't easily honor change in ssp. Oh well. */
-
*regs = ddb_regs;
/*
* trace bit in the current SR (and trapping while exiting KDB).
*/
(void) spl7();
-#if 0
- if (!USERMODE(regs->sr) && (regs->sr & SR_T1) && (current_thread())) {
- current_thread()->pcb->pcb_flag |= TRACE_KDB;
- }
- if ((regs->sr & SR_T1) && (current_thread())) {
- current_thread()->pcb->flag |= TRACE_KDB;
- }
-#endif
+ /*
+ * Tell caller "We HAVE handled the trap."
+ * Caller will return to locore and rte.
+ */
return(1);
}
asm ("trap #15");
}
-#if !defined(sun3) && !defined(amiga) && !defined(atari)
-
-/*
- * Read bytes from kernel address space for debugger.
- * XXX - Each port should provide one of these...
- * (See arch/sun3/sun3/db_machdep.c for example.)
- */
-void
-db_read_bytes(addr, size, data)
- vm_offset_t addr;
- register int size;
- register char *data;
-{
- register char *src;
-
- src = (char *)addr;
- while (--size >= 0)
- *data++ = *src++;
-}
-
-/*
- * Write bytes to kernel address space for debugger.
- * XXX - Each port should provide one of these...
- * (See arch/sun3/sun3/db_machdep.c for example.)
- */
-void
-db_write_bytes(addr, size, data)
- vm_offset_t addr;
- register int size;
- register char *data;
-{
- register char *dst;
-
- int oldmap0 = 0;
- int oldmap1 = 0;
- vm_offset_t addr1;
- extern char etext;
-
- dst = (char *)addr;
- while (--size >= 0)
- *dst++ = *data++;
-
-}
-#endif /* !defined(sun3) && !defined(amiga) && !defined(atari) */
-/* $OpenBSD: db_trace.c,v 1.2 1996/03/21 00:12:55 niklas Exp $ */
-/* $NetBSD: db_trace.c,v 1.14 1996/02/13 17:34:46 gwr Exp $ */
+/* $OpenBSD: db_trace.c,v 1.3 1996/04/19 06:18:16 niklas Exp $ */
+/* $NetBSD: db_trace.c,v 1.15 1996/02/22 23:23:41 gwr Exp $ */
/*
* Mach Operating System
* Register list
*/
static int db_var_short(struct db_variable *, db_expr_t *, int);
-extern int ddb_regs_ssp;
struct db_variable db_regs[] = {
{ "d0", (int *)&ddb_regs.d0, FCN_NULL },
{ "d1", (int *)&ddb_regs.d1, FCN_NULL },
{ "a4", (int *)&ddb_regs.a4, FCN_NULL },
{ "a5", (int *)&ddb_regs.a5, FCN_NULL },
{ "a6", (int *)&ddb_regs.a6, FCN_NULL },
- { "ssp",&ddb_regs_ssp, FCN_NULL },
- { "usp",(int *)&ddb_regs.sp, FCN_NULL },
+ { "sp", (int *)&ddb_regs.sp, FCN_NULL },
{ "pc", (int *)&ddb_regs.pc, FCN_NULL },
{ "sr", (int *)&ddb_regs.sr, db_var_short }
};