1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2015-2021, Linaro Limited
4  */
5 
6 #ifndef KERNEL_ABORT_H
7 #define KERNEL_ABORT_H
8 
9 #define ABORT_TYPE_UNDEF		0
10 #define ABORT_TYPE_PREFETCH		1
11 #define ABORT_TYPE_DATA			2
12 /* Dump stack on user mode panic (not an abort) */
13 #define ABORT_TYPE_USER_MODE_PANIC	3
14 
15 #ifndef __ASSEMBLER__
16 
17 #include <compiler.h>
18 #include <types_ext.h>
19 
20 struct abort_info {
21 	uint32_t abort_type;
22 	uint32_t fault_descr;	/* only valid for data of prefetch abort */
23 	vaddr_t va;
24 	uint32_t pc;
25 	struct thread_abort_regs *regs;
26 };
27 
28 /* Print abort info to the console */
29 void abort_print(struct abort_info *ai);
30 /* Print abort info + stack dump to the console */
31 void abort_print_error(struct abort_info *ai);
32 
33 void abort_handler(uint32_t abort_type, struct thread_abort_regs *regs);
34 
35 bool abort_is_user_exception(struct abort_info *ai);
36 
37 bool abort_is_write_fault(struct abort_info *ai);
38 
39 /* Called from a normal thread */
40 void abort_print_current_ts(void);
41 
42 #endif /*__ASSEMBLER__*/
43 #endif /*KERNEL_ABORT_H*/
44 
45