fork(9) download
  1. /* Kernbauer Version: 1.16 Konfiguration: VStdLib Erzeugungsgangnummer: 1 */
  2.  
  3. /**********************************************************************************************************************
  4. | Project Name: vstdlib library
  5. | File Name: vstdlib_ll.h
  6. |
  7. | Description : Low level part of the implementation of standard Vector functions.
  8. | ARM core specific implementation.
  9. |
  10. |----------------------------------------------------------------------------------------------------------------------
  11. | C O P Y R I G H T
  12. |----------------------------------------------------------------------------------------------------------------------
  13. | Copyright (c) by Vector Informatik GmbH. All rights reserved.
  14. |
  15. | This software is copyright protected and proprietary to
  16. | Vector Informatik GmbH. Vector Informatik GmbH grants to you
  17. | only those rights as set out in the license conditions. All
  18. | other rights remain with Vector Informatik GmbH.
  19. |
  20. |----------------------------------------------------------------------------------------------------------------------
  21. | A U T H O R I D E N T I T Y
  22. |----------------------------------------------------------------------------------------------------------------------
  23. | Initials Name Company
  24. | -------- --------------------- ------------------------------------------------------------------------------
  25. | Ml Patrick Markl Vector Informatik GmbH
  26. | Fn Matthias Fleischmann Vector Informatik GmbH
  27. | Ard Thomas Arnold Vector Informatik GmbH
  28. | Hs Hannes Haas Vector Informatik GmbH
  29. | Kk Karol Kostolny Vector Informatik GmbH
  30. | Ces Senol Cendere Vector Informatik GmbH
  31. | Pl Georg Pfluegel Vector Informatik GmbH
  32. | Aj Arthur Jendrusch Vector Informatik GmbH
  33. | Seg Sebastian Gaertner Vector Informatik GmbH
  34. | Rna Ruediger Naas Vector Informatik GmbH
  35. | Rse Robert Schelkle Vector Informatik GmbH
  36. | Bmo Bastian Molkenthin Vector Informatik GmbH
  37. | Zam Artjom Zabirko Vector Informatik GmbH
  38. | Swa Sebastian Waldvogel Vector Informatik GmbH
  39. | Ap Andreas Pick Vector Informatik GmbH
  40. | Eta Edgar Tongoona Vector Informatik GmbH
  41. | Maw Mathias Waldenburger Vector Informatik GmbH
  42. |----------------------------------------------------------------------------------------------------------------------
  43. | R E V I S I O N H I S T O R Y
  44. |----------------------------------------------------------------------------------------------------------------------
  45. | Date Version Author Description
  46. |---------- -------- ------ ----------------------------------------------------------------------------------------
  47. | 2005-06-16 01.00.00 Ml - Creation
  48. | 2006-01-12 01.01.00 Ml - no changes
  49. | 2006-02-02 01.02.00 Fn - added support for ARM7
  50. | 2006-02-14 01.03.00 Ard - add version history
  51. | 2006-02-24 01.04.00 Ard - add version scan comment
  52. | 2006-03-06 01.05.00 Ard - released HL version 2.05.00
  53. | 2006-03-09 01.06.00 Ard - remove unused prototypes (defaults from HL are used)
  54. | 2006-03-23 01.07.00 Hs - HL part updated
  55. | 2006-06-26 01.08.00 Ard - ESCAN00017417: Add IRQ functions for MAC7100
  56. | 2006-07-31 01.09.00 Ard - ESCAN00017420: Changes in vstdlib.kon
  57. | 2006-08-23 01.10.00 Ard - ESCAN00017421: Add IRQ functions for TMS470
  58. | 2006-08-23 01.11.00 Ard - ESCAN00017422: Support AVCCORE
  59. | 2006-08-25 01.12.00 Ard - ESCAN00017444: Support LPC2xxx
  60. | 2006-10-30 01.13.00 Ard - ESCAN00018191: Support MAC7100 GHS
  61. | 2006-11-08 01.14.00 Ard - ESCAN00018283: Support TMS470_DCAN
  62. | 2007-01-15 01.15.00 Ard - ESCAN00018932: Support new high level version (TMS470 - Texas Instruments/ARM)
  63. | 2007-03-05 01.16.00 Ces - ESCAN00019841: Support SAF7780_PELICAN with compiler Green Hills
  64. | 2007-07-23 01.17.00 Ard - ESCAN00021557: Interrupts won't be restored if compiler optimization is activated
  65. | 2007-07-31 01.18.00 Ard - ESCAN00021688: Modules using the macros defined by VStdLib to Restore/Disable IRQs
  66. | will not compile in THUMB mode
  67. | - ESCAN00021915: Support GHS compiler for TMS470
  68. | 2007-09-12 01.19.00 Ard - ESCAN00022325: Save registers before using inline assembler (Texas Instruments)
  69. | - ESCAN00022358: Fix interrupt handling for GHS compiler
  70. | 2007-11-27 01.20.00 Ard - ESCAN00023430: Add platform TMS320ARM
  71. | 2008-07-10 01.21.00 Kk - ESCAN00028311: Add platform Fujitsu MB86R0X for GNU compiler
  72. | Ard - ESCAN00030163: Support Omap derivative
  73. | 2008-11-21 01.22.00 Ces - ESCAN00031486: Support platform Freescale IMX
  74. | 2009-01-28 01.23.00 Pl - ESCAN00032648: Support ST30 GNU
  75. | 2009-04-02 01.24.00 Fn - ESCAN00034336: Support Mac7100 and ARM compiler
  76. | Aj - ESCAN00034775: Support TeleChips (TCC800x) and ARM compiler
  77. | 2009-06-06 01.25.00 Seg - ESCAN00036632: Support TI TMS470MSF542 derivative with ARM compiler
  78. | 2009-10-23 01.26.00 Rna - ESCAN00038742: Support STM32BXCAN derivative with ARM compiler
  79. | 2010-07-13 01.27.00 Ces - ESCAN00044028: Support IMX53 (Cortex A8) with GreenHills compiler
  80. | 2010-08-27 01.28.00 Ht - ESCAN00044915: Support Cortex M3 core with C_COMP_TMS470_DCAN
  81. | 2011-03-04 01.29.00 Pl - ESCAN00045901: Optimization of the different interrupt disable and restore functions
  82. | - ESCAN00047518: Support AVNA with TI compiler
  83. | - ESCAN00049098: Support TX03 with ARM compiler
  84. | - ESCAN00045574: Processor mode is changed when function VStdSuspendAllInterrupts is called.
  85. | 2011-07-13 01.30.00 Pl - ESCAN00052181: Support global interrupt handling by application for the Tms320
  86. | 2011-08-10 01.31.00 Pl - ESCAN00052679: Support Fcr4 with GHS compiler
  87. | 2011-09-01 01.32.00 Pl - ESCAN00053194: Support LPC1768 with Keil compiler
  88. | 2011-11-17 01.32.01 Pl - ESCAN00054916: VStdLL_GlobalInterruptRestore with ARM compiler do not write the old
  89. | saved value from localInterruptOldStatusPtr back
  90. | 2012-01-30 01.33.00 Rse - ESCAN00055780: Support IMX with QCC compiler (FlexCAN2 and FlexCAN3)
  91. | Aj - ESCAN00056135: Support Fujitsu Fm3 with Keil compiler
  92. | Pl - ESCAN00056477: Support LPC1768 with GHS Compiler
  93. | 2012-03-14 01.33.01 Pl - ESCAN00057576: in history there is the comment "Support Fujitsu Fm3 with Keil compiler"
  94. | but C_COMP_KEIL_FM3_CCAN is missing in source
  95. | 2012-05-02 01.34.00 Pl - ESCAN00058670: Support for new platform ADUCM33x added
  96. | Attention: release does not support disable / restore of global interrupt
  97. | 2012-06-01 01.34.01 Pl - ESCAN00058484: VStdLL_GlobalInterruptDisable override other RAM variables
  98. | (only if TI compiler is used with a Cortex M3 Prozessor)
  99. | 2012-09-21 01.35.00 Pl - ESCAN00061584: Add GNU compiler for IMX with FlexCAN3
  100. | - ESCAN00062910: Add C_COMP_TI_TMS320ARM_DCAN
  101. | 2012-12-06 01.36.00 Rna - ESCAN00063573: Add support C_COMP_IAR_STM32_BXCAN
  102. | Pl - ESCAN00063681: Add support C_COMP_QCC_TMS320ARM_DCAN
  103. | 2013-01-10 01.37.00 Bmo - ESCAN00065147: Add C_COMP_KEIL_TLE986X
  104. | 2013-02-28 02.00.00 Pl - ESCAN00065474: Update to core version 03.07.00 (support of compiler abstraction and CFG5)
  105. | - ESCAN00064251: Override other RAM variables and Interrupt locking doesn't work
  106. | (only if TI compiler and Cortex M3)
  107. | 2013-08-20 02.01.00 Pl - ESCAN00069915: Add C_COMP_ARM_STA8088_CCAN
  108. | 2013-09-17 02.02.00 Rse - ESCAN00070453: Support Vybrid with GNU compiler
  109. | 2013-10-24 02.02.01 Pl - ESCAN00071399: Add file vstdlib_lib.asm into content
  110. | 2013-11-05 02.03.00 Rse - ESCAN00071627: Support Vybrid with GHS compiler
  111. | - ESCAN00073702: Support Microsoft compiler (WinCE) for IMX6
  112. | - ESCAN00074001: Support GHS compiler for IMX6 derivatives
  113. | 2014-04-14 02.03.01 Rse - ESCAN00075020: Compiler warning: 'tVStdIrqStateType': top-level volatile in cast is ignored
  114. | 2014-04-30 02.04.00 Rse - ESCAN00074735: Support IAR and ARM compiler for Vybrid
  115. | 2014-05-08 02.04.01 Rse - ESCAN00075468: IAR compiler: Unexpected behavior when restoring global interrupts
  116. | 2014-06-05 02.05.00 Zam - ESCAN00076295: Support GNU compiler for Tms320Arm (M-Core)
  117. | 2014-07-08 02.06.00 Zam - ESCAN00076830: Support GNU compiler for Tms320Arm (A-Core)
  118. | 2014-07-23 02.07.00 Swa - ESCAN00077297: Add C_COMP_QCC_TMS320ARM
  119. | 2014-09-30 02.08.00 Ap - ESCAN00077974: Add V_COMP_KEIL_ZSSC
  120. | Pl - ESCAN00078670: Support GNU compiler for VYBRID (A-Core)
  121. | 2014-11-11 02.09.00 Zam - ESCAN00079484: Support Cortex-M4 core with TI compiler
  122. | 2014-12-04 02.10.00 Pl - ESCAN00080002: Add C_COMP_GNU_ACCORDO2_CCAN
  123. | 2015-01-21 02.11.00 Pl - ESCAN00080706: Add V_COMP_GHS_TRAVEO_MCAN
  124. | 2015-05-26 02.12.00 Eta - ESCAN00083158: Add V_COMP_KEIL_ADUCM33X
  125. | 2015-07-09 02.13.00 Pl - ESCAN00083270: Support Cortex-M0 core with Keil and IAR compiler
  126. | 2015-07-09 02.13.01 Maw - ESCAN00083925: Cortex M0 not fully covered for compiler IAR
  127. | 2015-08-12 02.14.00 Pl - ESCAN00084483: Update to core version 03.09.00
  128. | - ESCAN00084605: Support M7 with GHS compiler
  129. |********************************************************************************************************************/
  130.  
  131. /* ********************************************************************************************************************
  132. |
  133. | Project Name: Vector Standard library
  134. | File Name: vstdlib_HL.h
  135. |
  136. | Description: HighLevel part of the implementation of standard Vector functions.
  137. |
  138. |----------------------------------------------------------------------------------------------------------------------
  139. | C O P Y R I G H T
  140. |----------------------------------------------------------------------------------------------------------------------
  141. | Copyright (c) by Vector Informatik GmbH. All rights reserved.
  142. |
  143. | This software is copyright protected and proprietary to
  144. | Vector Informatik GmbH. Vector Informatik GmbH grants to you
  145. | only those rights as set out in the license conditions. All
  146. | other rights remain with Vector Informatik GmbH.
  147. |
  148. |----------------------------------------------------------------------------------------------------------------------
  149. | A U T H O R I D E N T I T Y
  150. |----------------------------------------------------------------------------------------------------------------------
  151. | Initials Name Company
  152. | -------- --------------------- ------------------------------------------------------------------------------
  153. | Ml Patrick Markl Vector Informatik GmbH
  154. | HH Hartmut Hoerner Vector Informatik GmbH
  155. | Ms Gunnar Meiss Vector Informatik GmbH
  156. | Et Thomas Ebert Vector Informatik GmbH
  157. | Bus Sabine Buecherl Vector Informatik GmbH
  158. | Hs Hannes Haas Vector Informatik GmbH
  159. | BWR Brandon Root Vector CANtech Inc.
  160. | Ard Thomas Arnold Vector Informatik GmbH
  161. | Tvi Timo Vanoni Vector Informatik GmbH
  162. | Tkr Torsten Kercher Vector Informatik GmbH
  163. |----------------------------------------------------------------------------------------------------------------------
  164. | R E V I S I O N H I S T O R Y
  165. |----------------------------------------------------------------------------------------------------------------------
  166. | Date Version Author Description
  167. |---------- -------- ------ ----------------------------------------------------------------------------------------
  168. |2003-09-06 00.01.00 Ml - Creation
  169. | Ml - Added HC12 Cosmic
  170. |2003-10-07 00.02.00 Ml/HH - v_lib input merged
  171. |2004-04-10 00.03.00 Ml - Added headerfile
  172. | Ml - Added HC08 Cosmic
  173. | Ml - removed channel dependence for assertions
  174. | Ml - Added function to retrieve the IRQ state
  175. | Ml - Added VSTD_FULL_LIB_SUPPORT switch
  176. |2004-04-27 01.00.00 Ml - resolved issues found in code inspection
  177. |2004-05-17 01.01.00 Ml - no changes
  178. | Ml - changed bugfix into releaseversion
  179. |2004-05-18 01.02.00 Ms/HH - changed memory qualifier concept
  180. |2004-06-01 01.03.00 Ml - no changes
  181. |2004-08-06 01.04.00 Ml - Added macros for local IRQ disable
  182. | - Split of library into HL and LL
  183. |2004-08-18 01.05.00 Ml - Added function qualifier
  184. |2004-09-06 01.06.00 Ml - ESCAN00009316: fixed parameter type mismatch
  185. |2004-09-27 01.07.00 Ml - changed memcpy macros
  186. | Ml - changed namingconvention
  187. |2004-09-29 01.08.00 Et - ESCAN00009692: split VStdMemCpy in VStdRamMemCpy and VStdRomMemCpy
  188. |2004-10-01 01.09.00 Ml - ESCAN00009731: usage of standard type qualifiers
  189. |2004-10-26 01.10.00 Ml - ESCAN00010000: LL parts are split into HW specific files
  190. |2004-11-09 01.11.00 Ml - no changes
  191. |2004-11-15 01.12.00 Ml - ESCAN00010533: Added optimized memory functions for HC08
  192. | Ml - ESCAN00010672: Added memory qualifier
  193. |2005-01-24 01.13.00 Ml - ESCAN00010670: Added memset
  194. |2005-02-25 01.14.00 Ml - ESCAN00011215 Added VStdInitPowerOn
  195. |2005-04-26 01.15.00 Ml - ESCAN00012047: Encapsulate VStdInitPowerOn
  196. | 01.16.00 Ml - ESCAN00012105: Change definition of VStdMemCpy
  197. |2005-05-30 02.00.00 Ml - ESCAN00013446: Development concept changed
  198. |2005-09-12 02.01.00 Ml - ESCAN00013512: Fixed Misra warnings
  199. |2005-11-06 02.02.00 Ml - ESCAN00014183: no changes
  200. |2005-11-28 02.03.00 Ml - Changed version defines
  201. | Ml - ESCAN00014428: VStdMemClr/Set are now internal functions
  202. | Ml - ESCAN00014409: Added casts for mem function defines
  203. |2005-12-12 02.04.00 Ml/Bus - ESCAN00012774: insert comments for different resource categories
  204. |2006-01-12 02.05.00 Ml - ESCAN00014897: Changed interrupt handling
  205. |2006-01-14 02.06.00 Ml - ESCAN00014908: Adapted interrupt control handling for RI1.5
  206. |2006-02-07 02.07.00 Ml - Added VStdGetInterruptState
  207. | Hs - ESCAN00015802: compatibility defines added
  208. |2006-05-09 02.08.00 Ces - ESCAN00016289: Insert memory qualifier V_MEMROM3 to VStdRomMemCpy()
  209. |2006-05-24 02.09.00 BWR - ESCAN00016488: Compiler error in VStdSuspendAllInterrupts and VStdResumeAllInterrupts
  210. |2006-07-16 02.10.00 Ml - Changed return type of VStdGetInterruptState from uint8 to tVStdIrqStateType
  211. |2006-07-31 02.11.00 Ml - ESCAN00017133: Changed assertion handling
  212. |2006-08-04 02.12.00 Ml - ESCAN00017188: Added compatibility for older copy functions
  213. |2006-11-20 02.13.00 Ml - Removed VStdGetInterruptState
  214. |2006-12-07 02.14.00 Ml - Changed switch names
  215. | Ml - ESCAN00018889: Fixed code inspection report findings
  216. | - ESCAN00018880: added casts to memXXX macros
  217. |2007-01-27 02.15.00 Ml,Ard - ESCAN00019251: VStdLib HL usable for RI1.4 and RI1.5
  218. |2007-02-19 02.16.00 Ml - ESCAN00019672: no changes
  219. | Ml - ESCAN00019674: Changed names of interrupt lock macros
  220. |2007-05-10 02.17.00 Ml - ESCAN00020705: no changes
  221. | Ml - ESCAN00020241: Cast of length parameter
  222. |2007-11-26 03.00.00 Ml - ESCAN00024126: Support word and dword copy routines
  223. | Ml - ESCAN00024192: Default and specific implementations supported at the same time
  224. |2008-06-25 03.01.00 Ml - ESCAN00023334: Added u suffix to the version numbers
  225. | Ml - ESCAN00018659: No changes
  226. | Ml - ESCAN00015501: Added compatibility to older version defines
  227. |2008-07-17 03.01.01 Ml - ESCAN00027617: Added library version check support
  228. |2008-07-23 03.02.00 Ml - ESCAN00028605: old interrupt status is initialized by low level token
  229. |2008-07-27 03.02.01 Ml - ESCAN00028752: Include of MSR header according to naming convention
  230. |2008-08-13 03.03.00 Ml - ESCAN00029196: Encapsulated AUTOSAR library version check
  231. |2008-12-08 03.03.01 Ml - ESCAN00031855: Additional memcpy interfaces
  232. |2009-06-30 03.04.00 Ml - ESCAN00036089: Application must care about nested calls in case of user handling of locks
  233. | Ml - ESCAN00035049: Resolved extended version check include
  234. |2009-10-15 03.05.00 Ml - ESCAN00038482: Added additional function qualifier (VSTD_API_2)
  235. | Ml - ESCAN00038485: Added general OS header include.
  236. |2009-10-19 03.05.01 Ml - ESCAN00038485: Renamed the OS header include according to osCAN
  237. |2010-01-21 03.06.00 Tvi - ESCAN00040103: [AUTOSAR] Add support for compiler abstraction
  238. |2011-09-01 03.06.01 Tvi - ESCAN00052664: [MSR only] "upper/lower case" issue at #include compiler/memory abstraction
  239. |2012-06-20 03.07.00 Tvi - ESCAN00058623: AR4-170: support VStdLib with CFG5 MSR4 R5
  240. |2013-12-10 03.08.00 Tvi - ESCAN00065931: Add MISRA justifications
  241. |2015-04-21 03.09.00 Tkr - ESCAN00082584: Add MISRA justifications
  242. | - ESCAN00082585: Support function memory mapping without ASR API
  243. |*********************************************************************************************************************/
  244.  
  245. /* PRQA S 3453 EOF */ /* MD_VStdLib_Header_3453 */
  246.  
  247. #if !defined(_VSTDLIB_H_)
  248. # define _VSTDLIB_H_
  249.  
  250. /* Include the configuration for vstdlib */
  251. # include "v_cfg.h"
  252.  
  253. /* Encapsulation of AUTOSAR library check */
  254. #if defined(VGEN_ENABLE_GW_ASRPDUR)
  255. # define VSTD_ENABLE_MSR_LIB_VERSION_CHECK
  256. # define VSTD_ENABLE_API_AUTOSAR
  257. #endif
  258.  
  259. #if defined (VSTD_ENABLE_API_AUTOSAR)
  260. /* If MICROSAR is used, several headers are needed */
  261. # include "Std_Types.h"
  262. # include "Compiler.h"
  263. #else
  264. # include "v_def.h"
  265. #endif
  266.  
  267. /* Includes required in the header file */
  268.  
  269. /* *******************************************************************************************************************/
  270. /* Defines */
  271. /* *******************************************************************************************************************/
  272.  
  273. /* ##V_CFG_MANAGEMENT ##CQProject : VStdLib_Arm7 CQComponent : Implementation */
  274. #define VSTDLIB_ARM7_VERSION 0x0214u
  275. #define VSTDLIB_ARM7_RELEASE_VERSION 0x00u
  276.  
  277. /* ##V_CFG_MANAGEMENT ##CQProject : VStdLib__coreHll CQComponent : Implementation */
  278. # define VSTDLIB__COREHLL_VERSION 0x0309u
  279. # define VSTDLIB__COREHLL_RELEASE_VERSION 0x00u
  280.  
  281. /* Introduced for comparability with older VStdLib versions */
  282. # define COMMON_VSTDLIB_VERSION VSTDLIB__COREHLL_VERSION
  283. # define COMMON_VSTDLIB_RELEASE_VERSION VSTDLIB__COREHLL_RELEASE_VERSION
  284.  
  285. #if defined (V_COMP_GHS)
  286. # if defined(VSTD_ENABLE_DEFAULT_INTCTRL)
  287. # include <arm_ghs.h>
  288. # endif
  289. #endif
  290.  
  291. #if defined (VSTD_ENABLE_FIQ_INTCTRL)
  292. # define kIrqIbitMask ((vuint32)0x000000C0)
  293. #else
  294. # define kIrqIbitMask ((vuint32)0x00000080)
  295. #endif
  296.  
  297. #if defined (V_COMP_GHS)
  298. # if defined (__CortexM3) || defined (__CortexM4) || defined (__CortexM7)
  299. # if !defined (V_ARM_CORTEX_M)
  300. # define V_ARM_CORTEX_M
  301. # endif
  302. # endif
  303. #endif
  304.  
  305. /* Compatibility defines */
  306. # if !defined(VSTD_API_0)
  307. # define VSTD_API_0
  308. # endif
  309.  
  310. # if !defined(VSTD_API_1)
  311. # define VSTD_API_1
  312. # endif
  313.  
  314. # if !defined(VSTD_API_2)
  315. # define VSTD_API_2
  316. # endif
  317.  
  318. # if !defined(VSTD_CALLBACK_0)
  319. # define VSTD_CALLBACK_0
  320. # endif
  321.  
  322. # if !defined(VSTD_CALLBACK_1)
  323. # define VSTD_CALLBACK_1
  324. # endif
  325.  
  326. # if !defined(VSTD_NONE)
  327. # define VSTD_NONE
  328. # endif
  329.  
  330. /* MICROSAR compatibility */
  331. # if defined(VSTD_ENABLE_API_AUTOSAR)
  332.  
  333. # if !defined(VSTD_USE_MEMORY_MACROS)
  334. # define VSTD_USE_MEMORY_MACROS STD_OFF
  335. # endif
  336.  
  337. # endif
  338.  
  339. /* Memory abstraction layer */
  340. # if defined(VSTD_ENABLE_API_AUTOSAR)
  341. # if !defined(VSTDLIB_AUTOMATIC)
  342. # define VSTDLIB_AUTOMATIC AUTOMATIC
  343. # endif
  344. # if !defined(V_NULL)
  345. # define V_NULL NULL_PTR
  346. # endif
  347.  
  348. /* PRQA S 0342 ISO_GLUE_OPERATOR */ /* MD_VStdLib_Header_0342 */
  349. /* PRQA S 0881 EVAL_ORDER_UNDEFINED */ /* MD_VStdLib_Header_0881 */
  350. /* PRQA S 3410 MACRO_PARAM_NO_PARENTHESES */ /* MD_VStdLib_Header_3410 */
  351. # define VSTD_DEF_VAR(storage, vartype, memclass) storage VAR(vartype, VSTDLIB_##memclass)
  352. # define VSTD_DEF_VAR_TYPE(storage, vartype) typedef storage VAR(vartype, TYPEDEF)
  353. # define VSTD_DEF_P2VAR(storage, ptrtype, memclass, ptrclass) storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
  354. # define VSTD_DEF_P2VAR_TYPE(storage, ptrtype, ptrclass) typedef storage P2VAR(ptrtype, TYPEDEF, VSTDLIB_##ptrclass)
  355. # define VSTD_DEF_P2VAR_PARA(storage, ptrtype, memclass, ptrclass) storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
  356. # define VSTD_DEF_CONSTP2VAR(storage, ptrtype, memclass, ptrclass) storage CONSTP2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
  357. # define VSTD_DEF_CONST(storage, vartype, memclass) storage CONST(vartype, VSTDLIB_##memclass)
  358. # define VSTD_DEF_CONST_TYPE(storage, vartype) typedef storage CONST(vartype, TYPEDEF)
  359. # define VSTD_DEF_P2CONST(storage, ptrtype, memclass, ptrclass) storage P2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
  360. # define VSTD_DEF_P2CONST_TYPE(storage, ptrtype, ptrclass) typedef storage P2CONST(ptrtype, TYPEDEF, VSTDLIB_##ptrclass)
  361. # define VSTD_DEF_P2CONST_PARA(storage, ptrtype, memclass, ptrclass) storage P2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
  362. # define VSTD_DEF_CONSTP2CONST(storage, ptrtype, memclass, ptrclass) storage CONSTP2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
  363. # define VSTD_DEF_FUNC(storage, rettype, memclass) storage FUNC(rettype, VSTDLIB_##memclass)
  364. # define VSTD_DEF_FUNC_API(storage, rettype, memclass) storage FUNC(rettype, VSTDLIB_##memclass)
  365. # define VSTD_DEF_FUNC_CBK(storage, rettype, memclass) storage FUNC(rettype, VSTDLIB_##memclass)
  366. /* PRQA L:MACRO_PARAM_NO_PARENTHESES */
  367. /* PRQA L:EVAL_ORDER_UNDEFINED */
  368. /* PRQA L:ISO_GLUE_OPERATOR */
  369.  
  370. # else /* VSTD_ENABLE_API_AUTOSAR */
  371.  
  372. # define VSTD_DEF_VAR(storage, vartype, memclass) V_MEMRAM0 storage V_MEMRAM1 vartype V_MEMRAM2
  373. # define VSTD_DEF_VAR_TYPE(storage, vartype) typedef storage V_MEMRAM1 vartype V_MEMRAM2
  374. # define VSTD_DEF_P2VAR(storage, ptrtype, memclass, ptrclass) V_MEMRAM0 storage V_MEMRAM1 ptrtype V_MEMRAM2 *
  375. # define VSTD_DEF_P2VAR_TYPE(storage, ptrtype, ptrclass) typedef storage V_MEMRAM1 ptrtype V_MEMRAM2 *
  376. # define VSTD_DEF_P2VAR_PARA(storage, ptrtype, memclass, ptrclass) storage V_MEMRAM1 ptrtype V_MEMRAM2 *
  377. # define VSTD_DEF_CONSTP2VAR(storage, ptrtype, memclass, ptrclass) V_MEMROM0 storage V_MEMRAM1 ptrtype V_MEMRAM2 V_MEMRAM3 * V_MEMROM1 V_MEMROM2
  378. # define VSTD_DEF_CONST(storage, vartype, memclass) V_MEMROM0 storage V_MEMROM1 vartype V_MEMROM2
  379. # define VSTD_DEF_CONST_TYPE(storage, vartype) typedef storage V_MEMROM1 vartype V_MEMROM2
  380. # define VSTD_DEF_P2CONST(storage, ptrtype, memclass, ptrclass) V_MEMRAM0 storage V_MEMROM1 ptrtype V_MEMROM2 V_MEMROM3 * V_MEMRAM1 V_MEMRAM2
  381. # define VSTD_DEF_P2CONST_TYPE(storage, ptrtype, ptrclass) typedef storage V_MEMROM1 ptrtype V_MEMROM2 V_MEMROM3 *
  382. # define VSTD_DEF_P2CONST_PARA(storage, ptrtype, memclass, ptrclass) storage V_MEMROM1 ptrtype V_MEMROM2 V_MEMROM3 * V_MEMRAM1 V_MEMRAM2
  383. # define VSTD_DEF_CONSTP2CONST(storage, ptrtype, memclass, ptrclass) V_MEMROM0 storage V_MEMROM1 ptrtype V_MEMROM2 V_MEMROM3 * V_MEMROM1 V_MEMROM2
  384. # define VSTD_DEF_FUNC(storage, rettype, memclass) storage rettype
  385. # define VSTD_DEF_FUNC_API(storage, rettype, memclass) VSTD_API_0 storage VSTD_API_1 rettype
  386. # define VSTD_DEF_FUNC_CBK(storage, rettype, memclass) storage VSTD_CALLBACK_0 rettype VSTD_CALLBACK_1
  387.  
  388. # endif
  389.  
  390. /* Types abstraction layer */
  391. # if defined(VSTD_ENABLE_API_AUTOSAR)
  392. # if !defined(vuint8)
  393. # define vuint8 uint8
  394. # endif
  395. # if !defined(vuint16)
  396. # define vuint16 uint16
  397. # endif
  398. # if !defined(vuint32)
  399. # define vuint32 uint32
  400. # endif
  401. # if !defined(vsint8)
  402. # define vsint8 sint8
  403. # endif
  404. # if !defined(vsint16)
  405. # define vsint16 sint16
  406. # endif
  407. # if !defined(vsint32)
  408. # define vsint32 sint32
  409. # endif
  410. # endif
  411.  
  412. # if defined(VSTD_ENABLE_DEFAULT_INTCTRL) || \
  413. defined(VSTD_ENABLE_OSEK_INTCTRL) || \
  414. defined(VSTD_ENABLE_APPL_INTCTRL)
  415. # define VSTD_ENABLE_INTCTRL_HANDLING
  416. # define VSTD_HL_ENABLE_SUPPORT_IRQ_FCT /* compatibility for Autosar */
  417. # define VSTD_ENABLE_SUPPORT_IRQ_FCT
  418. # else
  419. # define VSTD_DISABLE_INTCTRL_HANDLING
  420. # define VSTD_HL_DISABLE_SUPPORT_IRQ_FCT /* compatibility for Autosar */
  421. # define VSTD_DISABLE_SUPPORT_IRQ_FCT
  422. # endif
  423.  
  424. # if !defined(VSTD_ENABLE_LIBRARY_FUNCTIONS) && !defined(VSTD_DISABLE_LIBRARY_FUNCTIONS)
  425. # define VSTD_ENABLE_LIBRARY_FUNCTIONS
  426. # endif
  427.  
  428. /* *******************************************************************************************************************/
  429. /* Error codes for assertions */
  430. /* *******************************************************************************************************************/
  431. # define kVStdErrorIntDisableTooOften ((vuint8)0x01)
  432. # define kVStdErrorIntRestoreTooOften ((vuint8)0x02)
  433. # define kVStdErrorMemClrInvalidParameter ((vuint8)0x03)
  434. # define kVStdErrorMemCpyInvalidParameter ((vuint8)0x04)
  435. # define kVStdErrorFunctionNotSupportedByHw ((vuint8)0x05)
  436. # define kVStdErrorMemSetInvalidParameter ((vuint8)0x06)
  437. # define kVStdErrorUnexpectedLockState ((vuint8)0x07)
  438.  
  439. /* *******************************************************************************************************************/
  440. /* Platforms with optimized VStdLib support */
  441. /* *******************************************************************************************************************/
  442. #define VSTD_HL_DISABLE_SUPPORT_MEM_FCT
  443. #define VSTD_HL_DISABLE_MEM_FCT_MAPPING
  444.  
  445. /* in case of the standard implementation enable all functions */
  446. #if defined(VSTD_HL_ENABLE_MEM_FCT_MAPPING)
  447. #else
  448. # define VSTD_HL_USE_VSTD_MEMCLR
  449. # define VSTD_HL_USE_VSTD_MEMSET
  450. # define VSTD_HL_USE_VSTD_RAMMEMCPY
  451. # define VSTD_HL_USE_VSTD_ROMMEMCPY
  452. # define VSTD_HL_USE_VSTD_WORD_MEMCPY
  453. # define VSTD_HL_USE_VSTD_DWORD_MEMCPY
  454. #endif
  455.  
  456. /* *******************************************************************************************************************/
  457. /* Version check */
  458. /* *******************************************************************************************************************/
  459. # if defined(VSTD_ENABLE_API_AUTOSAR)
  460. # define VSTDLIB_START_SEC_CONST_UNSPECIFIED
  461. # include "MemMap.h" /* PRQA S 5087 */ /* MD_MSR_19.1 */
  462. # endif
  463.  
  464. /* ROM CATEGORY 4 START */
  465. VSTD_DEF_CONST(extern, vuint8, CONST) kVStdMainVersion;
  466. VSTD_DEF_CONST(extern, vuint8, CONST) kVStdSubVersion;
  467. VSTD_DEF_CONST(extern, vuint8, CONST) kVStdReleaseVersion;
  468. /* ROM CATEGORY 4 END */
  469.  
  470. # if defined(VSTD_ENABLE_API_AUTOSAR)
  471. # define VSTDLIB_STOP_SEC_CONST_UNSPECIFIED
  472. # include "MemMap.h" /* PRQA S 5087 */ /* MD_MSR_19.1 */
  473. # endif
  474.  
  475. /* *******************************************************************************************************************/
  476. /* Function like macros */
  477. /* *******************************************************************************************************************/
  478.  
  479. #if defined (V_COMP_GHS)
  480. # if defined (V_ARM_CORTEX_M)
  481. /* Nothing to do for Cortex M3, M4 or M7 CPU */
  482. # else
  483. /* other CPUs */
  484. # if defined( VSTD_ENABLE_CLEAR_INSTRUCTION_PIPE )
  485. # define VStdLL_GlobalInterruptDisable(localInterruptOldStatusPtr) \
  486. { \
  487. *(localInterruptOldStatusPtr) = __GETSR() & (vuint32)kIrqIbitMask; \
  488. __SETSR(__GETSR() | kIrqIbitMask); \
  489. __asm(" NOP "); \
  490. __asm(" NOP "); \
  491. __asm(" NOP "); \
  492. __asm(" NOP "); \
  493. __asm(" NOP "); \
  494. __asm(" NOP "); \
  495. __asm(" NOP "); \
  496. }
  497. # else
  498. # define VStdLL_GlobalInterruptDisable(localInterruptOldStatusPtr) \
  499. { \
  500. *(localInterruptOldStatusPtr) = __GETSR() & (vuint32)kIrqIbitMask; \
  501. __SETSR(__GETSR() | kIrqIbitMask); \
  502. }
  503. # endif
  504.  
  505. # define VStdLL_GlobalInterruptRestore(localInterruptOldStatus) \
  506. { \
  507. __SETSR((__GETSR() & (vuint32)~kIrqIbitMask) | localInterruptOldStatus); \
  508. }
  509.  
  510. # endif
  511. #endif
  512.  
  513. /* *******************************************************************************************************************/
  514. /* Types */
  515. /* *******************************************************************************************************************/
  516. typedef volatile vuint32 tVStdIrqStateType;
  517.  
  518. /* *******************************************************************************************************************/
  519. /* Defines */
  520. /* *******************************************************************************************************************/
  521. # if defined(VSTD_ENABLE_INTCTRL_HANDLING)
  522. # if defined(VSTD_ENABLE_DEFAULT_INTCTRL)
  523. # define VStdDeclareGlobalInterruptOldStatus tVStdIrqStateType localInterruptOldStatus;
  524. # define VStdPutGlobalInterruptOldStatus(x) (localInterruptOldStatus = (x))
  525. # define VStdGetGlobalInterruptOldStatus(x) ((x) = localInterruptOldStatus)
  526. # define VStdGlobalInterruptDisable() VStdLL_GlobalInterruptDisable(&localInterruptOldStatus)
  527. # define VStdGlobalInterruptRestore() VStdLL_GlobalInterruptRestore(localInterruptOldStatus)
  528. # elif defined(VSTD_ENABLE_OSEK_INTCTRL)
  529. # define VStdDeclareGlobalInterruptOldStatus
  530. # define VStdPutGlobalInterruptOldStatus(x)
  531. # define VStdGetGlobalInterruptOldStatus(x)
  532. # if defined(osdOSEK2_1)
  533. # define VStdGlobalInterruptDisable() OsSaveDisableGlobalNested()
  534. # define VStdGlobalInterruptRestore() OsRestoreEnableGlobalNested()
  535. # define VStdSuspendAllInterrupts() OsSaveDisableGlobalNested()
  536. # define VStdResumeAllInterrupts() OsRestoreEnableGlobalNested()
  537. # else
  538. # define VStdGlobalInterruptDisable() SuspendAllInterrupts()
  539. # define VStdGlobalInterruptRestore() ResumeAllInterrupts()
  540. # define VStdSuspendAllInterrupts() SuspendAllInterrupts()
  541. # define VStdResumeAllInterrupts() ResumeAllInterrupts()
  542. # endif
  543. # elif defined(VSTD_ENABLE_APPL_INTCTRL)
  544. # define VStdDeclareGlobalInterruptOldStatus
  545. # define VStdPutGlobalInterruptOldStatus(x)
  546. # define VStdGetGlobalInterruptOldStatus(x)
  547. # define VStdGlobalInterruptDisable() VStdUserNestedDisable()
  548. # define VStdGlobalInterruptRestore() VStdUserNestedRestore()
  549. # define VStdSuspendAllInterrupts() VStdUserNestedDisable()
  550. # define VStdResumeAllInterrupts() VStdUserNestedRestore()
  551. # else
  552. # error "Please check VStdLib interrupt configuration!"
  553. # endif
  554. # define VStdNestedGlobalInterruptDisable() VStdGlobalInterruptDisable()
  555. # define VStdNestedGlobalInterruptRestore() VStdGlobalInterruptRestore()
  556. # endif
  557.  
  558. # if defined(VSTD_ENABLE_API_AUTOSAR)
  559. /* For AUTOSAR, mem mapping has to be disabled */
  560.  
  561. /* Default implementation of macros */
  562. # if !defined(VStdMemCpy_Macro)
  563. /* PRQA S 3458 1 */ /* MD_MSR_19.4 */
  564. # define VStdMemCpy_Macro(dst, src, len) { uint16_least __i; for ( __i = 0x00u; __i < (len); ++__i) { (dst)[__i] = (src)[__i]; } }
  565. # endif
  566.  
  567. # if !defined(VStdMemSet_Macro)
  568. /* PRQA S 3458 1 */ /* MD_MSR_19.4 */
  569. # define VStdMemSet_Macro(dst, val, len) { uint16_least __i; for ( __i = 0x00u; __i < (len); ++__i) { (dst)[__i] = (val); } }
  570. # endif
  571.  
  572. # if !defined(VStdMemClr_Macro)
  573. /* PRQA S 3458 1 */ /* MD_MSR_19.4 */
  574. # define VStdMemClr_Macro(dst, len) { uint16_least __i; for ( __i = 0x00u; __i < (len); ++__i) { (dst)[__i] = 0x00u; } }
  575. # endif
  576.  
  577. # if !defined(VStdMemCpyRom_Macro)
  578. # define VStdMemCpyRom_Macro VStdMemCpy_Macro
  579. # endif
  580.  
  581. /* Set the default copy macros either to macros or to functions */
  582. # if (VSTD_USE_MEMORY_MACROS == STD_ON)
  583. # define VStdMemCpy(dst, src, len) VStdMemCpy_Macro((dst), (src), (len))
  584. # define VStdMemCpy16(dst, src, len) VStdMemCpy_Macro((dst), (src), (len))
  585. # define VStdMemCpy32(dst, src, len) VStdMemCpy_Macro((dst), (src), (len))
  586. # define VStdMemSet(dst, val, len) VStdMemSet_Macro((dst), (val), (len))
  587. # define VStdMemClr(dst, len) VStdMemClr_Macro((dst), (len))
  588. # define VStdMemCpyRom(dst, src, len) VStdMemCpyRom_Macro((dst), (src), (len))
  589. # else
  590. # define VStdMemCpy(dst, src, len) VStdMemCpy_Func( (VSTD_DEF_P2VAR_PARA(VSTD_NONE, vuint8, AUTOMATIC, VAR_FAR))(dst), (VSTD_DEF_P2CONST_PARA(VSTD_NONE, vuint8, AUTOMATIC, VAR_FAR))(src), (len))
  591. # define VStdMemCpy16(dst, src, len) VStdMemCpy16_Func((VSTD_DEF_P2VAR_PARA(VSTD_NONE, vuint16, AUTOMATIC, VAR_FAR))(dst), (VSTD_DEF_P2CONST_PARA(VSTD_NONE, vuint16, AUTOMATIC, VAR_FAR))(src), (len))
  592. # define VStdMemCpy32(dst, src, len) VStdMemCpy32_Func((VSTD_DEF_P2VAR_PARA(VSTD_NONE, vuint32, AUTOMATIC, VAR_FAR))(dst), (VSTD_DEF_P2CONST_PARA(VSTD_NONE, vuint32, AUTOMATIC, VAR_FAR))(src), (len))
  593. # define VStdMemSet(dst, val, len) VStdMemSet_Func( (VSTD_DEF_P2VAR_PARA(VSTD_NONE, vuint8, AUTOMATIC, VAR_FAR))(dst), (val), (len))
  594. # define VStdMemClr(dst, len) VStdMemClr_Func( (VSTD_DEF_P2VAR_PARA(VSTD_NONE, vuint8, AUTOMATIC, VAR_FAR))(dst), (len))
  595. # define VStdMemCpyRom(dst, src, len) VStdMemCpy_Func( (VSTD_DEF_P2VAR_PARA(VSTD_NONE, vuint8, AUTOMATIC, VAR_FAR))(dst), (VSTD_DEF_P2CONST_PARA(VSTD_NONE, vuint8, AUTOMATIC, CONST_FAR))(src), (len))
  596. # endif /* VSTD_USE_MEMORY_MACROS */
  597.  
  598. /* Mapping for compatibility reasons */
  599. /* memset abstraction */
  600. # define VStdMemNearSet(d, p, l) VStdMemSet((d), (p), (l))
  601. # define VStdMemFarSet(d, p, l) VStdMemSet((d), (p), (l))
  602.  
  603. /* memclr abstraction */
  604. # define VStdMemNearClr(d, l) VStdMemClr((d), (l))
  605. # define VStdMemFarClr(d, l) VStdMemClr((d), (l))
  606.  
  607. /* memcpy abstraction */
  608. # define VStdMemCpyRamToRam(d, s, l) VStdMemCpy((d), (s), (l))
  609. # define VStdMemCpyRomToRam(d, s, l) VStdMemCpyRom((d), (s), (l))
  610. # define VStdMemCpyRamToNearRam(d, s, l) VStdMemCpy((d), (s), (l))
  611. # define VStdMemCpyRomToNearRam(d, s, l) VStdMemCpyRom((d), (s), (l))
  612. # define VStdMemCpyRomToFarRam(d, s, l) VStdMemCpyRom((d), (s), (l))
  613. # define VStdMemCpyRamToFarRam(d, s, l) VStdMemCpy((d), (s), (l))
  614. # define VStdMemCpyFarRamToRam(d, s, l) VStdMemCpy((d), (s), (l))
  615. # define VStdMemCpyFarRamToFarRam(d, s, l) VStdMemCpy((d), (s), (l))
  616. # define VStdMemCpyFarRomToFarRam(d, s, l) VStdMemCpyRom((d), (s), (l))
  617.  
  618. # define VStdMemCpy16RamToRam(d, s, l) VStdMemCpy16((d), (s), (l))
  619. # define VStdMemCpy16RamToFarRam(d, s, l) VStdMemCpy16((d), (s), (l))
  620. # define VStdMemCpy16FarRamToRam(d, s, l) VStdMemCpy16((d), (s), (l))
  621.  
  622. # define VStdMemCpy32RamToRam(d, s, l) VStdMemCpy32((d), (s), (l))
  623. # define VStdMemCpy32RamToFarRam(d, s, l) VStdMemCpy32((d), (s), (l))
  624. # define VStdMemCpy32FarRamToRam(d, s, l) VStdMemCpy32((d), (s), (l))
  625.  
  626. # else /* VSTD_ENABLE_API_AUTOSAR */
  627. # if defined(VSTD_HL_ENABLE_MEM_FCT_MAPPING)
  628. /* define hardware specific mappings of memcpy etc. */
  629. # else /* VSTD_HL_ENABLE_MEM_FCT_MAPPING */
  630.  
  631. /* per default all memclr and memcpy functions are mapped on one routine which
  632.   does not support different memory models */
  633. /* memset abstraction */
  634. # define VStdMemSet(d, p, l) VStdMemSetInternal((void*)(d), (p), (vuint16)(l))
  635. # define VStdMemNearSet(d, p, l) VStdMemSetInternal((void*)(d), (p), (vuint16)(l))
  636. # define VStdMemFarSet(d, p, l) VStdMemSetInternal((void*)(d), (p), (vuint16)(l))
  637.  
  638. /* memclr abstraction */
  639. # define VStdMemClr(d, l) VStdMemClrInternal((void*)(d), (vuint16)(l))
  640. # define VStdMemNearClr(d, l) VStdMemClrInternal((void*)(d), (vuint16)(l))
  641. # define VStdMemFarClr(d, l) VStdMemClrInternal((void*)(d), (vuint16)(l))
  642.  
  643. /* memcpy abstraction */
  644. # define VStdMemCpyRamToRam(d, s, l) VStdRamMemCpy((void*)(d), (void*)(s), (vuint16)(l))
  645. # define VStdMemCpyRomToRam(d, s, l) VStdRomMemCpy((void*)(d), (V_MEMROM1 void V_MEMROM2 V_MEMROM3 *)(s), (vuint16)(l))
  646.  
  647. # define VStdMemCpyRamToNearRam(d, s, l) VStdRamMemCpy((d), (void*)(s), (l))
  648. # define VStdMemCpyRomToNearRam(d, s, l) VStdRomMemCpy((d), (V_MEMROM1 void V_MEMROM2 V_MEMROM3 *)(s), (vuint16)(l))
  649.  
  650. # define VStdMemCpyRomToFarRam(d, s, l) VStdRomMemCpy((d), (V_MEMROM1 void V_MEMROM2 V_MEMROM3 *)(s), (vuint16)(l))
  651.  
  652. # define VStdMemCpyRamToFarRam(d, s, l) VStdRamMemCpy((d), (s), (vuint16)(l))
  653. # define VStdMemCpyFarRamToRam(d, s, l) VStdRamMemCpy((d), (s), (vuint16)(l))
  654.  
  655. # define VStdMemCpyFarRamToFarRam(d, s, l) VStdRamMemCpy((d), (s), (vuint16)(l))
  656. # define VStdMemCpyFarRomToFarRam(d, s, l) VStdRomMemCpy((d), (s), (vuint16)(l))
  657.  
  658. # define VStdMemCpy16RamToRam(d, s, l) VStdRamMemCpy16((d), (s), (vuint16)(l))
  659. # define VStdMemCpy16RamToFarRam(d, s, l) VStdRamMemCpy16((d), (s), (vuint16)(l))
  660. # define VStdMemCpy16FarRamToRam(d, s, l) VStdRamMemCpy16((d), (s), (vuint16)(l))
  661.  
  662. # define VStdMemCpy32RamToRam(d, s, l) VStdRamMemCpy32((d), (s), (vuint16)(l))
  663. # define VStdMemCpy32RamToFarRam(d, s, l) VStdRamMemCpy32((d), (s), (vuint16)(l))
  664. # define VStdMemCpy32FarRamToRam(d, s, l) VStdRamMemCpy32((d), (s), (vuint16)(l))
  665.  
  666. # endif /* VSTD_HL_ENABLE_MEM_FCT_MAPPING */
  667. # endif
  668. /* *******************************************************************************************************************/
  669. /* Compatibility */
  670. /* *******************************************************************************************************************/
  671. # if defined (VSTD_ENABLE_API_AUTOSAR)
  672. # else
  673. # define VStdMemCpy(d, s, l) VStdMemCpyRamToRam((d), (s), (l))
  674. # endif
  675.  
  676. # if defined(VSTD_HL_USE_VSTD_RAMMEMCPY) && !defined(VSTD_ENABLE_API_AUTOSAR)
  677. # else
  678. # define VStdRamMemCpy(d, s, l) VStdMemCpyRamToRam((d), (s), (l))
  679. # endif
  680.  
  681. # if defined(VSTD_HL_USE_VSTD_ROMMEMCPY) && !defined(VSTD_ENABLE_API_AUTOSAR)
  682. # else
  683. # define VStdRomMemCpy(d, s, l) VStdMemCpyRomToRam((d), (s), (l))
  684. # endif
  685.  
  686. /* *******************************************************************************************************************/
  687. /* Prototypes of functions */
  688. /* *******************************************************************************************************************/
  689.  
  690. # if defined(VSTD_ENABLE_API_AUTOSAR) || defined(VSTD_ENABLE_FCT_MEMMAP)
  691. # define VSTDLIB_START_SEC_CODE
  692. # include "MemMap.h" /* PRQA S 5087 */ /* MD_MSR_19.1 */
  693. # endif
  694. /* PRQA S 0850 MACRO_ARGUMENT_EMPTY */ /* MD_VStdLib_0850 */
  695.  
  696. /* initialization */
  697. /* CODE CATEGORY 4 START */
  698. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdInitPowerOn(void);
  699. /* CODE CATEGORY 4 END */
  700.  
  701. /* function for moving data */
  702. # if defined(VSTD_ENABLE_API_AUTOSAR)
  703. /* CODE CATEGORY 1 START */
  704. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdMemClr_Func(VSTD_DEF_P2VAR_PARA(VSTD_NONE, uint8, AUTOMATIC, VAR_FAR) pDest, uint16_least nCnt);
  705. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdMemSet_Func(VSTD_DEF_P2VAR_PARA(VSTD_NONE, uint8, AUTOMATIC, VAR_FAR) pDest, uint8 nPattern, uint16_least nCnt);
  706. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdMemCpy_Func(VSTD_DEF_P2VAR_PARA(VSTD_NONE, uint8, AUTOMATIC, VAR_FAR) pDest, VSTD_DEF_P2CONST_PARA(VSTD_NONE, uint8, AUTOMATIC, VAR_FAR) pSrc, uint16_least nCnt);
  707. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdMemCpy16_Func(VSTD_DEF_P2VAR_PARA(VSTD_NONE, uint16, AUTOMATIC, VAR_FAR) pDest, VSTD_DEF_P2CONST_PARA(VSTD_NONE, uint16, AUTOMATIC, VAR_FAR) pSrc, uint16_least nCnt);
  708. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdMemCpy32_Func(VSTD_DEF_P2VAR_PARA(VSTD_NONE, uint32, AUTOMATIC, VAR_FAR) pDest, VSTD_DEF_P2CONST_PARA(VSTD_NONE, uint32, AUTOMATIC, VAR_FAR) pSrc, uint16_least nCnt);
  709. /* CODE CATEGORY 1 END */
  710. # else /* VSTD_ENABLE_API_AUTOSAR */
  711. /* CODE CATEGORY 1 START */
  712. # if defined(VSTD_HL_USE_VSTD_MEMCLR)
  713. VSTD_API_0 void VSTD_API_1 VStdMemClrInternal(void *pDest, vuint16 nCnt) VSTD_API_2;
  714. # endif
  715.  
  716. # if defined(VSTD_HL_USE_VSTD_MEMSET)
  717. VSTD_API_0 void VSTD_API_1 VStdMemSetInternal(void *pDest, vuint8 nPattern, vuint16 nCnt) VSTD_API_2;
  718. # endif
  719.  
  720. # if defined(VSTD_HL_USE_VSTD_RAMMEMCPY)
  721. VSTD_API_0 void VSTD_API_1 VStdRamMemCpy(void *pDest, void *pSrc, vuint16 nCnt) VSTD_API_2;
  722. # endif
  723.  
  724. # if defined(VSTD_HL_USE_VSTD_ROMMEMCPY)
  725. VSTD_API_0 void VSTD_API_1 VStdRomMemCpy(void *pDest, V_MEMROM1 void V_MEMROM2 V_MEMROM3 *pSrc, vuint16 nCnt) VSTD_API_2;
  726. # endif
  727.  
  728. # if defined(VSTD_HL_USE_VSTD_WORD_MEMCPY)
  729. VSTD_API_0 void VSTD_API_1 VStdRamMemCpy16(void *pDest, void *pSrc, vuint16 nWordCnt) VSTD_API_2;
  730. # endif
  731.  
  732. # if defined(VSTD_HL_USE_VSTD_DWORD_MEMCPY)
  733. VSTD_API_0 void VSTD_API_1 VStdRamMemCpy32(void *pDest, void *pSrc, vuint16 nDWordCnt) VSTD_API_2;
  734. # endif
  735. /* CODE CATEGORY 1 END */
  736.  
  737. /* Declaration of additional memory manipulation functions */
  738. # endif /* VSTD_ENABLE_API_AUTOSAR */
  739.  
  740. # if defined(VSTD_ENABLE_INTCTRL_HANDLING)
  741.  
  742. /* interrupt control functions */
  743. # if defined(VSTD_ENABLE_DEFAULT_INTCTRL)
  744.  
  745. /* CODE CATEGORY 1 START */
  746. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdSuspendAllInterrupts(void) VSTD_API_2;
  747. /* CODE CATEGORY 1 END */
  748.  
  749. /* CODE CATEGORY 1 START */
  750. VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdResumeAllInterrupts(void) VSTD_API_2;
  751. /* CODE CATEGORY 1 END */
  752. # endif
  753.  
  754. /* Declaration of additional Irq Support functions */
  755. #if defined(VSTD_ENABLE_DEFAULT_INTCTRL)
  756.  
  757. # if defined (V_COMP_GHS)
  758. # if defined (V_ARM_CORTEX_M)
  759. void VStdLL_GlobalInterruptDisable(tVStdIrqStateType* localInterruptOldStatusPtr);
  760. void VStdLL_GlobalInterruptRestore(tVStdIrqStateType localInterruptOldStatus);
  761. # endif
  762. # endif
  763.  
  764. #endif /* if defined(VSTD_ENABLE_DEFAULT_INTCTRL) */
  765. # endif
  766.  
  767. /* *******************************************************************************************************************/
  768. /* Callback functions */
  769. /* *******************************************************************************************************************/
  770. # if defined(VSTD_ENABLE_DEBUG_SUPPORT)
  771. /* CODE CATEGORY 4 START */
  772. VSTD_DEF_FUNC_CBK(VSTD_NONE, void, CODE) ApplVStdFatalError(vuint8 nErrorNumber);
  773. /* CODE CATEGORY 4 END */
  774. # endif
  775.  
  776. /* PRQA L:MACRO_ARGUMENT_EMPTY */
  777. # if defined(VSTD_ENABLE_API_AUTOSAR) || defined(VSTD_ENABLE_FCT_MEMMAP)
  778. # define VSTDLIB_STOP_SEC_CODE
  779. # include "MemMap.h" /* PRQA S 5087 */ /* MD_MSR_19.1 */
  780. # endif
  781.  
  782. #endif
  783.  
  784.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:247: error: illegal character: '#'
