162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright (c) 2006 Tensilica, Inc. All Rights Reserved. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 562306a36Sopenharmony_ci * it under the terms of version 2.1 of the GNU Lesser General Public 662306a36Sopenharmony_ci * License as published by the Free Software Foundation. 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * This program is distributed in the hope that it would be useful, but 962306a36Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of 1062306a36Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 1162306a36Sopenharmony_ci * 1262306a36Sopenharmony_ci * Further, this software is distributed without any warranty that it is 1362306a36Sopenharmony_ci * free of the rightful claim of any third person regarding infringement 1462306a36Sopenharmony_ci * or the like. Any license provided herein, whether implied or 1562306a36Sopenharmony_ci * otherwise, applies only to this software file. Patent licenses, if 1662306a36Sopenharmony_ci * any, provided herein do not apply to combinations of this program with 1762306a36Sopenharmony_ci * other software, or any other product whatsoever. 1862306a36Sopenharmony_ci * 1962306a36Sopenharmony_ci * You should have received a copy of the GNU Lesser General Public 2062306a36Sopenharmony_ci * License along with this program; if not, write the Free Software 2162306a36Sopenharmony_ci * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, 2262306a36Sopenharmony_ci * USA. 2362306a36Sopenharmony_ci */ 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci#ifndef _XTENSA_REGS_H 2662306a36Sopenharmony_ci#define _XTENSA_REGS_H 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci/* Special registers. */ 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#define SREG_MR 32 3162306a36Sopenharmony_ci#define SREG_IBREAKENABLE 96 3262306a36Sopenharmony_ci#define SREG_IBREAKA 128 3362306a36Sopenharmony_ci#define SREG_DBREAKA 144 3462306a36Sopenharmony_ci#define SREG_DBREAKC 160 3562306a36Sopenharmony_ci#define SREG_EPC 176 3662306a36Sopenharmony_ci#define SREG_EPS 192 3762306a36Sopenharmony_ci#define SREG_EXCSAVE 208 3862306a36Sopenharmony_ci#define SREG_CCOMPARE 240 3962306a36Sopenharmony_ci#define SREG_MISC 244 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci/* EXCCAUSE register fields */ 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci#define EXCCAUSE_EXCCAUSE_SHIFT 0 4462306a36Sopenharmony_ci#define EXCCAUSE_EXCCAUSE_MASK 0x3F 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ci#define EXCCAUSE_ILLEGAL_INSTRUCTION 0 4762306a36Sopenharmony_ci#define EXCCAUSE_SYSTEM_CALL 1 4862306a36Sopenharmony_ci#define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2 4962306a36Sopenharmony_ci#define EXCCAUSE_LOAD_STORE_ERROR 3 5062306a36Sopenharmony_ci#define EXCCAUSE_LEVEL1_INTERRUPT 4 5162306a36Sopenharmony_ci#define EXCCAUSE_ALLOCA 5 5262306a36Sopenharmony_ci#define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6 5362306a36Sopenharmony_ci#define EXCCAUSE_SPECULATION 7 5462306a36Sopenharmony_ci#define EXCCAUSE_PRIVILEGED 8 5562306a36Sopenharmony_ci#define EXCCAUSE_UNALIGNED 9 5662306a36Sopenharmony_ci#define EXCCAUSE_INSTR_DATA_ERROR 12 5762306a36Sopenharmony_ci#define EXCCAUSE_LOAD_STORE_DATA_ERROR 13 5862306a36Sopenharmony_ci#define EXCCAUSE_INSTR_ADDR_ERROR 14 5962306a36Sopenharmony_ci#define EXCCAUSE_LOAD_STORE_ADDR_ERROR 15 6062306a36Sopenharmony_ci#define EXCCAUSE_ITLB_MISS 16 6162306a36Sopenharmony_ci#define EXCCAUSE_ITLB_MULTIHIT 17 6262306a36Sopenharmony_ci#define EXCCAUSE_ITLB_PRIVILEGE 18 6362306a36Sopenharmony_ci#define EXCCAUSE_ITLB_SIZE_RESTRICTION 19 6462306a36Sopenharmony_ci#define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20 6562306a36Sopenharmony_ci#define EXCCAUSE_DTLB_MISS 24 6662306a36Sopenharmony_ci#define EXCCAUSE_DTLB_MULTIHIT 25 6762306a36Sopenharmony_ci#define EXCCAUSE_DTLB_PRIVILEGE 26 6862306a36Sopenharmony_ci#define EXCCAUSE_DTLB_SIZE_RESTRICTION 27 6962306a36Sopenharmony_ci#define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28 7062306a36Sopenharmony_ci#define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29 7162306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR0_DISABLED 32 7262306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR1_DISABLED 33 7362306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR2_DISABLED 34 7462306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR3_DISABLED 35 7562306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR4_DISABLED 36 7662306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR5_DISABLED 37 7762306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR6_DISABLED 38 7862306a36Sopenharmony_ci#define EXCCAUSE_COPROCESSOR7_DISABLED 39 7962306a36Sopenharmony_ci#define EXCCAUSE_N 64 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci/* PS register fields. */ 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#define PS_WOE_BIT 18 8462306a36Sopenharmony_ci#define PS_WOE_MASK 0x00040000 8562306a36Sopenharmony_ci#define PS_CALLINC_SHIFT 16 8662306a36Sopenharmony_ci#define PS_CALLINC_MASK 0x00030000 8762306a36Sopenharmony_ci#define PS_OWB_SHIFT 8 8862306a36Sopenharmony_ci#define PS_OWB_WIDTH 4 8962306a36Sopenharmony_ci#define PS_OWB_MASK 0x00000F00 9062306a36Sopenharmony_ci#define PS_RING_SHIFT 6 9162306a36Sopenharmony_ci#define PS_RING_MASK 0x000000C0 9262306a36Sopenharmony_ci#define PS_UM_BIT 5 9362306a36Sopenharmony_ci#define PS_EXCM_BIT 4 9462306a36Sopenharmony_ci#define PS_INTLEVEL_SHIFT 0 9562306a36Sopenharmony_ci#define PS_INTLEVEL_WIDTH 4 9662306a36Sopenharmony_ci#define PS_INTLEVEL_MASK 0x0000000F 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ci/* DBREAKCn register fields. */ 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci#define DBREAKC_MASK_BIT 0 10162306a36Sopenharmony_ci#define DBREAKC_MASK_MASK 0x0000003F 10262306a36Sopenharmony_ci#define DBREAKC_LOAD_BIT 30 10362306a36Sopenharmony_ci#define DBREAKC_LOAD_MASK 0x40000000 10462306a36Sopenharmony_ci#define DBREAKC_STOR_BIT 31 10562306a36Sopenharmony_ci#define DBREAKC_STOR_MASK 0x80000000 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci/* DEBUGCAUSE register fields. */ 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci#define DEBUGCAUSE_DBNUM_MASK 0xf00 11062306a36Sopenharmony_ci#define DEBUGCAUSE_DBNUM_SHIFT 8 /* First bit of DBNUM field */ 11162306a36Sopenharmony_ci#define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */ 11262306a36Sopenharmony_ci#define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */ 11362306a36Sopenharmony_ci#define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */ 11462306a36Sopenharmony_ci#define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */ 11562306a36Sopenharmony_ci#define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */ 11662306a36Sopenharmony_ci#define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */ 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci#endif /* _XTENSA_SPECREG_H */ 119