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 #if (OS_ALARM_CNT!=0)
\r
40 OS_VALIDATE(OS_COUNTER_CNT,ARRAY_SIZE(counter_list));
\r
42 #if (RESOURCE_CNT!=0)
\r
43 OS_VALIDATE(OS_RESOURCE_CNT,ARRAY_SIZE(resource_list));
\r
45 OS_VALIDATE(OS_TASK_CNT ,ARRAY_SIZE(rom_pcb_list));
\r
46 #if (RESOURCE_CNT!=0)
\r
47 OS_VALIDATE(OS_ALARM_CNT,ARRAY_SIZE(alarm_list));
\r
49 #if (OS_SCHTBL_CNT!=0)
\r
50 OS_VALIDATE(OS_SCHTBL_CNT, ARRAY_SIZE(sched_list));
\r
54 OsErrorType os_error;
\r
56 //-------------------------------------------------------------------
\r
60 * Accessor functions for os_config.c
\r
65 trusted_func_t oil_trusted_func_list[SERVICE_CNT];
\r
69 /*-----------------------------------------------------------------*/
\r
70 #if ( OS_SC3 == STD_ON) || ( OS_SC4==STD_ON)
\r
71 int Os_CfgGetApplCnt(void) {
\r
72 return APPLICATION_CNT;
\r
75 OsRomApplicationType *Os_CfgGetApplObj( ApplicationType application_id ) {
\r
76 return &rom_app_list[application_id];
\r
80 /*-----------------------------------------------------------------*/
\r
82 OsResourceType *Os_CfgGetResource( ResourceType resource ) {
\r
83 #if OS_RESOURCE_CNT!=0
\r
84 return &resource_list[resource];
\r
90 /*-----------------------------------------------------------------*/
\r
92 OsCounterType *Os_CfgGetCounter(CounterType count_id) {
\r
93 return &counter_list[count_id];
\r
96 /*-----------------------------------------------------------------*/
\r
98 OsSchTblType *Os_CfgGetSched( ScheduleTableType sched_id ) {
\r
99 #if (OS_SCHTBL_CNT!=0)
\r
100 if(sched_id < OS_SCHTBL_CNT) {
\r
101 return &sched_list[sched_id];
\r
110 /*-----------------------------------------------------------------*/
\r
112 OsAlarmType *Os_CfgGetAlarmObj( AlarmType alarm_id ) {
\r
113 #if (OS_ALARM_CNT!=0)
\r
114 if( alarm_id < OS_ALARM_CNT) {
\r
115 return &alarm_list[alarm_id];
\r
124 StatusType Os_CfgGetAlarmBase(AlarmType alarm_id, AlarmBaseRefType info) {
\r
126 StatusType rv = E_OK;
\r
128 if( alarm_id >= OS_ALARM_CNT ) {
\r
131 #if (OS_ALARM_CNT!=0)
\r
132 *info = alarm_list[alarm_id].counter->alarm_base;
\r
139 /*-----------------------------------------------------------------*/
\r
142 OsMessageType *Os_CfgGetMessage(MessageType message_id) {
\r
143 #if (OS_MESSAGE_CNT!=0)
\r
144 return &message_list[message_id];
\r
150 uint32 Os_CfgGetMessageCnt(void ) {
\r
151 return OS_MESSAGE_CNT;
\r
155 /*-----------------------------------------------------------------*/
\r
157 #if ( OS_SC3 == STD_ON) || ( OS_SC4 == STD_ON)
\r
158 uint32 Os_CfgGetServiceCnt( void ) {
\r
159 return SERVICE_CNT;
\r
164 /*-----------------------------------------------------------------*/
\r
166 void Os_CfgGetInterruptStackInfo( OsStackType *stack ) {
\r
167 stack->top = os_interrupt_stack;
\r
168 stack->size = sizeof(os_interrupt_stack);
\r