Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
18
19#ifndef ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_H_
20#define ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_H_
21
22#ifndef _ASMLANGUAGE
23#include <zephyr/types.h>
25#ifdef CONFIG_ARM_PAC_PER_THREAD
27#endif
28
29struct _callee_saved {
30 uint64_t x19;
31 uint64_t x20;
32 uint64_t x21;
33 uint64_t x22;
34 uint64_t x23;
35 uint64_t x24;
36 uint64_t x25;
37 uint64_t x26;
38 uint64_t x27;
39 uint64_t x28;
40 uint64_t x29;
41 uint64_t sp_el0;
42 uint64_t sp_elx;
43 uint64_t lr;
44};
45
46typedef struct _callee_saved _callee_saved_t;
47
48struct z_arm64_fp_context {
49 uint32_t fpsr, fpcr;
50 union {
51 struct {
52 __int128 v_regs[32];
53 } neon;
54#ifdef CONFIG_ARM64_SVE
55 struct {
56 uint8_t z_regs[32 * CONFIG_ARM64_SVE_VL_MAX] __aligned(8);
57 uint8_t p_regs[16 * (CONFIG_ARM64_SVE_VL_MAX / 8)];
58 uint8_t ffr[CONFIG_ARM64_SVE_VL_MAX / 8];
59 enum { SIMD_NONE = 0, SIMD_NEON, SIMD_SVE } simd_mode;
60 } sve;
61#endif
62 };
63};
64
65typedef struct z_arm64_fp_context z_arm64_fp_context;
66
67struct _thread_arch {
68#if defined(CONFIG_USERSPACE) || defined(CONFIG_ARM64_STACK_PROTECTION)
69#if defined(CONFIG_ARM_MMU)
70 struct arm_mmu_ptables *ptables;
71#endif
72#if defined(CONFIG_ARM_MPU)
73 struct dynamic_region_info regions[ARM64_MPU_MAX_DYNAMIC_REGIONS];
74 uint8_t region_num;
75 atomic_t flushing;
76#endif
77#endif
78#ifdef CONFIG_ARM64_SAFE_EXCEPTION_STACK
79 uint64_t stack_limit;
80#endif
81 uint8_t exception_depth;
82 /* Keep large structures at the end to avoid offset issues */
83#ifdef CONFIG_FPU_SHARING
84 struct z_arm64_fp_context saved_fp_context;
85#endif
86#ifdef CONFIG_ARM_PAC_PER_THREAD
87 struct pac_keys pac_keys;
88#endif
89};
90
91typedef struct _thread_arch _thread_arch_t;
92
93#endif /* _ASMLANGUAGE */
94
95#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_THREAD_H_ */
#define ARM64_MPU_MAX_DYNAMIC_REGIONS
Definition arm_mpu.h:256
long atomic_t
Definition atomic_types.h:15
ARM64 Pointer Authentication (PAC) internal APIs.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88