Specification of Compiler Abstraction
Total Page:16
File Type:pdf, Size:1020Kb
Specification of Compiler Abstraction V2.2.1 R3.2 Rev 3 Document Title Specification of Compiler Abstraction Document Owner AUTOSAR Document Responsibility AUTOSAR Document Identification No 051 Document Classification Standard Document Version 2.2.1 Document Status Final Part of Release 3.2 Revision 3 Document Change History Date Version Changed by Change Description 28.02.2014 2.2.1 AUTOSAR Editorial changes Release Management 17.05.2012 2.2.0 AUTOSAR Added pointer class ‘REGSPACE’ (for Administration register access) 07.04.2011 2.1.0 AUTOSAR Addtition of the macros Administration FUNC_P2CONST(COMPILER061, COMPILER062) and FUNC_P2VAR(COMPILER063, COMPILER064) (see bug #43874) Rework of COMPILER058 to be compatible to the added macros 23.06.2008 2.0.1 AUTOSAR Legal disclaimer revised Administration 27.11.2007 2.0.0 AUTOSAR Keyword "_STATIC_" has been renamed Administration to "STATIC" Keyword "_INLINE_" has been renamed to "INLINE" Keyword "TYPEDEF" has been added as empty memory qualifier for use in type definitions Document meta information extended Small layout adaptations made 31.01.2007 1.1.0 AUTOSAR Add: COMPILER058 Administration Add: COMPILER057 Change: COMPILER040 Legal disclaimer revised Release Notes added “Advice for users” revised “Revision Information” added 1 of 44 Document ID 051: AUTOSAR_SWS_CompilerAbstraction - AUTOSAR confidential - Specification of Compiler Abstraction V2.2.1 R3.2 Rev 3 Document Change History Date Version Changed by Change Description 27.04.2006 1.0.0 AUTOSAR Initial Release Administration 2 of 44 Document ID 051: AUTOSAR_SWS_CompilerAbstraction - AUTOSAR confidential - Specification of Compiler Abstraction V2.2.1 R3.2 Rev 3 Disclaimer This specification and the material contained in it, as released by AUTOSAR is for the purpose of information only. AUTOSAR and the companies that have contributed to it shall not be liable for any use of the specification. The material contained in this specification is protected by copyright and other types of Intellectual Property Rights. The commercial exploitation of the material contained in this specification requires a license to such Intellectual Property Rights. This specification may be utilized or reproduced without any modification, in any form or by any means, for informational purposes only. For any other purpose, no part of the specification may be utilized or reproduced, in any form or by any means, without permission in writing from the publisher. The AUTOSAR specifications have been developed for automotive applications only. They have neither been developed, nor tested for non-automotive applications. The word AUTOSAR and the AUTOSAR logo are registered trademarks. Advice for users AUTOSAR Specification Documents may contain exemplary items (exemplary reference models, "use cases", and/or references to exemplary technical solutions, devices, processes or software). Any such exemplary items are contained in the Specification Documents for illustration purposes only, and they themselves are not part of the AUTOSAR Standard. Neither their presence in such Specification Documents, nor any later documentation of AUTOSAR conformance of products actually implementing such exemplary items, imply that intellectual property rights covering such exemplary items are licensed under the same rules as applicable to the AUTOSAR Standard. 3 of 44 Document ID 051: AUTOSAR_SWS_CompilerAbstraction - AUTOSAR confidential - Specification of Compiler Abstraction V2.2.1 R3.2 Rev 3 Table of Contents 1 Introduction and functional overview ................................................................... 6 2 Acronyms and abbreviations ............................................................................... 7 3 Related documentation........................................................................................ 8 3.1 Input documents ........................................................................................... 8 3.2 Related standards and norms ...................................................................... 9 4 Constraints and assumptions ............................................................................ 10 4.1 Limitations .................................................................................................. 10 4.2 Applicability to car domains ........................................................................ 10 4.3 Applicability to safety related environments ............................................... 10 5 Dependencies to other modules ........................................................................ 11 5.1 Code file structure ...................................................................................... 11 5.2 Header file structure ................................................................................... 11 5.3 Connections to other modules .................................................................... 11 5.3.1 Compiler Abstraction ........................................................................... 11 5.3.2 Memory Mapping ................................................................................ 11 5.3.3 Linker-Settings .................................................................................... 12 6 Requirements traceability .................................................................................. 13 7 Analysis ............................................................................................................. 18 7.1 Keywords for functions ............................................................................... 18 7.2 Keywords for pointers ................................................................................. 19 8 Functional specification ..................................................................................... 24 8.1 General issues ........................................................................................... 24 8.2 Contents of Compiler.h ............................................................................... 24 8.3 Contents of Compiler_Cfg.h ....................................................................... 25 9 API specification ................................................................................................ 26 9.1 Definitions .................................................................................................. 26 9.1.1 memory class AUTOMATIC ................................................................ 26 9.1.2 memory class TYPEDEF .................................................................... 26 9.1.3 STATIC ............................................................................................... 26 9.1.4 NULL_PTR .......................................................................................... 26 9.1.5 INLINE ................................................................................................ 27 9.2 Macros for functions ................................................................................... 27 9.2.1 FUNC .................................................................................................. 27 9.2.2 FUNC_P2CONST ............................................................................... 28 9.2.3 FUNC_P2VAR .................................................................................... 28 9.3 Macros for pointers ..................................................................................... 29 9.3.1 P2VAR ................................................................................................ 29 9.3.2 P2CONST ........................................................................................... 29 9.3.3 CONSTP2VAR .................................................................................... 30 9.3.4 CONSTP2CONST ............................................................................... 31 9.3.5 P2FUNC .............................................................................................. 31 4 of 44 Document ID 051: AUTOSAR_SWS_CompilerAbstraction - AUTOSAR confidential - Specification of Compiler Abstraction V2.2.1 R3.2 Rev 3 9.4 Keywords for constants .............................................................................. 32 9.4.1 CONST ............................................................................................... 32 9.5 Keywords for variables ............................................................................... 32 9.5.1 VAR ..................................................................................................... 32 10 Sequence diagrams ....................................................................................... 34 11 Configuration specification ............................................................................. 35 11.1 How to read this chapter ............................................................................ 35 11.1.1 Configuration and configuration parameters ....................................... 35 11.1.2 Variants ............................................................................................... 36 11.1.3 Containers ........................................................................................... 36 11.2 Containers and configuration parameters .................................................. 36 11.2.1 Variants ............................................................................................... 36 11.2.2 Module Configuration (Memory and pointer classes) .......................... 37 11.3 Published