162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * linux/include/asm/traps.h 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Copyright (C) 1993 Hamish Macdonald 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 762306a36Sopenharmony_ci * License. See the file COPYING in the main directory of this archive 862306a36Sopenharmony_ci * for more details. 962306a36Sopenharmony_ci */ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#ifndef _M68K_TRAPS_H 1262306a36Sopenharmony_ci#define _M68K_TRAPS_H 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#ifndef __ASSEMBLY__ 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#include <linux/linkage.h> 1762306a36Sopenharmony_ci#include <asm/ptrace.h> 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_citypedef void (*e_vector)(void); 2062306a36Sopenharmony_ciextern e_vector vectors[]; 2162306a36Sopenharmony_ciextern e_vector *_ramvec; 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ciasmlinkage void auto_inthandler(void); 2462306a36Sopenharmony_ciasmlinkage void user_inthandler(void); 2562306a36Sopenharmony_ciasmlinkage void bad_inthandler(void); 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#endif 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci#define VEC_RESETSP (0) 3062306a36Sopenharmony_ci#define VEC_RESETPC (1) 3162306a36Sopenharmony_ci#define VEC_BUSERR (2) 3262306a36Sopenharmony_ci#define VEC_ADDRERR (3) 3362306a36Sopenharmony_ci#define VEC_ILLEGAL (4) 3462306a36Sopenharmony_ci#define VEC_ZERODIV (5) 3562306a36Sopenharmony_ci#define VEC_CHK (6) 3662306a36Sopenharmony_ci#define VEC_TRAP (7) 3762306a36Sopenharmony_ci#define VEC_PRIV (8) 3862306a36Sopenharmony_ci#define VEC_TRACE (9) 3962306a36Sopenharmony_ci#define VEC_LINE10 (10) 4062306a36Sopenharmony_ci#define VEC_LINE11 (11) 4162306a36Sopenharmony_ci#define VEC_RESV12 (12) 4262306a36Sopenharmony_ci#define VEC_COPROC (13) 4362306a36Sopenharmony_ci#define VEC_FORMAT (14) 4462306a36Sopenharmony_ci#define VEC_UNINT (15) 4562306a36Sopenharmony_ci#define VEC_RESV16 (16) 4662306a36Sopenharmony_ci#define VEC_RESV17 (17) 4762306a36Sopenharmony_ci#define VEC_RESV18 (18) 4862306a36Sopenharmony_ci#define VEC_RESV19 (19) 4962306a36Sopenharmony_ci#define VEC_RESV20 (20) 5062306a36Sopenharmony_ci#define VEC_RESV21 (21) 5162306a36Sopenharmony_ci#define VEC_RESV22 (22) 5262306a36Sopenharmony_ci#define VEC_RESV23 (23) 5362306a36Sopenharmony_ci#define VEC_SPUR (24) 5462306a36Sopenharmony_ci#define VEC_INT1 (25) 5562306a36Sopenharmony_ci#define VEC_INT2 (26) 5662306a36Sopenharmony_ci#define VEC_INT3 (27) 5762306a36Sopenharmony_ci#define VEC_INT4 (28) 5862306a36Sopenharmony_ci#define VEC_INT5 (29) 5962306a36Sopenharmony_ci#define VEC_INT6 (30) 6062306a36Sopenharmony_ci#define VEC_INT7 (31) 6162306a36Sopenharmony_ci#define VEC_SYS (32) 6262306a36Sopenharmony_ci#define VEC_TRAP1 (33) 6362306a36Sopenharmony_ci#define VEC_TRAP2 (34) 6462306a36Sopenharmony_ci#define VEC_TRAP3 (35) 6562306a36Sopenharmony_ci#define VEC_TRAP4 (36) 6662306a36Sopenharmony_ci#define VEC_TRAP5 (37) 6762306a36Sopenharmony_ci#define VEC_TRAP6 (38) 6862306a36Sopenharmony_ci#define VEC_TRAP7 (39) 6962306a36Sopenharmony_ci#define VEC_TRAP8 (40) 7062306a36Sopenharmony_ci#define VEC_TRAP9 (41) 7162306a36Sopenharmony_ci#define VEC_TRAP10 (42) 7262306a36Sopenharmony_ci#define VEC_TRAP11 (43) 7362306a36Sopenharmony_ci#define VEC_TRAP12 (44) 7462306a36Sopenharmony_ci#define VEC_TRAP13 (45) 7562306a36Sopenharmony_ci#define VEC_TRAP14 (46) 7662306a36Sopenharmony_ci#define VEC_TRAP15 (47) 7762306a36Sopenharmony_ci#define VEC_FPBRUC (48) 7862306a36Sopenharmony_ci#define VEC_FPIR (49) 7962306a36Sopenharmony_ci#define VEC_FPDIVZ (50) 8062306a36Sopenharmony_ci#define VEC_FPUNDER (51) 8162306a36Sopenharmony_ci#define VEC_FPOE (52) 8262306a36Sopenharmony_ci#define VEC_FPOVER (53) 8362306a36Sopenharmony_ci#define VEC_FPNAN (54) 8462306a36Sopenharmony_ci#define VEC_FPUNSUP (55) 8562306a36Sopenharmony_ci#define VEC_MMUCFG (56) 8662306a36Sopenharmony_ci#define VEC_MMUILL (57) 8762306a36Sopenharmony_ci#define VEC_MMUACC (58) 8862306a36Sopenharmony_ci#define VEC_RESV59 (59) 8962306a36Sopenharmony_ci#define VEC_UNIMPEA (60) 9062306a36Sopenharmony_ci#define VEC_UNIMPII (61) 9162306a36Sopenharmony_ci#define VEC_RESV62 (62) 9262306a36Sopenharmony_ci#define VEC_RESV63 (63) 9362306a36Sopenharmony_ci#define VEC_USER (64) 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci#define VECOFF(vec) ((vec)<<2) 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci#ifndef __ASSEMBLY__ 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci/* Status register bits */ 10062306a36Sopenharmony_ci#define PS_T (0x8000) 10162306a36Sopenharmony_ci#define PS_S (0x2000) 10262306a36Sopenharmony_ci#define PS_M (0x1000) 10362306a36Sopenharmony_ci#define PS_C (0x0001) 10462306a36Sopenharmony_ci 10562306a36Sopenharmony_ci/* bits for 68020/68030 special status word */ 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci#define FC (0x8000) 10862306a36Sopenharmony_ci#define FB (0x4000) 10962306a36Sopenharmony_ci#define RC (0x2000) 11062306a36Sopenharmony_ci#define RB (0x1000) 11162306a36Sopenharmony_ci#define DF (0x0100) 11262306a36Sopenharmony_ci#define RM (0x0080) 11362306a36Sopenharmony_ci#define RW (0x0040) 11462306a36Sopenharmony_ci#define SZ (0x0030) 11562306a36Sopenharmony_ci#define DFC (0x0007) 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci/* bits for 68030 MMU status register (mmusr,psr) */ 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci#define MMU_B (0x8000) /* bus error */ 12062306a36Sopenharmony_ci#define MMU_L (0x4000) /* limit violation */ 12162306a36Sopenharmony_ci#define MMU_S (0x2000) /* supervisor violation */ 12262306a36Sopenharmony_ci#define MMU_WP (0x0800) /* write-protected */ 12362306a36Sopenharmony_ci#define MMU_I (0x0400) /* invalid descriptor */ 12462306a36Sopenharmony_ci#define MMU_M (0x0200) /* ATC entry modified */ 12562306a36Sopenharmony_ci#define MMU_T (0x0040) /* transparent translation */ 12662306a36Sopenharmony_ci#define MMU_NUM (0x0007) /* number of levels traversed */ 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci/* bits for 68040 special status word */ 13062306a36Sopenharmony_ci#define CP_040 (0x8000) 13162306a36Sopenharmony_ci#define CU_040 (0x4000) 13262306a36Sopenharmony_ci#define CT_040 (0x2000) 13362306a36Sopenharmony_ci#define CM_040 (0x1000) 13462306a36Sopenharmony_ci#define MA_040 (0x0800) 13562306a36Sopenharmony_ci#define ATC_040 (0x0400) 13662306a36Sopenharmony_ci#define LK_040 (0x0200) 13762306a36Sopenharmony_ci#define RW_040 (0x0100) 13862306a36Sopenharmony_ci#define SIZ_040 (0x0060) 13962306a36Sopenharmony_ci#define TT_040 (0x0018) 14062306a36Sopenharmony_ci#define TM_040 (0x0007) 14162306a36Sopenharmony_ci 14262306a36Sopenharmony_ci/* bits for 68040 write back status word */ 14362306a36Sopenharmony_ci#define WBV_040 (0x80) 14462306a36Sopenharmony_ci#define WBSIZ_040 (0x60) 14562306a36Sopenharmony_ci#define WBBYT_040 (0x20) 14662306a36Sopenharmony_ci#define WBWRD_040 (0x40) 14762306a36Sopenharmony_ci#define WBLNG_040 (0x00) 14862306a36Sopenharmony_ci#define WBTT_040 (0x18) 14962306a36Sopenharmony_ci#define WBTM_040 (0x07) 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_ci/* bus access size codes */ 15262306a36Sopenharmony_ci#define BA_SIZE_BYTE (0x20) 15362306a36Sopenharmony_ci#define BA_SIZE_WORD (0x40) 15462306a36Sopenharmony_ci#define BA_SIZE_LONG (0x00) 15562306a36Sopenharmony_ci#define BA_SIZE_LINE (0x60) 15662306a36Sopenharmony_ci 15762306a36Sopenharmony_ci/* bus access transfer type codes */ 15862306a36Sopenharmony_ci#define BA_TT_MOVE16 (0x08) 15962306a36Sopenharmony_ci 16062306a36Sopenharmony_ci/* bits for 68040 MMU status register (mmusr) */ 16162306a36Sopenharmony_ci#define MMU_B_040 (0x0800) 16262306a36Sopenharmony_ci#define MMU_G_040 (0x0400) 16362306a36Sopenharmony_ci#define MMU_S_040 (0x0080) 16462306a36Sopenharmony_ci#define MMU_CM_040 (0x0060) 16562306a36Sopenharmony_ci#define MMU_M_040 (0x0010) 16662306a36Sopenharmony_ci#define MMU_WP_040 (0x0004) 16762306a36Sopenharmony_ci#define MMU_T_040 (0x0002) 16862306a36Sopenharmony_ci#define MMU_R_040 (0x0001) 16962306a36Sopenharmony_ci 17062306a36Sopenharmony_ci/* bits in the 68060 fault status long word (FSLW) */ 17162306a36Sopenharmony_ci#define MMU060_MA (0x08000000) /* misaligned */ 17262306a36Sopenharmony_ci#define MMU060_LK (0x02000000) /* locked transfer */ 17362306a36Sopenharmony_ci#define MMU060_RW (0x01800000) /* read/write */ 17462306a36Sopenharmony_ci# define MMU060_RW_W (0x00800000) /* write */ 17562306a36Sopenharmony_ci# define MMU060_RW_R (0x01000000) /* read */ 17662306a36Sopenharmony_ci# define MMU060_RW_RMW (0x01800000) /* read/modify/write */ 17762306a36Sopenharmony_ci# define MMU060_W (0x00800000) /* general write, includes rmw */ 17862306a36Sopenharmony_ci#define MMU060_SIZ (0x00600000) /* transfer size */ 17962306a36Sopenharmony_ci#define MMU060_TT (0x00180000) /* transfer type (TT) bits */ 18062306a36Sopenharmony_ci#define MMU060_TM (0x00070000) /* transfer modifier (TM) bits */ 18162306a36Sopenharmony_ci#define MMU060_IO (0x00008000) /* instruction or operand */ 18262306a36Sopenharmony_ci#define MMU060_PBE (0x00004000) /* push buffer bus error */ 18362306a36Sopenharmony_ci#define MMU060_SBE (0x00002000) /* store buffer bus error */ 18462306a36Sopenharmony_ci#define MMU060_PTA (0x00001000) /* pointer A fault */ 18562306a36Sopenharmony_ci#define MMU060_PTB (0x00000800) /* pointer B fault */ 18662306a36Sopenharmony_ci#define MMU060_IL (0x00000400) /* double indirect descr fault */ 18762306a36Sopenharmony_ci#define MMU060_PF (0x00000200) /* page fault (invalid descr) */ 18862306a36Sopenharmony_ci#define MMU060_SP (0x00000100) /* supervisor protection */ 18962306a36Sopenharmony_ci#define MMU060_WP (0x00000080) /* write protection */ 19062306a36Sopenharmony_ci#define MMU060_TWE (0x00000040) /* bus error on table search */ 19162306a36Sopenharmony_ci#define MMU060_RE (0x00000020) /* bus error on read */ 19262306a36Sopenharmony_ci#define MMU060_WE (0x00000010) /* bus error on write */ 19362306a36Sopenharmony_ci#define MMU060_TTR (0x00000008) /* error caused by TTR translation */ 19462306a36Sopenharmony_ci#define MMU060_BPE (0x00000004) /* branch prediction error */ 19562306a36Sopenharmony_ci#define MMU060_SEE (0x00000001) /* software emulated error */ 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_ci/* cases of missing or invalid descriptors */ 19862306a36Sopenharmony_ci#define MMU060_DESC_ERR (MMU060_PTA | MMU060_PTB | \ 19962306a36Sopenharmony_ci MMU060_IL | MMU060_PF) 20062306a36Sopenharmony_ci/* bits that indicate real errors */ 20162306a36Sopenharmony_ci#define MMU060_ERR_BITS (MMU060_PBE | MMU060_SBE | MMU060_DESC_ERR | MMU060_SP | \ 20262306a36Sopenharmony_ci MMU060_WP | MMU060_TWE | MMU060_RE | MMU060_WE) 20362306a36Sopenharmony_ci 20462306a36Sopenharmony_ci/* structure for stack frames */ 20562306a36Sopenharmony_ci 20662306a36Sopenharmony_cistruct frame { 20762306a36Sopenharmony_ci struct pt_regs ptregs; 20862306a36Sopenharmony_ci union { 20962306a36Sopenharmony_ci struct { 21062306a36Sopenharmony_ci unsigned long iaddr; /* instruction address */ 21162306a36Sopenharmony_ci } fmt2; 21262306a36Sopenharmony_ci struct { 21362306a36Sopenharmony_ci unsigned long effaddr; /* effective address */ 21462306a36Sopenharmony_ci } fmt3; 21562306a36Sopenharmony_ci struct { 21662306a36Sopenharmony_ci unsigned long effaddr; /* effective address */ 21762306a36Sopenharmony_ci unsigned long pc; /* pc of faulted instr */ 21862306a36Sopenharmony_ci } fmt4; 21962306a36Sopenharmony_ci struct { 22062306a36Sopenharmony_ci unsigned long effaddr; /* effective address */ 22162306a36Sopenharmony_ci unsigned short ssw; /* special status word */ 22262306a36Sopenharmony_ci unsigned short wb3s; /* write back 3 status */ 22362306a36Sopenharmony_ci unsigned short wb2s; /* write back 2 status */ 22462306a36Sopenharmony_ci unsigned short wb1s; /* write back 1 status */ 22562306a36Sopenharmony_ci unsigned long faddr; /* fault address */ 22662306a36Sopenharmony_ci unsigned long wb3a; /* write back 3 address */ 22762306a36Sopenharmony_ci unsigned long wb3d; /* write back 3 data */ 22862306a36Sopenharmony_ci unsigned long wb2a; /* write back 2 address */ 22962306a36Sopenharmony_ci unsigned long wb2d; /* write back 2 data */ 23062306a36Sopenharmony_ci unsigned long wb1a; /* write back 1 address */ 23162306a36Sopenharmony_ci unsigned long wb1dpd0; /* write back 1 data/push data 0*/ 23262306a36Sopenharmony_ci unsigned long pd1; /* push data 1*/ 23362306a36Sopenharmony_ci unsigned long pd2; /* push data 2*/ 23462306a36Sopenharmony_ci unsigned long pd3; /* push data 3*/ 23562306a36Sopenharmony_ci } fmt7; 23662306a36Sopenharmony_ci struct { 23762306a36Sopenharmony_ci unsigned long iaddr; /* instruction address */ 23862306a36Sopenharmony_ci unsigned short int1[4]; /* internal registers */ 23962306a36Sopenharmony_ci } fmt9; 24062306a36Sopenharmony_ci struct { 24162306a36Sopenharmony_ci unsigned short int1; 24262306a36Sopenharmony_ci unsigned short ssw; /* special status word */ 24362306a36Sopenharmony_ci unsigned short isc; /* instruction stage c */ 24462306a36Sopenharmony_ci unsigned short isb; /* instruction stage b */ 24562306a36Sopenharmony_ci unsigned long daddr; /* data cycle fault address */ 24662306a36Sopenharmony_ci unsigned short int2[2]; 24762306a36Sopenharmony_ci unsigned long dobuf; /* data cycle output buffer */ 24862306a36Sopenharmony_ci unsigned short int3[2]; 24962306a36Sopenharmony_ci } fmta; 25062306a36Sopenharmony_ci struct { 25162306a36Sopenharmony_ci unsigned short int1; 25262306a36Sopenharmony_ci unsigned short ssw; /* special status word */ 25362306a36Sopenharmony_ci unsigned short isc; /* instruction stage c */ 25462306a36Sopenharmony_ci unsigned short isb; /* instruction stage b */ 25562306a36Sopenharmony_ci unsigned long daddr; /* data cycle fault address */ 25662306a36Sopenharmony_ci unsigned short int2[2]; 25762306a36Sopenharmony_ci unsigned long dobuf; /* data cycle output buffer */ 25862306a36Sopenharmony_ci unsigned short int3[4]; 25962306a36Sopenharmony_ci unsigned long baddr; /* stage B address */ 26062306a36Sopenharmony_ci unsigned short int4[2]; 26162306a36Sopenharmony_ci unsigned long dibuf; /* data cycle input buffer */ 26262306a36Sopenharmony_ci unsigned short int5[3]; 26362306a36Sopenharmony_ci unsigned ver : 4; /* stack frame version # */ 26462306a36Sopenharmony_ci unsigned int6:12; 26562306a36Sopenharmony_ci unsigned short int7[18]; 26662306a36Sopenharmony_ci } fmtb; 26762306a36Sopenharmony_ci } un; 26862306a36Sopenharmony_ci}; 26962306a36Sopenharmony_ci 27062306a36Sopenharmony_ci#ifdef CONFIG_M68040 27162306a36Sopenharmony_ciasmlinkage void berr_040cleanup(struct frame *fp); 27262306a36Sopenharmony_ci#endif 27362306a36Sopenharmony_ci 27462306a36Sopenharmony_ci#endif /* __ASSEMBLY__ */ 27562306a36Sopenharmony_ci 27662306a36Sopenharmony_ci#endif /* _M68K_TRAPS_H */ 277