diff options
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/include/trap.h | 169 |
1 files changed, 87 insertions, 82 deletions
diff --git a/sys/arch/hppa/include/trap.h b/sys/arch/hppa/include/trap.h index 461dfeb809d..953a95e3a7d 100644 --- a/sys/arch/hppa/include/trap.h +++ b/sys/arch/hppa/include/trap.h @@ -1,102 +1,107 @@ -/* $OpenBSD: trap.h,v 1.5 1999/05/03 15:40:27 mickey Exp $ */ +/* $OpenBSD: trap.h,v 1.6 1999/09/18 20:39:55 mickey Exp $ */ -/* - * Copyright (c) 1988-1994, The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). +/* + * Copyright (c) 1999 Michael Shalayeff * All rights reserved. * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Utah $Hdr: trap.h 1.6 94/12/16$ + * 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 by Michael Shalayeff. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. * - * Utah $Hdr: break.h 1.10 94/12/14$ - * Author: Bob Wheeler, University of Utah CSL + * 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 OR HIS RELATIVES 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 MIND, 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_TRAP_H_ -#define _MACHINE_TRAP_H_ +#ifndef _MACHINE_TRAP_H_ +#define _MACHINE_TRAP_H_ /* - * Trap type values - * also known in trap.c for name strings + * This is PA-RISC trap types per 1.1 specs, see .c files for references. */ +#define T_NONEXIST 0 /* invalid interrupt vector */ +#define T_HPMC 1 /* high priority machine check */ +#define T_POWERFAIL 2 /* power failure */ +#define T_RECOVERY 3 /* recovery counter */ +#define T_INTERRUPT 4 /* external interrupt */ +#define T_LPMC 5 /* low-priority machine check */ +#define T_ITLBMISS 6 /* instruction TLB miss fault */ +#define T_IPROT 7 /* instruction protection */ +#define T_ILLEGAL 8 /* Illegal instruction */ +#define T_IBREAK 9 /* break instruction */ +#define T_PRIV_OP 10 /* privileged operation */ +#define T_PRIV_REG 11 /* privileged register */ +#define T_OVERFLOW 12 /* overflow */ +#define T_CONDITION 13 /* conditional */ +#define T_EXCEPTION 14 /* assist exception */ +#define T_DTLBMISS 15 /* data TLB miss */ +#define T_ITLBMISSNA 16 /* ITLB non-access miss */ +#define T_DTLBMISSNA 17 /* DTLB non-access miss */ +#define T_DPROT 18 /* data protection/rights/alignment <7100 */ +#define T_DBREAK 19 /* data break */ +#define T_TLB_DIRTY 20 /* TLB dirty bit */ +#define T_PAGEREF 21 /* page reference */ +#define T_EMULATION 22 /* assist emulation */ +#define T_HIGHERPL 23 /* higher-privelege transfer */ +#define T_LOWERPL 24 /* lower-privilege transfer */ +#define T_TAKENBR 25 /* taken branch */ +#define T_DATACC 26 /* data access rights >=7100 */ +#define T_DATAPID 27 /* data protection ID >=7100 */ +#define T_DATALIGN 28 /* unaligned data ref */ -#define T_NONEXIST 0 -#define T_HPMC 1 -#define T_POWERFAIL 2 -#define T_RECOVERY 3 -#define T_INTERRUPT 4 -#define T_LPMC 5 -#define T_ITLBMISS 6 -#define T_IPROT 7 -#define T_ILLEGAL 8 -#define T_IBREAK 9 -#define T_PRIV_OP 10 -#define T_PRIV_REG 11 -#define T_OVERFLOW 12 -#define T_CONDITION 13 -#define T_EXCEPTION 14 -#define T_DTLBMISS 15 -#define T_ITLBMISSNA 16 -#define T_DTLBMISSNA 17 -#define T_DPROT 18 -#define T_DBREAK 19 -#define T_TLB_DIRTY 20 -#define T_PAGEREF 21 -#define T_EMULATION 22 -#define T_HIGHERPL 23 -#define T_LOWERPL 24 -#define T_TAKENBR 25 - -#define T_DATACC 26 /* 7100 */ -#define T_DATAPID 27 /* 7100 */ -#define T_DATALIGN 28 /* 7100 */ - -#define T_USER 0x20 /* user-mode flag or'ed with type */ +/* + * Reserved range for traps is 0-63, place user flag at 6th bit + */ +#define T_USER_POS 25 +#define T_USER (1 << (31 - T_USER_POS)) -/* Values for break instructions */ +/* + * Various trap frame flags. + */ +#define TFF_LAST_POS 0 +#define TFF_ITLB_POS 1 -/* values for the im5 field of the break instruction */ -#define HPPA_BREAK_KERNEL 0 -#define HPPA_BREAK_MAYDEBUG 31 /* Reserved for Mayfly debugger. */ +#define TFF_LAST (1 << (31 - TFF_LAST_POS)) +#define TFF_ITLB (1 << (31 - TFF_ITLB_POS)) -/* values for the im13 field of the break instruction */ -#define HPPA_BREAK_PDC_DUMP 2 -#define HPPA_BREAK_KERNTRACE 3 -#define HPPA_BREAK_MACH_DEBUGGER 4 -#define HPPA_BREAK_KGDB 5 -#define HPPA_BREAK_KERNPRINT 6 -#define HPPA_BREAK_IVA 7 -#define HPPA_BREAK_PDC_IODC_CALL 8 -#define HPPA_BREAK_GDB 8 /* Standard GDB breakpoint. */ -#define HPPA_BREAK_GET_PSW 9 -#define HPPA_BREAK_SET_PSW 10 +/* + * Definre this for pretty printings of trapflags. + */ +#define T_BITS "\020\07user\037itlb\040last" /* - * Tear apart a break instruction to find its type. + * These are break instruction entry points. */ -#define break5(x) ((x) & 0x1F) -#define break13(x) (((x) >> 13) & 0x1FFF) +/* im5 */ +#define HPPA_BREAK_KERNEL 0 +/* im13 */ +#define HPPA_BREAK_KGDB 5 +#define HPPA_BREAK_GET_PSW 9 +#define HPPA_BREAK_SET_PSW 10 /* - * Trace debugging. + * break instruction decoding. */ -#define HPPA_TRACE_OFF 0 -#define HPPA_TRACE_JUMP -1 -#define HPPA_TRACE_SUSPEND -2 -#define HPPA_TRACE_RESUME -3 +#define break5(i) ((i) & 0x1f) +#define break13(i) (((i) >> 13) & 0x1fff) + +#endif /* _MACHINE_TRAP_H_ */ -#endif /* _MACHINE_TRAP_H_ */ |