summaryrefslogtreecommitdiff
path: root/arch/arm/core/cortex_m/vector_table.S
blob: ceff57798b3b04f9dfaf23109bc01f3d96124774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
 * Copyright (c) 2013-2015 Wind River Systems, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file
 * @brief Populated vector table in ROM
 *
 * Vector table at the beginning of the image for starting system. The reset
 * vector is the system entry point, ie. the first instruction executed.
 *
 * The table is populated with all the system exception handlers. The NMI vector
 * must be populated with a valid handler since it can happen at any time. The
 * rest should not be triggered until the kernel is ready to handle them.
 */

#define _ASMLANGUAGE

#include <board.h>
#include <toolchain.h>
#include <sections.h>
#include <drivers/system_timer.h>
#include "vector_table.h"

_ASM_FILE_PROLOGUE

GDATA(_main_stack)

SECTION_SUBSEC_FUNC(exc_vector_table,_vector_table_section,_vector_table)

/* in XIP kernels. the entry point is also the start of the vector table */
#if defined(CONFIG_XIP)
SECTION_SUBSEC_FUNC(exc_vector_table,_vector_table_section,__start)
#endif

    /*
     * setting the _very_ early boot on the main stack allows to use memset
     * on the interrupt stack when CONFIG_INIT_STACKS is enabled before
     * switching to the interrupt stack for the rest of the early boot
     */
    .word _main_stack + CONFIG_MAIN_STACK_SIZE

    .word __reset
    .word __nmi

    .word __hard_fault
#if defined(CONFIG_ARMV6_M)
    .word __reserved
    .word __reserved
    .word __reserved
    .word __reserved
    .word __reserved
    .word __reserved
    .word __reserved
    .word __reserved	/* SVC not used for now (PendSV used instead) */
    .word __reserved
#elif defined(CONFIG_ARMV7_M)
    .word __mpu_fault
    .word __bus_fault
    .word __usage_fault
    .word __reserved
    .word __reserved
    .word __reserved
    .word __reserved
    .word __svc
    .word __debug_monitor
#else
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M */
    .word __reserved
    .word __pendsv
#if defined(CONFIG_CORTEX_M_SYSTICK)
    .word _timer_int_handler
#else
    .word __reserved
#endif