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
62 * STD container: OsResource
63 * OsResourceProperty: 1 INTERNAL, LINKED, STANDARD
64 * OsResourceAccessingApplication: 0..*
65 * OsResourceLinkedResourceRef: 0..1
69 /* External resource */
\r
70 RESOURCE_TYPE_STANDARD,//!< RESOURCE_TYPE_STANDARD
\r
72 RESOURCE_TYPE_LINKED, //!< RESOURCE_TYPE_LINKED
\r
73 /* Internal resource */
74 RESOURCE_TYPE_INTERNAL //!< RESOURCE_TYPE_INTERNAL
\r
75 } OsResourcePropertyType;
\r
77 /*-----------------------------------------------------------------*/
\r
78 typedef struct OsResource {
\r
80 // The running number, starting at RES_SCHEDULER=0
\r
82 // The calculated ceiling prio
\r
83 uint32 ceiling_priority;
\r
84 // Stored prio of the owner oi the resource
\r
85 uint32 old_task_prio;
\r
87 // What application may access this resource. A resource may only be
\r
88 // accessed by one application
89 #if ( OS_SC3 == STD_ON ) || ( OS_SC4 == STD_ON )
\r
90 uint32 application_owner_id;
92 // What tasks may access this resource. A resource may be be shared
\r
94 // uint32 task_mask;
\r
95 // Owner of the resource...
\r
98 OsResourcePropertyType type;
\r
99 // used only if type is RESOURCE_TYPE_LINKED
\r
100 ResourceType linked_resource;
\r
102 /* List of resources for each task. */
103 TAILQ_ENTRY(OsResource) listEntry;
\r
108 LOCK_TYPE_RESOURCE,
\r
109 LOCK_TYPE_INTERRUPT,
\r
112 typedef struct OsLockingtime {
\r
113 OsLocktypeType type;
\r
125 } OsLockingtimeType;
\r
127 typedef struct OsTimingProtection {
\r
128 // ROM, worst case execution budget in ns
\r
129 uint64 execution_budget;
\r
130 // ROM, the frame in ns that timelimit may execute in.
\r
132 // ROM, time in ns that the task/isr may with a timeframe.
\r
134 // ROM, resource/interrupt locktimes
\r
135 OsLockingtimeType *lockingtime;
\r
136 } OsTimingProtectionType;
\r
139 #include "counter_i.h"
141 #include "sched_table_i.h"
142 #include "application.h"
146 /*-----------------------------------------------------------------*/
\r
149 /*-----------------------------------------------------------------*/
\r
151 * debug settings for os_debug_mask
\r
155 #define OS_DBG_MASTER_PRINT (1<<0)
\r
156 #define OS_DBG_ISR_MASTER_PRINT (1<<1)
\r
157 #define OS_DBG_STDOUT (1<<2)
\r
158 #define OS_DBG_ISR_STDOUT (1<<3)
\r
160 // Enable print dbg_XXXX (not dbg_isr_XXX though)
\r
161 #define D_MASTER_PRINT (1<<0)
\r
162 // Enable print for all dbg_isr_XXX
\r
163 #define D_ISR_MASTER_PRINT (1<<1)
\r
164 // print to STDOUT. If not set it prints to ramlog
\r
165 #define D_STDOUT (1<<2)
\r
167 // print to STDOUT, If not set print to ramlog
\r
168 #define D_ISR_STDOUT (1<<3)
\r
169 #define D_ISR_RAMLOG 0
\r
171 #define D_TASK (1<<13)
\r
172 #define D_ALARM (1<<14)
\r
174 #define OS_DBG_TASK (1<<13)
\r
175 #define OS_DBG_ALARM (1<<14)
\r
177 #endif /* KERNEL_H_ */
\r