Repository navigation
Expand file tree
/
Copy pathos_cpu.h
More file actions
146 lines (121 loc) · 5.88 KB
/
Copy pathos_cpu.h
File metadata and controls
146 lines (121 loc) · 5.88 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*
*********************************************************************************************************
* uC/OS-III
* The Real-Time Kernel
*
* Copyright 2009-2020 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* ARMv7-R Port
*
* File : os_cpu.h
* Version : V3.08.00
*********************************************************************************************************
* For : ARMv7-R Cortex-R
* Mode : ARM or Thumb
* Toolchain : ARM C Compiler
*********************************************************************************************************
* Note(s) : (1) This port supports the entire 32-bit ARM Cortex-R line from the R4 to the R8
* with every possible VFP/NEON coprocessor option.
*
* (2) To support the various FPUs three versions of os_cpu_a.s are provided.
* Only one of them must be used at a time as outlined below.
*
* os_cpu_a_vfp-none.s
* Suitable when there is no VFP/NEON support or they are deactivated.
* Can also be used when saving the VFP/NEON register bank isn't required.
*
* os_cpu_a_vfp-d16.s
* Suitable for cpus with VFP support and 16 double word registers.
*********************************************************************************************************
*/
#ifndef OS_CPU_H
#define OS_CPU_H
#ifdef OS_CPU_GLOBALS
#define OS_CPU_EXT
#else
#define OS_CPU_EXT extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
*********************************************************************************************************
* EXCEPTION DEFINES
*********************************************************************************************************
*/
/* ARM exception IDs */
#define OS_CPU_ARM_EXCEPT_RESET 0x00u
#define OS_CPU_ARM_EXCEPT_UNDEF_INSTR 0x01u
#define OS_CPU_ARM_EXCEPT_SWI 0x02u
#define OS_CPU_ARM_EXCEPT_PREFETCH_ABORT 0x03u
#define OS_CPU_ARM_EXCEPT_DATA_ABORT 0x04u
#define OS_CPU_ARM_EXCEPT_ADDR_ABORT 0x05u
#define OS_CPU_ARM_EXCEPT_IRQ 0x06u
#define OS_CPU_ARM_EXCEPT_FIQ 0x07u
#define OS_CPU_ARM_EXCEPT_NBR 0x08u
/*
*********************************************************************************************************
* MACROS
*********************************************************************************************************
*/
#define OS_TASK_SW() OSCtxSw()
/*
*********************************************************************************************************
* TIMESTAMP CONFIGURATION
*
* Note(s) : (1) OS_TS_GET() is generally defined as CPU_TS_Get32() to allow CPU timestamp timer to be of
* any data type size.
*
* (2) For architectures that provide 32-bit or higher precision free running counters
* (i.e. cycle count registers):
*
* (a) OS_TS_GET() may be defined as CPU_TS_TmrRd() to improve performance when retrieving
* the timestamp.
*
* (b) CPU_TS_TmrRd() MUST be configured to be greater or equal to 32-bits to avoid
* truncation of TS.
*********************************************************************************************************
*/
#if OS_CFG_TS_EN == 1u
#define OS_TS_GET() (CPU_TS)CPU_TS_TmrRd() /* See Note #2a. */
#else
#define OS_TS_GET() (CPU_TS)0u
#endif
/*
*********************************************************************************************************
* GLOBAL VARIABLES
*********************************************************************************************************
*/
OS_CPU_EXT CPU_STK *OS_CPU_ExceptStkBase; /* Exception stack base */
OS_CPU_EXT CPU_INT32U OS_CPU_ARM_DRegCnt; /* VFP/NEON register count */
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
void OSCtxSw (void);
void OSIntCtxSw (void);
void OSStartHighRdy (void);
void OS_CPU_ARM_ExceptUndefInstrHndlr (void);
void OS_CPU_ARM_ExceptSwiHndlr (void);
void OS_CPU_ARM_ExceptPrefetchAbortHndlr (void);
void OS_CPU_ARM_ExceptDataAbortHndlr (void);
void OS_CPU_ARM_ExceptIrqHndlr (void);
void OS_CPU_ARM_ExceptFiqHndlr (void);
void OS_CPU_ExceptHndlr (CPU_INT32U src_id);
CPU_INT32U OS_CPU_ARM_DRegCntGet (void);
#ifdef __cplusplus
}
#endif
#endif