summaryrefslogtreecommitdiff
path: root/sys/arch/mips/include
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1998-03-16 09:03:39 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1998-03-16 09:03:39 +0000
commit3460a445e62bf6559a4ca00aab3e2959959b5c58 (patch)
treec9e0ef5165b9e3c93db4a89710e98aa1c6edf834 /sys/arch/mips/include
parentcd264da84d16c2ce76eb7476eb671189597eb5cc (diff)
DDB for mips, first cut. Will add some machine dep commands and tune
up a little. Basically works. Still needs symbol table support. Load store counting does not handle branch likely situations. Also, some code moved into here as 'machine independent'.
Diffstat (limited to 'sys/arch/mips/include')
-rw-r--r--sys/arch/mips/include/archtype.h24
-rw-r--r--sys/arch/mips/include/asm.h5
-rw-r--r--sys/arch/mips/include/cpu.h11
-rw-r--r--sys/arch/mips/include/db_machdep.h80
-rw-r--r--sys/arch/mips/include/frame.h41
-rw-r--r--sys/arch/mips/include/regdef.h6
-rw-r--r--sys/arch/mips/include/regnum.h11
-rw-r--r--sys/arch/mips/include/varargs.h20
8 files changed, 158 insertions, 40 deletions
diff --git a/sys/arch/mips/include/archtype.h b/sys/arch/mips/include/archtype.h
index 5ae11975ff8..ae1cbc3eca4 100644
--- a/sys/arch/mips/include/archtype.h
+++ b/sys/arch/mips/include/archtype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archtype.h,v 1.1 1998/01/28 11:14:36 pefo Exp $ */
+/* $OpenBSD: archtype.h,v 1.2 1998/03/16 09:02:59 pefo Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
*
@@ -36,15 +36,21 @@
/*
* Define architectural identitys for the different Mips machines.
*/
-#define ACER_PICA_61 0x1 /* Acer Labs Pica 61 */
-#define MAGNUM 0x2 /* Mips MAGNUM R4000 */
-#define DESKSTATION_RPC44 0x3 /* Deskstation xxx */
-#define DESKSTATION_TYNE 0x4 /* Deskstation xxx */
-#define NKK_AQUARIUS 0x5 /* NKK R4{67}00 PC */
-#define ALGOR_P4032 0x6 /* ALGORITHMICS P-4032 VR4300 */
-#define SNI_RM200 0x7 /* Siemens Nixdorf RM200 */
+#define ARC_CLASS 0x00 /* Arch class ARC */
+#define ACER_PICA_61 0x01 /* Acer Labs Pica 61 */
+#define MAGNUM 0x02 /* Mips MAGNUM R4000 */
+#define DESKSTATION_RPC44 0x03 /* Deskstation xxx */
+#define DESKSTATION_TYNE 0x04 /* Deskstation xxx */
+#define NKK_AQUARIUS 0x05 /* NKK R4{67}00 PC */
+#define NEC_R94 0x06 /* NEC Magnum class */
+#define SNI_RM200 0x07 /* Siemens Nixdorf RM200 */
-#define SGI_INDY 0x10 /* Silicon Graphics Indy */
+#define SGI_CLASS 0x10 /* Silicon Graphics Class */
+#define SGI_INDY 0x11 /* Silicon Graphics Indy */
+
+#define ALGOR_CLASS 0x20 /* Algorithmics Class */
+#define ALGOR_P4032 0x21 /* ALGORITHMICS P-4032 */
+#define ALGOR_P5064 0x22 /* ALGORITHMICS P-5064 */
extern int system_type; /* Global system type indicator */
diff --git a/sys/arch/mips/include/asm.h b/sys/arch/mips/include/asm.h
index d34fdb32dce..9fc9c7821e2 100644
--- a/sys/arch/mips/include/asm.h
+++ b/sys/arch/mips/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.1 1998/01/28 11:14:37 pefo Exp $ */
+/* $OpenBSD: asm.h,v 1.2 1998/03/16 09:03:02 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -178,9 +178,6 @@ x: ; \
#define END(x) \
.end x
-#define STAND_FRAME_SIZE 24
-#define STAND_RA_OFFSET 20
-
/*
* Macros to panic and printf from assembly language.
*/
diff --git a/sys/arch/mips/include/cpu.h b/sys/arch/mips/include/cpu.h
index 7429f92c1f1..df86d6aaca0 100644
--- a/sys/arch/mips/include/cpu.h
+++ b/sys/arch/mips/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.1 1998/01/28 11:14:38 pefo Exp $ */
+/* $OpenBSD: cpu.h,v 1.2 1998/03/16 09:03:04 pefo Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -176,10 +176,12 @@
#define BREAK_SSTEP_VAL 513
#define BREAK_BRKPT_VAL 514
#define BREAK_SOVER_VAL 515
+#define BREAK_DDB_VAL 516
#define BREAK_KDB (BREAK_INSTR | (BREAK_KDB_VAL << BREAK_VAL_SHIFT))
#define BREAK_SSTEP (BREAK_INSTR | (BREAK_SSTEP_VAL << BREAK_VAL_SHIFT))
#define BREAK_BRKPT (BREAK_INSTR | (BREAK_BRKPT_VAL << BREAK_VAL_SHIFT))
#define BREAK_SOVER (BREAK_INSTR | (BREAK_SOVER_VAL << BREAK_VAL_SHIFT))
+#define BREAK_DDB (BREAK_INSTR | (BREAK_DDB_VAL << BREAK_VAL_SHIFT))
/*
* Mininum and maximum cache sizes.
@@ -375,7 +377,7 @@ union cpuprid {
#define MIPS_R4700 0x21 /* QED R4700 Orion ISA III */
#define MIPS_R3TOSH 0x22 /* Toshiba R3000 based CPU ISA I */
#define MIPS_R5000 0x23 /* MIPS R5000 based CPU ISA IV */
-#define MIPS_RM5230 0x28 /* QED RM5230 based CPU ISA IV */
+#define MIPS_RM52X0 0x28 /* QED RM52X0 based CPU ISA IV */
/*
* MIPS FPU types
@@ -395,7 +397,7 @@ union cpuprid {
#define MIPS_R3SONY 0x21 /* Sony R3000 based FPU ISA I */
#define MIPS_R3TOSH 0x22 /* Toshiba R3000 based FPU ISA I */
#define MIPS_R5010 0x23 /* MIPS R5000 based FPU ISA IV */
-#define MIPS_RM5230 0x28 /* QED RM5230 based FPU ISA IV */
+#define MIPS_RM5230 0x28 /* QED RM52X0 based FPU ISA IV */
#if defined(_KERNEL) && !defined(_LOCORE)
union cpuprid cpu_id;
@@ -431,9 +433,6 @@ void savectx __P((struct user *, int));
int copykstack __P((struct user *));
void switch_exit __P((void));
void MipsSaveCurFPState __P((struct proc *));
-#ifdef DEBUG
-void mdbpanic __P((void));
-#endif
extern u_int32_t cpu_counter_interval; /* Number of counter ticks/tick */
extern u_int32_t cpu_counter_last; /* Last compare value loaded */
diff --git a/sys/arch/mips/include/db_machdep.h b/sys/arch/mips/include/db_machdep.h
new file mode 100644
index 00000000000..3f01969b422
--- /dev/null
+++ b/sys/arch/mips/include/db_machdep.h
@@ -0,0 +1,80 @@
+/* $OpenBSD: db_machdep.h,v 1.1 1998/03/16 09:03:05 pefo Exp $ */
+
+/*
+ * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed under OpenBSD by
+ * Per Fogelstrom, Opsycon AB, Sweden.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef _MACHINE_DB_MACHDEP_H_
+#define _MACHINE_DB_MACHDEP_H_
+
+#include <machine/regnum.h>
+#include <machine/frame.h>
+#include <machine/trap.h>
+#include <vm/vm_param.h>
+
+#define MID_MACHINE 0 /* XXX booo... */
+
+typedef struct trap_frame db_regs_t;
+db_regs_t ddb_regs;
+
+typedef int db_expr_t;
+typedef vm_offset_t db_addr_t;
+
+#define SOFTWARE_SSTEP /* Need software single step */
+#define SOFTWARE_SSTEP_EMUL /* next_instr_address() emulates 100% */
+db_addr_t next_instr_address __P((db_addr_t, boolean_t));
+#define BKPT_SIZE (4)
+#define BKPT_SET(ins) (BREAK_DDB)
+#define DB_VALID_BREAKPOINT(addr) (((addr) & 3) == 0)
+
+#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAK)
+#define IS_WATCHPOINT_TRAP(type, code) (0) /* XXX mips3 watchpoint */
+
+#define PC_REGS(regs) ((db_addr_t)(regs)->reg[PC])
+#define DDB_REGS (&ddb_regs)
+
+/*
+ * Test of instructions to see class.
+ */
+#define IT_CALL 0x01
+#define IT_BRANCH 0x02
+#define IT_LOAD 0x03
+#define IT_STORE 0x04
+
+#define inst_branch(i) (db_inst_type(i) == IT_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_load(i) (db_inst_type(i) == IT_LOAD)
+#define inst_store(i) (db_inst_type(i) == IT_STORE)
+
+int db_inst_type __P((int));
+#endif /* _MACHINE_DB_MACHDEP_H_ */
diff --git a/sys/arch/mips/include/frame.h b/sys/arch/mips/include/frame.h
index e69de29bb2d..c67c8ee481b 100644
--- a/sys/arch/mips/include/frame.h
+++ b/sys/arch/mips/include/frame.h
@@ -0,0 +1,41 @@
+/* $OpenBSD: frame.h,v 1.2 1998/03/16 09:03:06 pefo Exp $ */
+
+/*
+ * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed under OpenBSD by
+ * Per Fogelstrom, Opsycon AB, Sweden.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#ifndef _MACHINE_FRAME_H_
+#define _MACHINE_FRAME_H_
+
+struct trap_frame {
+ int reg[NUMSAVEREGS];
+};
+
+#endif /*_MACHINE_FRAME_H_*/
diff --git a/sys/arch/mips/include/regdef.h b/sys/arch/mips/include/regdef.h
index 3461aa7057b..2b2879326e5 100644
--- a/sys/arch/mips/include/regdef.h
+++ b/sys/arch/mips/include/regdef.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: regdef.h,v 1.1 1998/01/28 11:14:54 pefo Exp $ */
+/* $OpenBSD: regdef.h,v 1.2 1998/03/16 09:03:08 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -38,6 +38,8 @@
*
* @(#)regdef.h 8.1 (Berkeley) 6/10/93
*/
+#ifndef _MACHINE_REGDEF_H_
+#define _MACHINE_REGDEF_H_
#define zero $0 /* always zero */
#define AT $at /* assembler temp */
@@ -71,3 +73,5 @@
#define sp $29 /* stack pointer */
#define s8 $30 /* one more callee saved */
#define ra $31 /* return address */
+
+#endif /* _MACHINE_REGDEF_H_ */
diff --git a/sys/arch/mips/include/regnum.h b/sys/arch/mips/include/regnum.h
index 32255d07a76..0766179d722 100644
--- a/sys/arch/mips/include/regnum.h
+++ b/sys/arch/mips/include/regnum.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: regnum.h,v 1.1 1998/01/28 11:14:54 pefo Exp $ */
+/* $OpenBSD: regnum.h,v 1.2 1998/03/16 09:03:14 pefo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -41,9 +41,12 @@
* @(#)reg.h 8.2 (Berkeley) 1/11/94
*/
+#define STAND_ARG_SIZE 16
+#define STAND_FRAME_SIZE 24
+#define STAND_RA_OFFSET 20
+
/*
- * Location of the users' stored
- * registers relative to ZERO.
+ * Location of the saved registers relative to ZERO.
* Usage is p->p_regs[XX].
*/
#define ZERO 0
@@ -86,6 +89,8 @@
#define CAUSE 36
#define PC 37
+#define NUMSAVEREGS 38 /* Number of registers saved in trap */
+
#define FPBASE 38
#define F0 (FPBASE+0)
#define F1 (FPBASE+1)
diff --git a/sys/arch/mips/include/varargs.h b/sys/arch/mips/include/varargs.h
index 4101abb3c85..dd5cda76d68 100644
--- a/sys/arch/mips/include/varargs.h
+++ b/sys/arch/mips/include/varargs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: varargs.h,v 1.1 1998/01/28 11:14:59 pefo Exp $ */
+/* $OpenBSD: varargs.h,v 1.2 1998/03/16 09:03:16 pefo Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -43,26 +43,12 @@
#ifndef _MACHINE_VARARGS_H_
#define _MACHINE_VARARGS_H_
-#include <machine/ansi.h>
-
-typedef _BSD_VA_LIST_ va_list;
+#include <machine/stdarg.h>
#define va_dcl int va_alist; ...
+#undef va_start
#define va_start(ap) \
ap = (char *)&va_alist
-#ifdef _KERNEL
-#define va_arg(ap, type) \
- ((type *)(ap += sizeof(type)))[-1]
-#else
-#define va_arg(ap, type) \
- ((type *)(ap += sizeof(type) == sizeof(int) ? sizeof(type) : \
- sizeof(type) > sizeof(int) ? \
- (-(int)(ap) & (sizeof(type) - 1)) + sizeof(type) : \
- (abort(), 0)))[-1]
-#endif
-
-#define va_end(ap) ((void) 0)
-
#endif /* !_MACHINE_VARARGS_H_ */