libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
vector.h
Go to the documentation of this file.
1/*
2 * This file is part of the libopencm3 project.
3 *
4 * Copyright (C) 2012 chrysn <chrysn@fsfe.org>
5 *
6 * This library is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20/** @file
21 *
22 * Definitions for handling vector tables.
23 *
24 * This implements d0002_efm32_cortex-m3_reference_manual.pdf's figure 2.2
25 * (from the EFM32 documentation at
26 * http://www.energymicro.com/downloads/datasheets), and was seen analogously
27 * in other ARM implementations' libopencm3 files.
28 *
29 * The structure of the vector table is implemented independently of the system
30 * vector table starting at memory position 0x0, as it can be relocated to
31 * other memory locations too.
32 *
33 * The exact size of a vector interrupt table depends on the number of
34 * interrupts IRQ_COUNT, which is defined per family.
35 */
36
37#ifndef LIBOPENCM3_VECTOR_H
38#define LIBOPENCM3_VECTOR_H
39
41#include <libopencm3/cm3/nvic.h>
42
43/** Type of an interrupt function. Only used to avoid hard-to-read function
44 * pointers in the efm32_vector_table_t struct. */
45typedef void (*vector_table_entry_t)(void);
46
47typedef struct {
48 unsigned int *initial_sp_value; /**< Initial stack pointer value. */
55 vector_table_entry_t reserved_x001c[4];
63
64/* Common symbols exported by the linker script(s): */
67
68#endif
#define NVIC_IRQ_COUNT
Definition: stm32/f2/nvic.h:98
vector_table_entry_t memory_manage_fault
Definition: vector.h:52
vector_table_entry_t hard_fault
Definition: vector.h:51
vector_table_entry_t bus_fault
Definition: vector.h:53
vector_table_entry_t debug_monitor
Definition: vector.h:57
vector_table_entry_t nmi
Definition: vector.h:50
vector_table_entry_t usage_fault
Definition: vector.h:54
vector_table_entry_t sv_call
Definition: vector.h:56
vector_table_entry_t systick
Definition: vector.h:60
vector_table_entry_t reset
Definition: vector.h:49
unsigned int * initial_sp_value
Initial stack pointer value.
Definition: vector.h:48
vector_table_entry_t reserved_x0034
Definition: vector.h:58
vector_table_entry_t pend_sv
Definition: vector.h:59
vector_table_t vector_table
Definition: vector.c:40
void(* vector_table_entry_t)(void)
Type of an interrupt function.
Definition: vector.h:45
unsigned _data_loadaddr
unsigned _stack
Definition: vector.h:65
unsigned _ebss
Definition: vector.h:65
unsigned _data
Definition: vector.h:65
unsigned _edata
Definition: vector.h:65