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 ------------------------------*/
25 * This file only be use with the Os_Cfg.c file and os_config_macros.h
\r
30 // COUNTER, RESOURCE, TSAK, must be at least 1
\r
31 #define COUNTER_CNT ARRAY_SIZE(counter_list)
\r
32 #define RESOURCE_CNT ARRAY_SIZE(resource_list)
\r
33 #define TASK_CNT ARRAY_SIZE(rom_pcb_list)
\r
35 #if defined(ALARM_USE)
\r
36 #define ALARM_CNT ARRAY_SIZE(alarm_list)
\r
41 #if defined(SCHEDULETABLE_USE)
\r
42 #define SCHEDULETABLE_CNT ARRAY_SIZE(sched_list)
\r
44 #define SCHEDULETABLE_CNT 0
\r
47 #if defined(MESSAGE_CNT)
\r
49 #define MESSAGE_CNT ARRAY_SIZE(message_list)
\r
51 #define MESSAGE_CNT 0
\r
54 #if defined(EVENT_CNT)
\r
56 #define EVENT_CNT ARRAY_SIZE(event_list)
\r
61 #if defined(SERVICE_CNT)
\r
63 #define SERVICE_CNT ARRAY_SIZE(os_cfg_trusted_list)
\r
65 #define SERVICE_CNT 0
\r
68 os_error_t os_error;
\r
70 //-------------------------------------------------------------------
\r
74 * Accessor functions for os_config.c
\r
79 trusted_func_t oil_trusted_func_list[SERVICE_CNT];
\r
83 /*-----------------------------------------------------------------*/
\r
84 int Oil_GetApplCnt(void) {
\r
85 return APPLICATION_CNT;
\r
88 rom_app_t *Oil_GetApplObj( ApplicationType application_id ) {
\r
89 return &rom_app_list[application_id];
\r
92 /*-----------------------------------------------------------------*/
\r
93 int Oil_GetTaskCnt(void) {
\r
96 /*-----------------------------------------------------------------*/
\r
98 resource_obj_t *Oil_GetResource( ResourceType resource ) {
\r
99 return &resource_list[resource];
\r
102 int Oil_GetResourceCnt() {
\r
103 return RESOURCE_CNT;
\r
106 /*-----------------------------------------------------------------*/
\r
108 counter_obj_t *Oil_GetCounter(CounterType count_id) {
\r
109 return &counter_list[count_id];
\r
112 uint32 Oil_GetCounterCnt(void ) {
\r
113 return COUNTER_CNT;
\r
114 // return sizeof(counter_list)/sizeof(counter_obj_t);
\r
116 /*-----------------------------------------------------------------*/
\r
118 uint32 Oil_GetSchedCnt( void ) {
\r
119 return SCHEDULETABLE_CNT;
\r
122 sched_table_t *Oil_GetSched( ScheduleTableType sched_id ) {
\r
123 #if defined(SCHEDULETABLE_USE)
\r
124 if(sched_id < SCHEDULETABLE_CNT) {
\r
125 return &sched_list[sched_id];
\r
134 /*-----------------------------------------------------------------*/
\r
136 uint32 Oil_GetAlarmCnt(void) {
\r
140 alarm_obj_t *Oil_GetAlarmObj( AlarmType alarm_id ) {
\r
141 #if defined(ALARM_USE)
\r
142 if( alarm_id < ALARM_CNT) {
\r
143 return &alarm_list[alarm_id];
\r
152 StatusType Oil_GetAlarmBase(AlarmType alarm_id, AlarmBaseRefType info) {
\r
154 StatusType rv = E_OK;
\r
156 if( alarm_id >= Oil_GetAlarmCnt() ) {
\r
159 #if defined(ALARM_USE)
\r
160 *info = alarm_list[alarm_id].counter->alarm_base;
\r
166 /*-----------------------------------------------------------------*/
\r
168 message_obj_t *Oil_GetMessage(MessageType message_id) {
\r
170 return &message_list[message_id];
\r
176 uint32 Oil_GetMessageCnt(void ) {
\r
177 return MESSAGE_CNT;
\r
180 /*-----------------------------------------------------------------*/
\r
182 uint32 Oil_GetServiceCnt( void ) {
\r
183 return SERVICE_CNT;
\r
187 /*-----------------------------------------------------------------*/
\r
189 void Oil_GetInterruptStackInfo( stack_t *stack ) {
\r
190 stack->top = os_interrupt_stack;
\r
191 stack->size = sizeof(os_interrupt_stack);
\r