/** * @file % !FILENAME % * * @section desc File description * * OS data structure generated from application % !CPUNAME % * Automatically generated by goil on % !TIMESTAMP % * from root OIL file % !OILFILENAME % * * @section copyright Copyright * * Trampoline OS * * Trampoline is copyright (c) IRCCyN 2005-2007 * 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$ */ #include "tpl_ioc_api_config.h" #define API_START_SEC_CODE #include "tpl_memmap.h" /*============================================================================= * Implementation of IOC APIs */ % let iteration1 := 0 foreach ioc in ioc_reordered do % /*----------------------------------------------------------------------------- * OsIocCommunication % !ioc::NAME % */ % if ioc::SEMANTICS == "QUEUED" then %FUNC(StatusType, OS_CODE) IocSend% if [ioc::DATATYPENAME length] > 1 then %Group% end if %_% !ioc::NAME%( % elsif ioc::SEMANTICS == "LAST_IS_BEST" then %FUNC(StatusType, OS_CODE) IocWrite% if [ioc::DATATYPENAME length] > 1 then %Group% end if %_% !ioc::NAME%( % end if let iteration2 := 0 foreach TypeName in ioc::DATATYPENAME do if TypeName::DATATYPEPROPERTY == "DATA" then % VAR(% !TypeName::NAME %, AUTOMATIC) IN% !iteration2 else % P2VAR(% !TypeName::NAME %, AUTOMATIC, OS_APPL_DATA) IN% !iteration2 end if let iteration2 := iteration2 + 1 between %, % end foreach % ) { VAR(tpl_ioc_message, AUTOMATIC) message[% !iteration2 %]; VAR(StatusType, AUTOMATIC) result; % let iteration3 := 0 foreach TypeName in ioc::DATATYPENAME do if TypeName::DATATYPEPROPERTY == "DATA" then % message[% !iteration3 %].data=(tpl_ioc_data *)&IN% !iteration3 %; % else % message[% !iteration3 %].data=(tpl_ioc_data *)IN% !iteration3 %; % end if % message[% !iteration3 %].length=sizeof(% !TypeName::NAME %); % let iteration3 := iteration3 + 1 end foreach if ioc::SEMANTICS == "QUEUED" then % result = IOCSend(% !iteration1 %, message); % else % result = IOCWrite(% !iteration1 %, message); % end if % return result; } % if ioc::SEMANTICS == "QUEUED" then %FUNC(StatusType, OS_CODE) IocReceive% if [ioc::DATATYPENAME length] > 1 then %Group% end if %_% !ioc::NAME%( % elsif ioc::SEMANTICS == "LAST_IS_BEST" then %FUNC(StatusType, OS_CODE) IocRead% if [ioc::DATATYPENAME length] > 1 then %Group% end if %_% !ioc::NAME%( % end if let iteration2 := 0 foreach TypeName in ioc::DATATYPENAME do % P2VAR(% !TypeName::NAME %, AUTOMATIC, OS_APPL_DATA) IN% !iteration2 let iteration2 := iteration2 + 1 between %, % end foreach % ) { VAR(tpl_ioc_message, AUTOMATIC) message[% !iteration2 %]; VAR(StatusType, AUTOMATIC) result; % let iteration3 := 0 foreach TypeName in ioc::DATATYPENAME do % message[% !iteration3 %].data=(tpl_ioc_data *)IN% !iteration3 %; % % message[% !iteration3 %].length=sizeof(% !TypeName::NAME %); % let iteration3 := iteration3 + 1 end foreach if ioc::SEMANTICS == "QUEUED" then % result = IOCReceive(% !iteration1 %, message); % else % result = IOCRead(% !iteration1 %, message); % end if % return result; }% if ioc::SEMANTICS == "QUEUED" then % FUNC(StatusType, OS_CODE) IocEmptyQueue_% !ioc::NAME %(void) { VAR(StatusType, AUTOMATIC) result; result = IOCEmptyQueue(% !iteration1 %); return result; } % end if let iteration1 := iteration1 + 1 end foreach % #define API_STOP_SEC_CODE #include "tpl_memmap.h" /* End of file tpl_ioc_api_config.c */