1 /*
2  * Copyright (c) 2014 Wind River Systems, Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @file
9  * @brief Populated exception vector table
10  *
11  * Vector table with exceptions filled in. The reset vector is the system entry
12  * point, ie. the first instruction executed.
13  *
14  * The table is populated with all the system exception handlers. No exception
15  * should not be triggered until the kernel is ready to handle them.
16  *
17  * We are using a C file instead of an assembly file (like the ARM vector table)
18  * to work around an issue with the assembler where:
19  *
20  *   .word <function>
21  *
22  * statements would end up with the two half-words of the functions' addresses
23  * swapped.
24  */
25 
26 #include <zephyr/types.h>
27 #include <zephyr/toolchain.h>
28 #include "vector_table.h"
29 
30 struct vector_table {
31 	uintptr_t reset;
32 	uintptr_t memory_error;
33 	uintptr_t instruction_error;
34 	uintptr_t ev_machine_check;
35 	uintptr_t ev_tlb_miss_i;
36 	uintptr_t ev_tlb_miss_d;
37 	uintptr_t ev_prot_v;
38 	uintptr_t ev_privilege_v;
39 	uintptr_t ev_swi;
40 	uintptr_t ev_trap;
41 	uintptr_t ev_extension;
42 	uintptr_t ev_div_zero;
43 	/* ev_dc_error is unused in ARCv3 and de-facto unused in ARCv2 as well */
44 	uintptr_t ev_dc_error;
45 	uintptr_t ev_maligned;
46 	uintptr_t unused_1;
47 	uintptr_t unused_2;
48 };
49 
50 struct vector_table _VectorTable Z_GENERIC_SECTION(.exc_vector_table) = {
51 	(uintptr_t)__reset,
52 	(uintptr_t)__memory_error,
53 	(uintptr_t)__instruction_error,
54 	(uintptr_t)__ev_machine_check,
55 	(uintptr_t)__ev_tlb_miss_i,
56 	(uintptr_t)__ev_tlb_miss_d,
57 	(uintptr_t)__ev_prot_v,
58 	(uintptr_t)__ev_privilege_v,
59 	(uintptr_t)__ev_swi,
60 	(uintptr_t)__ev_trap,
61 	(uintptr_t)__ev_extension,
62 	(uintptr_t)__ev_div_zero,
63 	(uintptr_t)__ev_dc_error,
64 	(uintptr_t)__ev_maligned,
65 	0,
66 	0
67 };
68