#if !defined(_VSTDLIB_H_)
^
Main.java:247: error: class, interface, or enum expected
#if !defined(_VSTDLIB_H_)
    ^
Main.java:248: error: illegal character: '#'
# define _VSTDLIB_H_
^
Main.java:251: error: illegal character: '#'
# include "v_cfg.h"
^
Main.java:254: error: illegal character: '#'
#if defined(VGEN_ENABLE_GW_ASRPDUR)
^
Main.java:255: error: illegal character: '#'
# define VSTD_ENABLE_MSR_LIB_VERSION_CHECK
^
Main.java:256: error: illegal character: '#'
# define VSTD_ENABLE_API_AUTOSAR
^
Main.java:257: error: illegal character: '#'
#endif
^
Main.java:259: error: illegal character: '#'
#if defined (VSTD_ENABLE_API_AUTOSAR)
^
Main.java:261: error: illegal character: '#'
# include "Std_Types.h"
^
Main.java:262: error: illegal character: '#'
# include "Compiler.h"
^
Main.java:263: error: illegal character: '#'
#else
^
Main.java:264: error: illegal character: '#'
# include "v_def.h"
^
Main.java:265: error: illegal character: '#'
#endif
^
Main.java:274: error: illegal character: '#'
#define VSTDLIB_ARM7_VERSION           0x0214u
^
Main.java:275: error: illegal character: '#'
#define VSTDLIB_ARM7_RELEASE_VERSION   0x00u
^
Main.java:278: error: illegal character: '#'
# define VSTDLIB__COREHLL_VERSION           0x0309u
^
Main.java:279: error: illegal character: '#'
# define VSTDLIB__COREHLL_RELEASE_VERSION   0x00u
^
Main.java:282: error: illegal character: '#'
# define COMMON_VSTDLIB_VERSION             VSTDLIB__COREHLL_VERSION
^
Main.java:283: error: illegal character: '#'
# define COMMON_VSTDLIB_RELEASE_VERSION     VSTDLIB__COREHLL_RELEASE_VERSION
^
Main.java:285: error: illegal character: '#'
#if defined (V_COMP_GHS)
^
Main.java:286: error: illegal character: '#'
# if defined(VSTD_ENABLE_DEFAULT_INTCTRL)
^
Main.java:287: error: illegal character: '#'
#  include <arm_ghs.h>
^
Main.java:288: error: illegal character: '#'
# endif
^
Main.java:289: error: illegal character: '#'
#endif
^
Main.java:291: error: illegal character: '#'
#if defined (VSTD_ENABLE_FIQ_INTCTRL)
^
Main.java:292: error: illegal character: '#'
# define kIrqIbitMask  ((vuint32)0x000000C0)
^
Main.java:293: error: illegal character: '#'
#else
^
Main.java:294: error: illegal character: '#'
# define kIrqIbitMask  ((vuint32)0x00000080)
^
Main.java:295: error: illegal character: '#'
#endif
^
Main.java:297: error: illegal character: '#'
#if defined (V_COMP_GHS)
^
Main.java:298: error: illegal character: '#'
# if defined (__CortexM3) || defined (__CortexM4) || defined (__CortexM7)
^
Main.java:299: error: illegal character: '#'
#  if !defined (V_ARM_CORTEX_M)
^
Main.java:300: error: illegal character: '#'
#   define V_ARM_CORTEX_M
^
Main.java:301: error: illegal character: '#'
#  endif
^
Main.java:302: error: illegal character: '#'
# endif
^
Main.java:303: error: illegal character: '#'
#endif
^
Main.java:306: error: illegal character: '#'
# if !defined(VSTD_API_0)
^
Main.java:307: error: illegal character: '#'
#  define VSTD_API_0
^
Main.java:308: error: illegal character: '#'
# endif
^
Main.java:310: error: illegal character: '#'
# if !defined(VSTD_API_1)
^
Main.java:311: error: illegal character: '#'
#  define VSTD_API_1
^
Main.java:312: error: illegal character: '#'
# endif
^
Main.java:314: error: illegal character: '#'
# if !defined(VSTD_API_2)
^
Main.java:315: error: illegal character: '#'
#  define VSTD_API_2
^
Main.java:316: error: illegal character: '#'
# endif
^
Main.java:318: error: illegal character: '#'
# if !defined(VSTD_CALLBACK_0)
^
Main.java:319: error: illegal character: '#'
#  define VSTD_CALLBACK_0
^
Main.java:320: error: illegal character: '#'
# endif
^
Main.java:322: error: illegal character: '#'
# if !defined(VSTD_CALLBACK_1)
^
Main.java:323: error: illegal character: '#'
#  define VSTD_CALLBACK_1
^
Main.java:324: error: illegal character: '#'
# endif
^
Main.java:326: error: illegal character: '#'
# if !defined(VSTD_NONE)
^
Main.java:327: error: illegal character: '#'
#  define VSTD_NONE
^
Main.java:328: error: illegal character: '#'
# endif
^
Main.java:331: error: illegal character: '#'
# if defined(VSTD_ENABLE_API_AUTOSAR)
^
Main.java:333: error: illegal character: '#'
#  if !defined(VSTD_USE_MEMORY_MACROS)
^
Main.java:334: error: illegal character: '#'
#   define VSTD_USE_MEMORY_MACROS STD_OFF
^
Main.java:335: error: illegal character: '#'
#  endif
^
Main.java:337: error: illegal character: '#'
# endif
^
Main.java:340: error: illegal character: '#'
# if defined(VSTD_ENABLE_API_AUTOSAR)
^
Main.java:341: error: illegal character: '#'
#  if !defined(VSTDLIB_AUTOMATIC)
^
Main.java:342: error: illegal character: '#'
#    define VSTDLIB_AUTOMATIC AUTOMATIC
^
Main.java:343: error: illegal character: '#'
#  endif
^
Main.java:344: error: illegal character: '#'
#  if !defined(V_NULL)
^
Main.java:345: error: illegal character: '#'
#   define V_NULL NULL_PTR
^
Main.java:346: error: illegal character: '#'
#  endif
^
Main.java:351: error: illegal character: '#'
#  define VSTD_DEF_VAR(storage, vartype, memclass)                    storage VAR(vartype, VSTDLIB_##memclass)
^
Main.java:351: error: illegal character: '#'
#  define VSTD_DEF_VAR(storage, vartype, memclass)                    storage VAR(vartype, VSTDLIB_##memclass)
                                                                                                   ^
