Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013-2014 Wind River Systems, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_A_R_EXCEPTION_H_
13#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_A_R_EXCEPTION_H_
14
15#ifdef _ASMLANGUAGE
16GTEXT(z_arm_exc_exit);
17#else
18#include <zephyr/types.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
25
26/* Registers s16-s31 (d8-d15, q4-q7) must be preserved across subroutine calls.
27 *
28 * Registers s0-s15 (d0-d7, q0-q3) do not have to be preserved (and can be used
29 * for passing arguments or returning results in standard procedure-call variants).
30 *
31 * Registers d16-d31 (q8-q15), do not have to be preserved.
32 */
33struct __fpu_sf {
34 uint32_t s[16]; /* s0~s15 (d0-d7) */
35#ifdef CONFIG_VFP_FEATURE_REGS_S64_D32
36 uint64_t d[16]; /* d16~d31 */
37#endif
38 uint32_t fpscr;
39 uint32_t undefined;
40};
41#endif
42
43/* Additional register state that is not stacked by hardware on exception
44 * entry.
45 *
46 * These fields are ONLY valid in the ESF copy passed into z_arm_fatal_error().
47 * When information for a member is unavailable, the field is set to zero.
48 */
49#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
50struct __extra_esf_info {
51 _callee_saved_t *callee;
52 uint32_t msp;
53 uint32_t exc_return;
54};
55#endif /* CONFIG_EXTRA_EXCEPTION_INFO */
56
57/* ARM GPRs are often designated by two different names */
58#define sys_define_gpr_with_alias(name1, name2) union { uint32_t name1, name2; }
59
60struct arch_esf {
61#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
62 struct __extra_esf_info extra_info;
63#endif
64#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
65 struct __fpu_sf fpu;
66#endif
67 struct __basic_sf {
77};
78
79extern uint32_t z_arm_coredump_fault_sp;
80
81extern void z_arm_exc_exit(bool fatal);
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif /* _ASMLANGUAGE */
88
89#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_A_R_EXCEPTION_H_ */
#define sys_define_gpr_with_alias(name1, name2)
Definition exception.h:58
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa s
Definition asm-macro-32-bit-gnu.h:17
irp nz macro MOVR cc d
Definition asm-macro-32-bit-gnu.h:11
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
Definition exception.h:105
uint32_t r14
Definition exception.h:73
uint32_t xpsr
Definition exception.h:75
uint32_t r3
Definition exception.h:71
uint32_t lr
Definition exception.h:73
uint32_t r2
Definition exception.h:70
uint32_t r1
Definition exception.h:69
uint32_t a2
Definition exception.h:69
uint32_t pc
Definition exception.h:74
uint32_t a3
Definition exception.h:70
uint32_t r0
Definition exception.h:68
uint32_t ip
Definition exception.h:72
uint32_t a1
Definition exception.h:68
uint32_t a4
Definition exception.h:71
uint32_t r12
Definition exception.h:72
uint32_t r15
Definition exception.h:74
Exception Stack Frame.
Definition exception.h:60
struct arch_esf::__basic_sf basic
struct __fpu_sf fpu
Definition exception.h:65
static void fatal(uint32_t testnum, const void *expected, size_t expectedlen, const void *computed, size_t computedlen)
Definition test_utils.h:50