source: mainline/kernel/arch/arm32/include/arch/exception.h@ 999efa9

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 999efa9 was 999efa9, checked in by Jakub Jermar <jakub@…>, 8 years ago

Reformat copyright messages

The goal is to have one copyright-holder per line so that it is easier
to do some sort of automatic processing.

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Copyright (c) 2007 Michal Kebrt
3 * Copyright (c) 2007 Petr Stepan
4 *
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * - Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * - Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * - The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/** @addtogroup arm32
32 * @{
33 */
34/** @file
35 * @brief Exception declarations.
36 */
37
38#ifndef KERN_arm32_EXCEPTION_H_
39#define KERN_arm32_EXCEPTION_H_
40
41#include <typedefs.h>
42#include <arch/istate.h>
43
44/** If defined, forces using of high exception vectors. */
45#define HIGH_EXCEPTION_VECTORS
46
47#ifdef HIGH_EXCEPTION_VECTORS
48 #define EXC_BASE_ADDRESS 0xffff0000
49#else
50 #define EXC_BASE_ADDRESS 0x0
51#endif
52
53/* Exception Vectors */
54#define EXC_RESET_VEC (EXC_BASE_ADDRESS + 0x0)
55#define EXC_UNDEF_INSTR_VEC (EXC_BASE_ADDRESS + 0x4)
56#define EXC_SWI_VEC (EXC_BASE_ADDRESS + 0x8)
57#define EXC_PREFETCH_ABORT_VEC (EXC_BASE_ADDRESS + 0xc)
58#define EXC_DATA_ABORT_VEC (EXC_BASE_ADDRESS + 0x10)
59#define EXC_IRQ_VEC (EXC_BASE_ADDRESS + 0x18)
60#define EXC_FIQ_VEC (EXC_BASE_ADDRESS + 0x1c)
61
62/* Exception numbers */
63#define EXC_RESET 0
64#define EXC_UNDEF_INSTR 1
65#define EXC_SWI 2
66#define EXC_PREFETCH_ABORT 3
67#define EXC_DATA_ABORT 4
68#define EXC_IRQ 5
69#define EXC_FIQ 6
70
71/** Kernel stack pointer.
72 *
73 * It is set when thread switches to user mode,
74 * and then used for exception handling.
75 *
76 */
77extern uintptr_t supervisor_sp;
78
79/** Temporary exception stack pointer.
80 *
81 * Temporary stack is used in exceptions handling routines
82 * before switching to thread's kernel stack.
83 *
84 */
85extern uintptr_t exc_stack;
86
87extern void install_exception_handlers(void);
88extern void exception_init(void);
89extern void reset_exception_entry(void);
90extern void irq_exception_entry(void);
91extern void fiq_exception_entry(void);
92extern void undef_instr_exception_entry(void);
93extern void prefetch_abort_exception_entry(void);
94extern void data_abort_exception_entry(void);
95extern void swi_exception_entry(void);
96
97#endif
98
99/** @}
100 */
Note: See TracBrowser for help on using the repository browser.