/** * @file % !FILENAME % * * @section desc File description * * Header of the automatic generated defines usable * by the application % !CPUNAME % * Automatically generated by goil on % !TIMESTAMP % * from root OIL file % !OILFILENAME % * * @section copyright Copyright * * Trampoline OS * * Trampoline is copyright (c) IRCCyN 2005-2010 * Trampoline is protected by the French intellectual property law. * * This software is distributed under the Lesser GNU Public Licence * * @section infos File informations * * $Date$ * $Rev$ * $Author$ * $URL$ */ #ifndef TPL_APP_DEFINE_H #define TPL_APP_DEFINE_H %template if exists tpl_app_define_custom % #include "tpl_config_def.h" /*============================================================================= * Configuration flags */ #define TARGET_ARCH "% !ARCH %" #define TARGET_CHIP "% !CHIP %" #define TARGET_BOARD "% !BOARD %" #define NUMBER_OF_CORES % !exists OS::NUMBER_OF_CORES default (1) % #define WITH_OS_EXTENDED % !yesNo(OS::STATUS == "EXTENDED") % #define WITH_ORTI % !yesNo(OS::WITHORTI) % #define WITH_PAINT_STACK % !yesNo(OS::PAINT_STACK) % #define WITH_PAINT_REGISTERS % !yesNo(OS::PAINT_REGISTERS) % #define WITH_STARTUP_HOOK % !yesNo(OS::STARTUPHOOK) % #define WITH_SHUTDOWN_HOOK % !yesNo(OS::SHUTDOWNHOOK) % #define WITH_ERROR_HOOK % !yesNo(OS::ERRORHOOK) % #define WITH_PRE_TASK_HOOK % !yesNo(OS::PRETASKHOOK) % #define WITH_POST_TASK_HOOK % !yesNo(OS::POSTTASKHOOK) % #define WITH_ANY_HOOK % !yesNo(OS::STARTUPHOOK | OS::SHUTDOWNHOOK | OS::ERRORHOOK | OS::PRETASKHOOK | OS::POSTTASKHOOK) % #define WITH_PANIC_HOOK % !yesNo(OS::PANICHOOK) % #define WITH_USEGETSERVICEID % !yesNo(OS::USEGETSERVICEID) % #define WITH_USEPARAMETERACCESS % !yesNo(OS::USEPARAMETERACCESS) % #define WITH_USERESSCHEDULER % !yesNo(OS::USERESSCHEDULER) % #define WITH_SYSTEM_CALL % !yesNo(OS::SYSTEM_CALL) % #define WITH_MEMORY_PROTECTION % !yesNo(USEMEMORYPROTECTION) % #define WITH_MEMMAP % !yesNo(OS::MEMMAP) % #define WITH_COMPILER_SETTINGS % !yesNo(OS::MEMMAP) if exists OS::BUILD_S::TRAMPOLINEPATH then% #define TRAMPOLINE_BASE_PATH "% !TRAMPOLINEPATH %"% end if% #define WITH_AUTOSAR % !yesNo(AUTOSAR) % #define WITH_PROTECTION_HOOK % !yesNo(exists OS::PROTECTIONHOOK default(false)) % #define WITH_STACK_MONITORING % !yesNo(exists OS::STACKMONITORING default(false)) % #define WITH_AUTOSAR_TIMING_PROTECTION % !yesNo(exists OS::TIMINGPROTECTION default(false)) % #define AUTOSAR_SC % !OS::SCALABILITYCLASS % #define WITH_OSAPPLICATION % !yesNo(OS::SCALABILITYCLASS > 2)% #define WITH_OSAPPLICATION_STARTUP_HOOK % !yesNo(OS::APPLICATIONSTARTUPHOOK > 0) % #define WITH_OSAPPLICATION_SHUTDOWN_HOOK % !yesNo(OS::APPLICATIONSHUTDOWNHOOK > 0) % #define WITH_TRACE % !yesNo(OS::TRACE) % #define WITH_ID % !yesNo(OS::TRACE) if OS::TRACE then% #define TRACE_PROC % !yesNo(OS::TRACE_S::PROC | OS::TRACE_S::EVENT) % #define TRACE_RES % !yesNo(OS::TRACE_S::RESOURCE) % #define TRACE_EVENT % !yesNo(OS::TRACE_S::EVENT) % #define TRACE_ALARM % !yesNo(OS::TRACE_S::ALARM) % #define TRACE_MESSAGE % !yesNo(OS::TRACE_S::MESSAGE) % #define TRACE_IOC % !yesNo(OS::TRACE_S::IOC) % #define TRACE_FORMAT TRACE_FORMAT_% ![OS::TRACE_S::FORMAT uppercaseString] end if % #define WITH_IT_TABLE % !yesNo(OS::INTERRUPTTABLE)% #define WITH_COM % !yesNo(USECOM) if USECOM then% #define TPL_COMTIMEBASE % !(exists COM::COMTIMEBASE default ("0.001")) % #define WITH_COM_ERROR_HOOK % !yesNo(exists COM::COMERRORHOOK default (false)) % #define WITH_COM_USEGETSERVICEID % !yesNo(exists COM::COMUSEGETSERVICEID default (false)) % #define WITH_COM_USEPARAMETERACCESS % !yesNo(exists COM::COMUSEPARAMETERACCESS default (false)) % #define WITH_COM_STARTCOMEXTENSION % !yesNo(exists COM::COMSTARTCOMEXTENSION default (false)) % #define WITH_COM_EXTENDED % !yesNo((exists COM::COMSTATUS default ("COMSTANDARD")) == "COMEXTENDED") end if % #define WITH_IOC % !yesNo([ioc_reordered length] > 0) % #define WITH_MODULES_INIT NO #define WITH_INIT_BOARD % !yesNo(exists OS::INITBOARD default (false)) % #define WITH_ISR2_PRIORITY_MASKING % !yesNo(exists OS::ISR2_PRIORITY_MASKING default(false)) % /*============================================================================= * Defines related to the key part of a ready list entry. * The key part has in the most significant bits the priority of the job and * in the least significant bits the rank of the job. So: * - PRIORITY_SHIFT is the number of bit the key has to be shifted to the * right) to get the priority only aligned to the right; * - PRIORITY_MASK is the mask to get the priority only (not aligned to the * right with the rank set to 0; * - RANK_MASK is the mask to get only the rank. */ #define PRIORITY_SHIFT % !PRIORITY_SHIFT % #define PRIORITY_MASK % !PRIORITY_MASK % #define RANK_MASK % !RANK_MASK % /*============================================================================= * Number of objects used by the application * These informations are used by Trampoline to avoid to * alloc structures when some os objects are not present. */ % if OS::NUMBER_OF_CORES == 1 then %/*----------------------------------------------------------------------------- * Number of priority levels */ #define PRIO_LEVEL_COUNT % !NUMBER_OF_PRIORITIES % % end if % /*----------------------------------------------------------------------------- * Number of tasks */ #define TASK_COUNT % ![TASKS length] % /*----------------------------------------------------------------------------- * Number of spinlocks */ #define SPINLOCK_COUNT % ![SPINLOCK length] % /*----------------------------------------------------------------------------- * Number of extended tasks */ #define EXTENDED_TASK_COUNT % ![EXTENDEDTASKS length] % /*----------------------------------------------------------------------------- * Number of ISR2 */ #define ISR_COUNT % ![ISRS2 length] % /*----------------------------------------------------------------------------- * Number of alarms */ #define ALARM_COUNT % ![ALARMS length] % /*----------------------------------------------------------------------------- * Number of regular resources (standard and linked) plus RES_SCHEDULER if used */ #define RESOURCE_COUNT % let rez_count := [REGULARRESOURCES length] if OS::USERESSCHEDULER then let rez_count := rez_count + 1 end if !rez_count % /*----------------------------------------------------------------------------- * Number of events */ #define EVENT_COUNT % ![EVENTS length] % /*----------------------------------------------------------------------------- * Number of messages */ #define MESSAGE_COUNT % ![MESSAGES length] % /*----------------------------------------------------------------------------- * Number of send messages */ #define SEND_MESSAGE_COUNT % ![SENDMESSAGES length] % /*----------------------------------------------------------------------------- * Number of receive messages */ #define RECEIVE_MESSAGE_COUNT % ![RECEIVEMESSAGES length] % /*----------------------------------------------------------------------------- * Number of counters */ #define COUNTER_COUNT % ![COUNTERS length] % /*----------------------------------------------------------------------------- * Number of schedule tables */ #define SCHEDTABLE_COUNT % ![SCHEDULETABLES length] % /*----------------------------------------------------------------------------- * Number of OS Applications */ #define APP_COUNT % ![APPLICATIONS length] % /*----------------------------------------------------------------------------- * Number of trusted functions */ #define TRUSTED_FCT_COUNT % ![TRUSTEDFUNCTIONS length] % /*----------------------------------------------------------------------------- * Number of IOC */ % if [ioc_reordered length] > 0 then %#define IOC_COUNT % !ioc_total_count % #define IOC_QUEUED_COUNT % !ioc_queued_count % #define IOC_UNQUEUED_COUNT % !ioc_unqueued_count % %else %#define IOC_COUNT 0 #define IOC_QUEUED_COUNT 0 #define IOC_UNQUEUED_COUNT 0 %end if if OS::ISR2_PRIORITY_MASKING & [ISRS2 length] > 0 then % /*----------------------------------------------------------------------------- * Lowest priority of ISR2 */% sort ISRS2 by PRIORITY < let firstISR2 := [ISRS2 first] % #define ISR2_LOWEST_PRIO % !firstISR2::PRIORITY end if % /*----------------------------------------------------------------------------- * Priority of RES_SCHEDULER */ #define RES_SCHEDULER_PRIORITY % !OS::RESSCHEDULERPRIORITY % % if OS::NUMBER_OF_CORES > 1 then % /*----------------------------------------------------------------------------- * Core identifiers */% loop id from 0 to OS::NUMBER_OF_CORES - 1 do % #define OS_CORE_ID_% ! id % % ! id end loop % #define OS_CORE_ID_MASTER OS_CORE_ID_0 /*----------------------------------------------------------------------------- * Idle tasks identifiers */% loop id from 0 to OS::NUMBER_OF_CORES - 1 do % #define IDLE_TASK_% ! id %_ID TASK_COUNT + ISR_COUNT + % ! id end loop else % #define IDLE_TASK_ID TASK_COUNT + ISR_COUNT% end if % /*----------------------------------------------------------------------------- * To fasten the SPINLOCK_IS_SUCCESSOR macro */ #define SPINLOCK_SUCCESSOR_BITFIELD_SHIFT % !SPINLOCK_BITFIELD_SHIFT % #define SPINLOCK_SUCCESSOR_BITFIELD_MASK % !(SPINLOCK_BITFIELD_CELL_SIZE - 1) % /*----------------------------------------------------------------------------- * Spinlocks max possessed spinlocks per core. * This definition is used to maximize the size of possessed spinlocks. * In OSExtended mode, as we're checking nesting spinlocks, we can set the max * size of the LIFOS to the longest chain in the spinlocks graph. * In OSStandard mode, we set the maximum to the number of spinlocks (a * spinlock can only be taken once). */% if OS::STATUS == "EXTENDED" then% #define MAX_POSSESSED_SPINLOCKS % !max_possessed_spinlocks % %else% #define MAX_POSSESSED_SPINLOCKS % ![SPINLOCK length] % %end if % /*----------------------------------------------------------------------------- * Debugging */ #define WITH_DEBUG % !yesNo(OS::DEBUG) % #include "tpl_config_check.h" #endif /*----------------------------------------------------------------------------- * Configuration STM Flags */ #define NUMBER_OF_OBJECTS % ![OBJECT length] % #define NUMBER_OF_TRANSACTIONS % ![TRANSACTION length] % /*----------------------------------------------------------------------------- * Tick optimization */ #define TPL_OPTIMIZE_TICKS % !yesNo(exists OS::OPTIMIZETICKS default (false)) % % template if exists custom_app_define_h % /* End of file TPL_APP_DEFINE_H */