exceptions.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * exceptions.h
8  *
9  * @author: 2019 - Mikee47 <mike@sillyhouse.net>
10  *
11  ****/
12 
13 #pragma once
14 
15 #include <xtensa/corebits.h>
16 #include "gdb/signals.h"
17 
18 /*
19  * Trapped exceptions and the corresponding GDB signal
20  * Ordered from 0 to last used exception
21  *
22  * EXCCAUSE_*, signal, desc
23  *
24  * Only those exceptions where `signal` is non-zero are trapped
25  */
26 #define SYSTEM_EXCEPTION_MAP(XX) \
27  XX(ILLEGAL, GDB_SIGNAL_ILL, "Illegal Instruction") \
28  XX(SYSCALL, GDB_SIGNAL_USR2, "System Call") \
29  XX(INSTR_ERROR, GDB_SIGNAL_SEGV, "Instruction Fetch Error") \
30  XX(LOAD_STORE_ERROR, GDB_SIGNAL_SEGV, "Load Store Error") \
31  XX(LEVEL1_INTERRUPT, 0, "Level 1 Interrupt") \
32  XX(ALLOCA, 0, "MOVSP inst") \
33  XX(DIVIDE_BY_ZERO, GDB_SIGNAL_FPE, "Integer Divide by Zero") \
34  XX(SPECULATION, 0, "") \
35  XX(PRIVILEGED, GDB_SIGNAL_ABRT, "Privileged Instruction") \
36  XX(UNALIGNED, GDB_SIGNAL_EMT, "Unaligned Load/Store") \
37  XX(RSVD_10, 0, "") \
38  XX(RSVD_11, 0, "") \
39  XX(INSTR_DATA_ERROR, GDB_SIGNAL_EMT, "PIF Data Error on Instruction Fetch") \
40  XX(LOAD_STORE_DATA_ERROR, GDB_SIGNAL_EMT, "PIF Data Error on Load/Store") \
41  XX(INSTR_ADDR_ERROR, GDB_SIGNAL_EMT, "PIF Address Error on Instruction Fetch") \
42  XX(LOAD_STORE_ADDR_ERROR, GDB_SIGNAL_EMT, "PIF Address Error on Load/Store") \
43  XX(ITLB_MISS, 0, "ITLB Miss") \
44  XX(ITLB_MULTIHIT, 0, "ITLB Multihit") \
45  XX(INSTR_RING, 0, "Ring Privilege Violation on Instruction Fetch") \
46  XX(RSVD_19, 0, "") \
47  XX(INSTR_PROHIBITED, GDB_SIGNAL_SEGV, "Cache Attribute does not allow Instruction Fetch") \
48  XX(RSVD_21, 0, "") \
49  XX(RSVD_22, 0, "") \
50  XX(RSVD_23, 0, "") \
51  XX(DTLB_MISS, 0, "DTLB Miss") \
52  XX(DTLB_MULTIHIT, 0, "TBLD Multihit") \
53  XX(LOAD_STORE_RING, 0, "Ring Privilege Violation on Load/Store") \
54  XX(RSVD_27, 0, "") \
55  XX(LOAD_PROHIBITED, GDB_SIGNAL_SEGV, "Cache Attribute does not allow Load") \
56  XX(STORE_PROHIBITED, GDB_SIGNAL_SEGV, "Cache Attribute does not allow Store")
57 
58 #define EXCCAUSE_MAX EXCCAUSE_STORE_PROHIBITED