18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2006 Tensilica, Inc.  All Rights Reserved.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
58c2ecf20Sopenharmony_ci * it under the terms of version 2.1 of the GNU Lesser General Public
68c2ecf20Sopenharmony_ci * License as published by the Free Software Foundation.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * This program is distributed in the hope that it would be useful, but
98c2ecf20Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of
108c2ecf20Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * Further, this software is distributed without any warranty that it is
138c2ecf20Sopenharmony_ci * free of the rightful claim of any third person regarding infringement
148c2ecf20Sopenharmony_ci * or the like.  Any license provided herein, whether implied or
158c2ecf20Sopenharmony_ci * otherwise, applies only to this software file.  Patent licenses, if
168c2ecf20Sopenharmony_ci * any, provided herein do not apply to combinations of this program with
178c2ecf20Sopenharmony_ci * other software, or any other product whatsoever.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * You should have received a copy of the GNU Lesser General Public
208c2ecf20Sopenharmony_ci * License along with this program; if not, write the Free Software
218c2ecf20Sopenharmony_ci * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
228c2ecf20Sopenharmony_ci * USA.
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#ifndef _XTENSA_REGS_H
268c2ecf20Sopenharmony_ci#define _XTENSA_REGS_H
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/*  Special registers.  */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define SREG_MR			32
318c2ecf20Sopenharmony_ci#define SREG_IBREAKENABLE	96
328c2ecf20Sopenharmony_ci#define SREG_IBREAKA		128
338c2ecf20Sopenharmony_ci#define SREG_DBREAKA		144
348c2ecf20Sopenharmony_ci#define SREG_DBREAKC		160
358c2ecf20Sopenharmony_ci#define SREG_EPC		176
368c2ecf20Sopenharmony_ci#define SREG_EPS		192
378c2ecf20Sopenharmony_ci#define SREG_EXCSAVE		208
388c2ecf20Sopenharmony_ci#define SREG_CCOMPARE		240
398c2ecf20Sopenharmony_ci#define SREG_MISC		244
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/*  EXCCAUSE register fields  */
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define EXCCAUSE_EXCCAUSE_SHIFT	0
448c2ecf20Sopenharmony_ci#define EXCCAUSE_EXCCAUSE_MASK	0x3F
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define EXCCAUSE_ILLEGAL_INSTRUCTION		0
478c2ecf20Sopenharmony_ci#define EXCCAUSE_SYSTEM_CALL			1
488c2ecf20Sopenharmony_ci#define EXCCAUSE_INSTRUCTION_FETCH_ERROR	2
498c2ecf20Sopenharmony_ci#define EXCCAUSE_LOAD_STORE_ERROR		3
508c2ecf20Sopenharmony_ci#define EXCCAUSE_LEVEL1_INTERRUPT		4
518c2ecf20Sopenharmony_ci#define EXCCAUSE_ALLOCA				5
528c2ecf20Sopenharmony_ci#define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO		6
538c2ecf20Sopenharmony_ci#define EXCCAUSE_SPECULATION			7
548c2ecf20Sopenharmony_ci#define EXCCAUSE_PRIVILEGED			8
558c2ecf20Sopenharmony_ci#define EXCCAUSE_UNALIGNED			9
568c2ecf20Sopenharmony_ci#define EXCCAUSE_INSTR_DATA_ERROR		12
578c2ecf20Sopenharmony_ci#define EXCCAUSE_LOAD_STORE_DATA_ERROR		13
588c2ecf20Sopenharmony_ci#define EXCCAUSE_INSTR_ADDR_ERROR		14
598c2ecf20Sopenharmony_ci#define EXCCAUSE_LOAD_STORE_ADDR_ERROR		15
608c2ecf20Sopenharmony_ci#define EXCCAUSE_ITLB_MISS			16
618c2ecf20Sopenharmony_ci#define EXCCAUSE_ITLB_MULTIHIT			17
628c2ecf20Sopenharmony_ci#define EXCCAUSE_ITLB_PRIVILEGE			18
638c2ecf20Sopenharmony_ci#define EXCCAUSE_ITLB_SIZE_RESTRICTION		19
648c2ecf20Sopenharmony_ci#define EXCCAUSE_FETCH_CACHE_ATTRIBUTE		20
658c2ecf20Sopenharmony_ci#define EXCCAUSE_DTLB_MISS			24
668c2ecf20Sopenharmony_ci#define EXCCAUSE_DTLB_MULTIHIT			25
678c2ecf20Sopenharmony_ci#define EXCCAUSE_DTLB_PRIVILEGE			26
688c2ecf20Sopenharmony_ci#define EXCCAUSE_DTLB_SIZE_RESTRICTION		27
698c2ecf20Sopenharmony_ci#define EXCCAUSE_LOAD_CACHE_ATTRIBUTE		28
708c2ecf20Sopenharmony_ci#define EXCCAUSE_STORE_CACHE_ATTRIBUTE		29
718c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR0_DISABLED		32
728c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR1_DISABLED		33
738c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR2_DISABLED		34
748c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR3_DISABLED		35
758c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR4_DISABLED		36
768c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR5_DISABLED		37
778c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR6_DISABLED		38
788c2ecf20Sopenharmony_ci#define EXCCAUSE_COPROCESSOR7_DISABLED		39
798c2ecf20Sopenharmony_ci#define EXCCAUSE_N				64
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/*  PS register fields.  */
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#define PS_WOE_BIT		18
848c2ecf20Sopenharmony_ci#define PS_WOE_MASK		0x00040000
858c2ecf20Sopenharmony_ci#define PS_CALLINC_SHIFT	16
868c2ecf20Sopenharmony_ci#define PS_CALLINC_MASK		0x00030000
878c2ecf20Sopenharmony_ci#define PS_OWB_SHIFT		8
888c2ecf20Sopenharmony_ci#define PS_OWB_WIDTH		4
898c2ecf20Sopenharmony_ci#define PS_OWB_MASK		0x00000F00
908c2ecf20Sopenharmony_ci#define PS_RING_SHIFT		6
918c2ecf20Sopenharmony_ci#define PS_RING_MASK		0x000000C0
928c2ecf20Sopenharmony_ci#define PS_UM_BIT		5
938c2ecf20Sopenharmony_ci#define PS_EXCM_BIT		4
948c2ecf20Sopenharmony_ci#define PS_INTLEVEL_SHIFT	0
958c2ecf20Sopenharmony_ci#define PS_INTLEVEL_WIDTH	4
968c2ecf20Sopenharmony_ci#define PS_INTLEVEL_MASK	0x0000000F
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/*  DBREAKCn register fields.  */
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define DBREAKC_MASK_BIT		0
1018c2ecf20Sopenharmony_ci#define DBREAKC_MASK_MASK		0x0000003F
1028c2ecf20Sopenharmony_ci#define DBREAKC_LOAD_BIT		30
1038c2ecf20Sopenharmony_ci#define DBREAKC_LOAD_MASK		0x40000000
1048c2ecf20Sopenharmony_ci#define DBREAKC_STOR_BIT		31
1058c2ecf20Sopenharmony_ci#define DBREAKC_STOR_MASK		0x80000000
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci/*  DEBUGCAUSE register fields.  */
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci#define DEBUGCAUSE_DBNUM_MASK		0xf00
1108c2ecf20Sopenharmony_ci#define DEBUGCAUSE_DBNUM_SHIFT		8	/* First bit of DBNUM field */
1118c2ecf20Sopenharmony_ci#define DEBUGCAUSE_DEBUGINT_BIT		5	/* External debug interrupt */
1128c2ecf20Sopenharmony_ci#define DEBUGCAUSE_BREAKN_BIT		4	/* BREAK.N instruction */
1138c2ecf20Sopenharmony_ci#define DEBUGCAUSE_BREAK_BIT		3	/* BREAK instruction */
1148c2ecf20Sopenharmony_ci#define DEBUGCAUSE_DBREAK_BIT		2	/* DBREAK match */
1158c2ecf20Sopenharmony_ci#define DEBUGCAUSE_IBREAK_BIT		1	/* IBREAK match */
1168c2ecf20Sopenharmony_ci#define DEBUGCAUSE_ICOUNT_BIT		0	/* ICOUNT would incr. to zero */
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#endif /* _XTENSA_SPECREG_H */
119