1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
20 #include <sys/queue.h>
23 #if ( OS_SC1 == STD_ON ) || ( OS_SC4 == STD_ON )
\r
24 typedef void ( * trusted_func_t)( TrustedFunctionIndexType , TrustedFunctionParameterRefType );
\r
28 /* STD container : OsOs. OSEK properties
31 * OsScalabilityClass: 0..1 SC1,SC2,SC3,SC4
32 * OsStackMonitoring: 1 Stack monitoring of tasks/category 2
33 * OsStatus 1 EXTENDED or STANDARD status
34 * OsUseGetServiceId 1 We can use the OSErrorGetServiceId() function
35 * OsUseParameterAccess 1 We save the parameters in OSError_XX_YY()
45 * SHUTDOWNHOOK = TRUE;
46 * PRETASKHOOK = FALSE;
47 * POSTTASKHOOK = FALSE;
48 * USEGETSERVICEID = FALSE;
49 * USEPARAMETERACCESS = FALSE;
50 * USERESSCHEDULER = TRUE;
53 * OS_SC1 | OS_SC2 | OS_SC3 | OS_SC4
55 * OS_STATUS_EXTENDED / OS_STATUS_STANDARD
56 * OS_USE_GET_SERVICE_ID
57 * OS_USE_PARAMETER_ACCESS
63 /* External resource */
\r
64 RESOURCE_TYPE_STANDARD,
\r
66 RESOURCE_TYPE_LINKED,
\r
67 /* Internal resource */
68 RESOURCE_TYPE_INTERNAL
\r
69 } OsResourceTypeType;
\r
73 OsResourceTypeType type;
\r
74 /* used only if type is RESOURCE_TYPE_LINKED */
\r
75 ResourceType linked_resource;
\r
76 } OsResourcePropertyType;
\r
78 /*-----------------------------------------------------------------*/
\r
79 typedef struct OsResource {
\r
81 // The running number, starting at RES_SCHEDULER=0
\r
83 // The calculated ceiling prio
\r
84 uint32 ceiling_priority;
\r
85 // Stored prio of the owner oi the resource
\r
86 uint32 old_task_prio;
\r
88 // What application may access this resource. A resource may only be
\r
89 // accessed by one application
\r
90 uint32 application_owner_id;
\r
91 // What tasks may access this resource. A resource may be be shared
\r
94 // Owner of the resource...
\r
97 OsResourceTypeType type;
\r
98 // used only if type is RESOURCE_TYPE_LINKED
\r
99 ResourceType linked_resource;
\r
101 /* List of resources for each task. */
102 TAILQ_ENTRY(OsResource) listEntry;
\r
107 LOCK_TYPE_RESOURCE,
\r
108 LOCK_TYPE_INTERRUPT,
\r
111 typedef struct OsLockingtime {
\r
112 OsLocktypeType type;
\r
124 } OsLockingtimeType;
\r
126 typedef struct OsTimingProtection {
\r
127 // ROM, worst case execution budget in ns
\r
128 uint64 execution_budget;
\r
129 // ROM, the frame in ns that timelimit may execute in.
\r
131 // ROM, time in ns that the task/isr may with a timeframe.
\r
133 // ROM, resource/interrupt locktimes
\r
134 OsLockingtimeType *lockingtime;
\r
135 } OsTimingProtectionType;
\r
138 #include "counter_i.h"
140 #include "sched_table_i.h"
141 #include "application.h"
145 /*-----------------------------------------------------------------*/
\r
148 /*-----------------------------------------------------------------*/
\r
150 * debug settings for os_debug_mask
\r
154 #define OS_DBG_MASTER_PRINT (1<<0)
\r
155 #define OS_DBG_ISR_MASTER_PRINT (1<<1)
\r
156 #define OS_DBG_STDOUT (1<<2)
\r
157 #define OS_DBG_ISR_STDOUT (1<<3)
\r
159 // Enable print dbg_XXXX (not dbg_isr_XXX though)
\r
160 #define D_MASTER_PRINT (1<<0)
\r
161 // Enable print for all dbg_isr_XXX
\r
162 #define D_ISR_MASTER_PRINT (1<<1)
\r
163 // print to STDOUT. If not set it prints to ramlog
\r
164 #define D_STDOUT (1<<2)
\r
166 // print to STDOUT, If not set print to ramlog
\r
167 #define D_ISR_STDOUT (1<<3)
\r
168 #define D_ISR_RAMLOG 0
\r
170 #define D_TASK (1<<13)
\r
171 #define D_ALARM (1<<14)
\r
173 #define OS_DBG_TASK (1<<13)
\r
174 #define OS_DBG_ALARM (1<<14)
\r
176 #endif /* KERNEL_H_ */
\r