Debian Codegraph @

test/system/test_compilation/osek.h

raw symbols SCIP
1 /* ==========================================
2 CMock Project - Automatic Mock Generation for C
3 Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4 [Released under MIT License. Please refer to license.txt for details]
5 ========================================== */
6
7 typedef unsigned char OSServiceIdType;
8 typedef void (*OSEKOS_VOIDFUNCPTR)(void);
9
10 typedef unsigned char StatusType;
11 typedef unsigned char OSEK_U8;
12 typedef unsigned short OSEK_U16;
13 typedef unsigned long OSEK_U32;
14
15 void OSEKOSDisableAll(void);
16 void OSEKOSEnableAll(void);
17
18 typedef unsigned long * OSEKOSSaveType;
19 typedef void OSEK_TASK;
20 typedef OSEK_U8 OSEKOSPrioType;
21
22 enum {
23 Task_DbgCAN
24 ,
25 Task_ALS
26 ,
27 CalibrateMagTask
28 ,
29 Task_IAQ
30 ,
31 SmartBeam
32 ,
33 Task_QbertTestImage
34 ,
35 Task_TestQbertMem
36 ,
37 Task_Cyclic1000
38 ,
39 ProcessMagForCompass
40 ,
41 ReadMag
42 ,
43 Task_Cyclic10
44 ,
45 Task_Wdm
46 ,
47 BackgroundTask
48 ,
49 Task_Cyclic20
50 ,
51 Task_Cyclic2
52 };
53
54 OSEK_TASK OSEKOS_T_Task_DbgCAN(void);
55 OSEK_TASK OSEKOS_T_Task_ALS(void);
56 OSEK_TASK OSEKOS_T_CalibrateMagTask(void);
57 OSEK_TASK OSEKOS_T_Task_IAQ(void);
58 OSEK_TASK OSEKOS_T_SmartBeam(void);
59 OSEK_TASK OSEKOS_T_Task_QbertTestImage(void);
60 OSEK_TASK OSEKOS_T_Task_TestQbertMem(void);
61 OSEK_TASK OSEKOS_T_Task_Cyclic1000(void);
62 OSEK_TASK OSEKOS_T_ProcessMagForCompass(void);
63 OSEK_TASK OSEKOS_T_ReadMag(void);
64 OSEK_TASK OSEKOS_T_Task_Cyclic10(void);
65 OSEK_TASK OSEKOS_T_Task_Wdm(void);
66 OSEK_TASK OSEKOS_T_BackgroundTask(void);
67 OSEK_TASK OSEKOS_T_Task_Cyclic20(void);
68 OSEK_TASK OSEKOS_T_Task_Cyclic2(void);
69 OSEK_TASK OSEKOS_Twrap_Task_DbgCAN(void);
70 OSEK_TASK OSEKOS_Twrap_Task_ALS(void);
71 OSEK_TASK OSEKOS_Twrap_CalibrateMagTask(void);
72 OSEK_TASK OSEKOS_Twrap_Task_IAQ(void);
73 OSEK_TASK OSEKOS_Twrap_SmartBeam(void);
74 OSEK_TASK OSEKOS_Twrap_Task_QbertTestImage(void);
75 OSEK_TASK OSEKOS_Twrap_Task_TestQbertMem(void);
76 OSEK_TASK OSEKOS_Twrap_Task_Cyclic1000(void);
77 OSEK_TASK OSEKOS_Twrap_ProcessMagForCompass(void);
78 OSEK_TASK OSEKOS_Twrap_ReadMag(void);
79 OSEK_TASK OSEKOS_Twrap_Task_Cyclic10(void);
80 OSEK_TASK OSEKOS_Twrap_Task_Wdm(void);
81 OSEK_TASK OSEKOS_Twrap_BackgroundTask(void);
82 OSEK_TASK OSEKOS_Twrap_Task_Cyclic20(void);
83 OSEK_TASK OSEKOS_Twrap_Task_Cyclic2(void);
84
85 typedef OSEK_U8 TaskType;
86 typedef OSEK_U8 TaskStateType;
87 typedef OSEK_U16 EventMaskType;
88 typedef OSEK_U8 ResourceType;
89
90 void OSEKOSEnableSystemTimers(void);
91
92 typedef OSEK_U8 CounterType;
93 typedef OSEK_U32 TickType;
94 typedef OSEK_U8 AlarmType;
95
96 void OSEKOS_ISR_CanTxInterrupt(void);
97 void OSEKOS_ISR_CanRxInterrupt(void);
98 void OSEKOS_ISR_CanErrInterrupt(void);
99 void OSEKOS_ISR_SCIRxInterrupt(void);
100 void OSEKOS_ISR_SCITxInterrupt(void);
101 void OSEKOS_ISR_UP_DMA_Interrupt_0(void);
102 void OSEKOS_ISR_UP_DMA_Interrupt_1(void);
103 void OSEKOS_ISR_UP_DMA_Interrupt_2(void);
104 void OSEKOS_ISR_UP_DMA_Interrupt_3(void);
105 void OSEKOS_ISR_CompFreqHandler(void);
106 void OSEKOS_ISR_AmbientReturnInt(void);
107 void OSEKOS_ISR_GlareReturnInt(void);
108 void OSEKOS_ISR_ALSTimeoutInt(void);
109 void OSEKOS_ISR_LINTimerInt(void);
110 void OSEKOS_ISR_LINDelayInt(void);
111 void OSEKOS_ISR_TimerMExpire(void);
112 void OSEKOS_ISR_LINRxTx_SCI1(void);
113 void OSEKOS_ISR_CanRxInterrupt_1(void);
114 void OSEKOS_ISR_LINError_SCI1(void);
115 void OSEKOS_ISR_SysCounter(void);
116
117
118 // defined multiple times (slightly different forms) These should be ignored because they are externed
119 extern void OSEKOS_ISR_CanTxInterrupt( void );
120 extern void OSEKOS_ISR_CanRxInterrupt( void );
121
122
123 unsigned long OSEKOSrtcGetSeconds ( void );
124 void OSEKOSrtcIncrement ( unsigned long nsec );
125
126 enum
127 {
128 E_OS_ACCESS = 1,
129 E_OS_CALLEVEL = 2,
130 E_OS_ID = 3,
131 E_OS_LIMIT = 4,
132 E_OS_NOFUNC = 5,
133 E_OS_RESOURCE = 6,
134 E_OS_STATE = 7,
135 E_OS_VALUE = 8,
136 E_OS_SYS_StackOverflow = 20,
137 E_OS_SYS_StackUnderflow = 21,
138 E_OS_SYS_INIT = 22,
139 E_OS_SYS_CONFIG = 23,
140 E_OS_SYS_CODE = 24,
141 E_OS_SYS_TOOL = 25,
142 E_OS_SYS_TimerRange = 26
143 };
144
145 enum
146 {
147 SUSPENDED = 0x00,
148 READY = 0x01,
149 RUNNING = 0x02,
150 WAITING = 0x03,
151 INTSTART = 0x08,
152 SETSTART = 0x10,
153 NPRTASK = 0x20,
154 USEFP = 0x40
155 };
156
157 typedef struct
158 {
159 TickType maxallowedvalue;
160 TickType ticksperbase;
161 } AlarmBaseType;
162
163 typedef TaskType *TaskRefType;
164 typedef TaskStateType *TaskStateRefType;
165 typedef EventMaskType *EventMaskRefType;
166 typedef TickType *TickRefType;
167 typedef AlarmBaseType *AlarmBaseRefType;
168 typedef OSEK_U8 AppModeType;
169 typedef OSEK_U8 OSEKOSTaskActCntType;
170
171 TaskType OSEKOStidact;
172 OSEKOSPrioType OSEKOSrunprio;
173
174 StatusType OSEKOSError ( register StatusType );
175 void ErrorHook ( StatusType );
176 void StartupHook ( void );
177 void ShutdownHook ( StatusType );
178
179 int getUsedTaskStack ( TaskType );
180 int getUnusedTaskStack ( TaskType );
181 int getUsedIsrStack ( void );
182 int getUnusedIsrStack ( void );
183 void OSEKOStaskStackCheckInit ( void );
184 signed char OSEKOStaskStackCheck ( OSEK_U8 * );
185 signed char OSEKOSisrStackCheck ( OSEK_U8 * );
186 void OSEKOStaskStackCheckFatal ( OSEK_U8 * );
187 void OSEKOSisrStackCheckFatal ( OSEK_U8 * );
188 OSEK_U8 * OSEKOSgetStackPointer ( void );
189 void OSEKOSTaskSwitch ( void );
190 StatusType OSEKOSReturn ( StatusType );
191 StatusType OSEKOSActivateTask ( register TaskType );
192 void OSEKOSTerminateTask ( TaskType, TaskType );
193
194 extern void OSEKOSGetResource ( ResourceType );
195 extern void OSEKOSReleaseResource ( ResourceType );
196
197 int OSEKOSSetEvent ( TaskType, EventMaskType );
198 int OSEKOSWaitEvent ( EventMaskType );
199 TickType OSEKOSGetAlarm(register AlarmType);
200 void OSEKOSSetAlarm ( AlarmType, TickType, TickType );
201 StatusType OSEKOSSetAbsAlarm ( AlarmType a, TickType b, TickType c );
202
203 StatusType OSEKOSCancelAlarm ( register AlarmType );
204 void OSEKOSAdvCntr ( void );
205 AppModeType GetActiveApplicationMode ( void );
206
207 void StartOS ( AppModeType );
208
209 void OSEKOSShutdownOS ( StatusType );
210
211 StatusType ActivateTask ( TaskType A );
212 StatusType TerminateTask ( void );
213 StatusType ChainTask ( TaskType A );
214 StatusType GetTaskState ( TaskType A, TaskStateRefType B );
215 StatusType GetTaskID ( TaskRefType A );
216 StatusType Schedule ( void );
217 StatusType GetResource ( ResourceType A );
218 StatusType ReleaseResource ( ResourceType A );
219 StatusType SetEvent ( TaskType A, EventMaskType B );
220 StatusType ClearEvent ( EventMaskType A );
221 StatusType WaitEvent ( EventMaskType A );
222 StatusType GetEvent ( TaskType A, EventMaskRefType B );
223 StatusType GetAlarm ( AlarmType A, TickRefType B );
224 StatusType GetAlarmBase ( AlarmType A, AlarmBaseRefType B );
225 StatusType SetRelAlarm ( AlarmType A, TickType B, TickType C );
226 StatusType SetAbsAlarm ( AlarmType A, TickType B, TickType C );
227 StatusType CancelAlarm ( AlarmType A );
228 StatusType AdvCntr ( CounterType A );
229 StatusType IAdvCntr ( CounterType A );
230 void SuspendOSInterrupts ( void );
231 void ResumeOSInterrupts ( void );
232 void SuspendAllInterrupts ( void );
233 void ResumeAllInterrupts ( void );
234 void DisableAllInterrupts ( void );
235 void EnableAllInterrupts ( void );
236
237 void OSEKOSDisable(void);
238 void OSEKOSEnable(void);
239 void OSEKOSAsmIDispatch(unsigned long *);
240 void OSEKOSAsmDispatch(OSEKOSPrioType p);
241 void OSEKOSStartupEnable(void);
242 void OSEKOSNop(void);
243 unsigned int OSEKOSV850CheckIsrSwitch(void);
244 void OSEKOSV850InitInterrupts(void);
245 void OSEKOSV850SetupInterrupts();
246 void OSEKOSV850SyncContextLoad(OSEKOSSaveType);
247 void OSEKOSV850SyncContextLoadFromIRQ(OSEKOSSaveType);
248 void OSEKOSV850ASyncContextLoad(OSEKOSSaveType);
249 void OSEKOSV850ASyncContextLoadFromIRQ(OSEKOSSaveType);
250
251 // arrays of function pointers - they look like function prototypes
252 void ( ( * const OSEKOStaskStartAddress [10] ) ( void ) );
253 StatusType (* OSEKOStaskStatuses [10][5]) ( void );
254
255 void OSEKOSV850StartContext
256 (
257 OSEK_TASK (( * const ) ( void )),
258 OSEK_U8 * const
259 );
260 void OSEKOSV850StartContextFromIRQ
261 (
262 OSEK_TASK (( * const ) ( void )),
263 OSEK_U8 * const
264 );
265
266 void OSEKOSSuspendOSInterrupts(void);
267 void OSEKOSResumeOSInterrupts(void);
268 void OSEKOSSuspendAllInterrupts(void);
269 void OSEKOSResumeAllInterrupts(void);
270 void OSEKOScheckSuspendResumeNesting(void);
271
272
273 void OSEKOSgetSR(void);
274 void OSEKOSEnableInterrupt_intern(int nr);
275 void OSEKOSDisableInterrupt_intern(int nr);