PERFORCE change 48410 for review
Juli Mallett
jmallett at FreeBSD.org
Sun Mar 7 22:49:08 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=48410
Change 48410 by jmallett at jmallett_oingo on 2004/03/07 22:48:18
"Consistency is all I ask."
Affected files ...
.. //depot/projects/mips/sys/mips/include/db_machdep.h#8 edit
.. //depot/projects/mips/sys/mips/include/trap.h#4 edit
.. //depot/projects/mips/sys/mips/mips/db_interface.c#14 edit
.. //depot/projects/mips/sys/mips/mips/trap.c#16 edit
Differences ...
==== //depot/projects/mips/sys/mips/include/db_machdep.h#8 (text+ko) ====
@@ -68,7 +68,7 @@
#define BKPT_SIZE (4) /* size of breakpoint inst */
#define BKPT_SET(inst) (BKPT_INST)
-#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAK)
+#define IS_BREAKPOINT_TRAP(type, code) ((type) == TrBp)
#define IS_WATCHPOINT_TRAP(type, code) (0) /* XXX mips3 watchpoint */
/*
==== //depot/projects/mips/sys/mips/include/trap.h#4 (text+ko) ====
@@ -1,13 +1,5 @@
-/* $NetBSD: trap.h,v 1.13 2000/09/15 06:50:46 jeffs Exp $ */
-
-/*
- * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and Ralph Campbell.
+/*-
+ * Copyright (c) 2003-2004 Juli Mallett. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -17,18 +9,11 @@
* 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 by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 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)
@@ -37,45 +22,34 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: Utah Hdr: trap.h 1.1 90/07/09
- *
- * @(#)trap.h 8.1 (Berkeley) 6/10/93
+ * $FreeBSD$
*/
#ifndef _MACHINE_TRAP_H_
#define _MACHINE_TRAP_H_
-/*
- * Trap codes
- * also known in trap.c for name strings
- */
+#define TrInt 0
+#define TrMod 1
+#define TrTLBL 2
+#define TrTLBS 3
+#define TrAdEL 4
+#define TrAdES 5
+#define TrIBE 6
+#define TrDBE 7
+#define TrSys 8
+#define TrBp 9
+#define TrRI 10
+#define TrCpU 11
+#define TrOv 12
+#define TrTr 13
+#define TrVCEI 14
+#define TrFPE 15
+/* 16 - 22 */
+#define TrWATCH 23
+/* 24 - 30 */
+#define TrVCED 31
-#define T_INT 0 /* Interrupt pending */
-#define T_TLB_MOD 1 /* TLB modified fault */
-#define T_TLB_LD_MISS 2 /* TLB miss on load or ifetch */
-#define T_TLB_ST_MISS 3 /* TLB miss on a store */
-#define T_ADDR_ERR_LD 4 /* Address error on a load or ifetch */
-#define T_ADDR_ERR_ST 5 /* Address error on a store */
-#define T_BUS_ERR_IFETCH 6 /* Bus error on an ifetch */
-#define T_BUS_ERR_LD_ST 7 /* Bus error on a load or store */
-#define T_SYSCALL 8 /* System call */
-#define T_BREAK 9 /* Breakpoint */
-#define T_RES_INST 10 /* Reserved instruction exception */
-#define T_COP_UNUSABLE 11 /* Coprocessor unusable */
-#define T_OVFLOW 12 /* Arithmetic overflow */
-
-/*
- * Trap definitions added for r4000 port.
- */
-#define T_TRAP 13 /* Trap instruction */
-#define T_VCEI 14 /* Virtual coherency exception */
-#define T_FPE 15 /* Floating point exception */
-#define T_WATCH 23 /* Watch address reference */
-#define T_VCED 31 /* Virtual coherency data */
-
-#define T_USER 0x20 /* user-mode flag or'ed with type */
-
-#ifndef LOCORE /* XXX */
+#ifndef LOCORE /* XXX */
void platform_trap_enter(void);
void platform_trap_exit(void);
#endif
==== //depot/projects/mips/sys/mips/mips/db_interface.c#14 (text+ko) ====
@@ -156,12 +156,21 @@
db_active++;
cndbctl(TRUE);
+#if notyet
db_trap(type & ~T_USER, 0 /*code*/);
+#else
+ db_trap(type, 0 /*code*/);
+#endif
cndbctl(FALSE);
db_active--;
+#if notyet
if (type & T_USER)
*(struct frame *)curthread->td_md.md_regs = *f;
+#else
+ if (0)
+ return (1);
+#endif
else {
/* Synthetic full scale register context when trap happens */
kdbaux[0] = f->f_regs[S0];
@@ -187,8 +196,13 @@
/* Should switch to kdb`s own stack here. */
+#if notyet
if (type & T_USER)
*f = *(struct frame *)curthread->td_md.md_regs;
+#else
+ if (0)
+ return;
+#endif
else {
/* Synthetic full scale register context when trap happens */
f->f_regs[AST] = tfp->tf_regs[TF_AST];
==== //depot/projects/mips/sys/mips/mips/trap.c#16 (text+ko) ====
@@ -103,7 +103,7 @@
* Handle that which we can.
*/
switch (code) {
- case T_TLB_MOD:
+ case TrMod:
/* XXX Kernel only. */
tlb_modified(badvaddr);
platform_trap_exit();
@@ -143,7 +143,7 @@
}
switch (code) {
- case T_BREAK:
+ case TrBp:
#if DDB
default:
kdb_trap(code, tf);
More information about the p4-projects
mailing list