Main.java:351: error: illegal character: '#'
#  define VSTD_DEF_VAR(storage, vartype, memclass)                    storage VAR(vartype, VSTDLIB_##memclass)
                                                                                                    ^
Main.java:352: error: illegal character: '#'
#  define VSTD_DEF_VAR_TYPE(storage, vartype)                         typedef storage VAR(vartype, TYPEDEF)
^
Main.java:353: error: illegal character: '#'
#  define VSTD_DEF_P2VAR(storage, ptrtype, memclass, ptrclass)        storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
^
Main.java:353: error: illegal character: '#'
#  define VSTD_DEF_P2VAR(storage, ptrtype, memclass, ptrclass)        storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                     ^
Main.java:353: error: illegal character: '#'
#  define VSTD_DEF_P2VAR(storage, ptrtype, memclass, ptrclass)        storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                      ^
Main.java:353: error: illegal character: '#'
#  define VSTD_DEF_P2VAR(storage, ptrtype, memclass, ptrclass)        storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                         ^
Main.java:353: error: illegal character: '#'
#  define VSTD_DEF_P2VAR(storage, ptrtype, memclass, ptrclass)        storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                          ^
Main.java:354: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_TYPE(storage, ptrtype, ptrclass)             typedef storage P2VAR(ptrtype, TYPEDEF, VSTDLIB_##ptrclass)
^
Main.java:354: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_TYPE(storage, ptrtype, ptrclass)             typedef storage P2VAR(ptrtype, TYPEDEF, VSTDLIB_##ptrclass)
                                                                                                                      ^
Main.java:354: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_TYPE(storage, ptrtype, ptrclass)             typedef storage P2VAR(ptrtype, TYPEDEF, VSTDLIB_##ptrclass)
                                                                                                                       ^
Main.java:355: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_PARA(storage, ptrtype, memclass, ptrclass)   storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
^
Main.java:355: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_PARA(storage, ptrtype, memclass, ptrclass)   storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                     ^
Main.java:355: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_PARA(storage, ptrtype, memclass, ptrclass)   storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                      ^
Main.java:355: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_PARA(storage, ptrtype, memclass, ptrclass)   storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                         ^
Main.java:355: error: illegal character: '#'
#  define VSTD_DEF_P2VAR_PARA(storage, ptrtype, memclass, ptrclass)   storage P2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                          ^
Main.java:356: error: illegal character: '#'
#  define VSTD_DEF_CONSTP2VAR(storage, ptrtype, memclass, ptrclass)   storage CONSTP2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
^
Main.java:356: error: illegal character: '#'
#  define VSTD_DEF_CONSTP2VAR(storage, ptrtype, memclass, ptrclass)   storage CONSTP2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                          ^
Main.java:356: error: illegal character: '#'
#  define VSTD_DEF_CONSTP2VAR(storage, ptrtype, memclass, ptrclass)   storage CONSTP2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                           ^
Main.java:356: error: illegal character: '#'
#  define VSTD_DEF_CONSTP2VAR(storage, ptrtype, memclass, ptrclass)   storage CONSTP2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                              ^
Main.java:356: error: illegal character: '#'
#  define VSTD_DEF_CONSTP2VAR(storage, ptrtype, memclass, ptrclass)   storage CONSTP2VAR(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                               ^
Main.java:357: error: illegal character: '#'
#  define VSTD_DEF_CONST(storage, vartype, memclass)                  storage CONST(vartype, VSTDLIB_##memclass)
^
Main.java:357: error: illegal character: '#'
#  define VSTD_DEF_CONST(storage, vartype, memclass)                  storage CONST(vartype, VSTDLIB_##memclass)
                                                                                                     ^
Main.java:357: error: illegal character: '#'
#  define VSTD_DEF_CONST(storage, vartype, memclass)                  storage CONST(vartype, VSTDLIB_##memclass)
                                                                                                      ^
Main.java:358: error: illegal character: '#'
#  define VSTD_DEF_CONST_TYPE(storage, vartype)                       typedef storage CONST(vartype, TYPEDEF)
^
Main.java:359: error: illegal character: '#'
#  define VSTD_DEF_P2CONST(storage, ptrtype, memclass, ptrclass)      storage P2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
^
Main.java:359: error: illegal character: '#'
#  define VSTD_DEF_P2CONST(storage, ptrtype, memclass, ptrclass)      storage P2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                       ^
Main.java:359: error: illegal character: '#'
#  define VSTD_DEF_P2CONST(storage, ptrtype, memclass, ptrclass)      storage P2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                        ^
Main.java:359: error: illegal character: '#'
#  define VSTD_DEF_P2CONST(storage, ptrtype, memclass, ptrclass)      storage P2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                           ^
Main.java:359: error: illegal character: '#'
#  define VSTD_DEF_P2CONST(storage, ptrtype, memclass, ptrclass)      storage P2CONST(ptrtype, VSTDLIB_##memclass, VSTDLIB_##ptrclass)
                                                                                                                            ^
Main.java:360: error: illegal character: '#'
#  define VSTD_DEF_P2CONST_TYPE(storage, ptrtype, ptrclass)           typedef storage P2CONST(ptrtype, TYPEDEF, VSTDLIB_##ptrclass)
^
Main.java:360: error: illegal character: '#'
#  define VSTD_DEF_P2CONST_TYPE(storage, ptrtype, ptrclass)           typedef storage P2CONST(ptrtype, TYPEDEF, VSTDLIB_##ptrclass)
                                                                                                                        ^
100 errors
stdout
Standard output is empty