1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
16 * This file only be use with the Os_Cfg.c file and os_config_macros.h
\r
22 #if (OS_SC3 == STD_ON) || (OS_SC4 == STD_ON)
\r
23 #if (OS_STATUS_STANDARD == STD_ON )
\r
24 #error req OS327 not fullfilled
\r
29 // COUNTER, RESOURCE, TSAK, must be at least 1
\r
31 #define OS_VALIDATE(_a,_b) if((_a)!=(_b) ) { \
\r
38 void Os_CfgValidate(void ) {
\r
39 OS_VALIDATE(OS_COUNTER_CNT,ARRAY_SIZE(counter_list));
\r
40 #if (RESOURCE_CNT!=0)
\r
41 OS_VALIDATE(OS_RESOURCE_CNT,ARRAY_SIZE(resource_list));
\r
43 OS_VALIDATE(OS_TASK_CNT ,ARRAY_SIZE(rom_pcb_list));
\r
44 #if (RESOURCE_CNT!=0)
\r
45 OS_VALIDATE(OS_ALARM_CNT,ARRAY_SIZE(alarm_list));
\r
47 #if (OS_SCHTBL_CNT!=0)
\r
48 OS_VALIDATE(OS_SCHTBL_CNT, ARRAY_SIZE(sched_list));
\r
52 OsErrorType os_error;
\r
54 //-------------------------------------------------------------------
\r
58 * Accessor functions for os_config.c
\r
63 trusted_func_t oil_trusted_func_list[SERVICE_CNT];
\r
67 /*-----------------------------------------------------------------*/
\r
68 #if ( OS_SC3 == STD_ON) || ( OS_SC4==STD_ON)
\r
69 int Os_CfgGetApplCnt(void) {
\r
70 return APPLICATION_CNT;
\r
73 OsRomApplicationType *Os_CfgGetApplObj( ApplicationType application_id ) {
\r
74 return &rom_app_list[application_id];
\r
78 /*-----------------------------------------------------------------*/
\r
80 OsResourceType *Os_CfgGetResource( ResourceType resource ) {
\r
81 #if OS_RESOURCE_CNT!=0
\r
82 return &resource_list[resource];
\r
88 /*-----------------------------------------------------------------*/
\r
90 OsCounterType *Os_CfgGetCounter(CounterType count_id) {
\r
91 return &counter_list[count_id];
\r
94 /*-----------------------------------------------------------------*/
\r
96 OsSchTblType *Os_CfgGetSched( ScheduleTableType sched_id ) {
\r
97 #if (OS_SCHTBL_CNT!=0)
\r
98 if(sched_id < OS_SCHTBL_CNT) {
\r
99 return &sched_list[sched_id];
\r
108 /*-----------------------------------------------------------------*/
\r
110 OsAlarmType *Os_CfgGetAlarmObj( AlarmType alarm_id ) {
\r
111 #if (OS_ALARM_CNT!=0)
\r
112 if( alarm_id < OS_ALARM_CNT) {
\r
113 return &alarm_list[alarm_id];
\r
122 StatusType Os_CfgGetAlarmBase(AlarmType alarm_id, AlarmBaseRefType info) {
\r
124 StatusType rv = E_OK;
\r
126 if( alarm_id >= OS_ALARM_CNT ) {
\r
129 #if (OS_ALARM_CNT!=0)
\r
130 *info = alarm_list[alarm_id].counter->alarm_base;
\r
137 /*-----------------------------------------------------------------*/
\r
140 OsMessageType *Os_CfgGetMessage(MessageType message_id) {
\r
141 #if (OS_MESSAGE_CNT!=0)
\r
142 return &message_list[message_id];
\r
148 uint32 Os_CfgGetMessageCnt(void ) {
\r
149 return OS_MESSAGE_CNT;
\r
153 /*-----------------------------------------------------------------*/
\r
155 #if ( OS_SC3 == STD_ON) || ( OS_SC4 == STD_ON)
\r
156 uint32 Os_CfgGetServiceCnt( void ) {
\r
157 return SERVICE_CNT;
\r
162 /*-----------------------------------------------------------------*/
\r
164 void Os_CfgGetInterruptStackInfo( OsStackType *stack ) {
\r
165 stack->top = os_interrupt_stack;
\r
166 stack->size = sizeof(os_interrupt_stack);
\r