
C28x Embedded Application Binary Interface Application Report Literature Number: SPRAC71A March 2019–Revised February 2020 Contents 1 Introduction......................................................................................................................... 7 1.1 ABIs for the C28x ........................................................................................................ 7 1.2 Scope ...................................................................................................................... 8 1.3 ABI Variants............................................................................................................... 9 1.4 Toolchains and Interoperability......................................................................................... 9 1.5 Libraries ................................................................................................................... 9 1.6 Types of Object Files................................................................................................... 10 1.7 Segments ................................................................................................................ 10 1.8 C28x Architecture Overview........................................................................................... 10 1.9 C28x Memory Models.................................................................................................. 10 1.10 Reference Documents ................................................................................................. 11 1.11 Code Fragment Notation............................................................................................... 11 2 Data Representation ........................................................................................................... 12 2.1 Basic Types ............................................................................................................. 12 2.2 Data in Registers ....................................................................................................... 13 2.3 Data in Memory ......................................................................................................... 13 2.4 Pointer Types ........................................................................................................... 13 2.5 Complex Types ......................................................................................................... 14 2.6 Structures and Unions ................................................................................................. 14 2.7 Arrays .................................................................................................................... 14 2.8 Bit Fields ................................................................................................................. 14 2.8.1 Volatile Bit Fields............................................................................................ 15 2.9 Enumeration Types..................................................................................................... 16 3 Calling Conventions ........................................................................................................... 17 3.1 Call and Return ......................................................................................................... 17 3.1.1 Call Instructions ............................................................................................. 17 3.1.1.1 Indirect Calls ............................................................................................ 17 3.1.1.2 Direct Calls .............................................................................................. 17 3.1.2 Return Instruction ........................................................................................... 17 3.1.3 Pipeline Conventions ....................................................................................... 17 3.1.4 Weak Functions ............................................................................................. 17 3.2 Register Conventions .................................................................................................. 17 3.2.1 Argument Registers......................................................................................... 19 3.2.2 Callee-Saved Registers .................................................................................... 20 3.3 Argument Passing ...................................................................................................... 20 3.3.1 Passing 16-Bit Arguments ................................................................................. 20 3.3.2 Passing Longer Arguments................................................................................ 21 3.3.3 C++ Argument Passing .................................................................................... 21 3.3.4 Passing Structs and Unions ............................................................................... 21 3.3.5 Stack Layout of Arguments Not Passed in Registers .................................................. 21 3.3.6 Frame Pointer ............................................................................................... 22 3.4 Return Values ........................................................................................................... 22 3.5 Structures and Unions Passed and Returned by Reference ..................................................... 22 2 Table of Contents SPRAC71A–March 2019–Revised February 2020 Submit Documentation Feedback Copyright © 2019–2020, Texas Instruments Incorporated www.ti.com 3.6 Conventions for Compiler Helper Functions ........................................................................ 23 3.7 Prolog and Epilog Helper Functions ................................................................................. 23 3.8 Scratch Registers for Functions Already Seen ..................................................................... 23 3.9 Interrupt Functions...................................................................................................... 24 4 Data Allocation and Addressing ........................................................................................... 25 4.1 Data Sections and Segments ......................................................................................... 25 4.2 Data Blocking ........................................................................................................... 26 4.3 Addressing Modes...................................................................................................... 26 4.4 Allocation and Addressing of Static Data ........................................................................... 26 4.4.1 Addressing Methods for Static Data...................................................................... 27 4.4.2 Placement Conventions for Static Data .................................................................. 27 4.4.2.1 Abstract Conventions for Addressing ................................................................ 27 4.4.3 Initialization of Static Data ................................................................................. 27 4.5 Automatic Variables .................................................................................................... 27 4.6 Frame Layout ........................................................................................................... 28 4.6.1 Stack Alignment ............................................................................................. 29 4.6.2 Register Save Order........................................................................................ 29 4.7 Heap-Allocated Objects................................................................................................ 29 5 Code Allocation and Addressing .......................................................................................... 30 5.1 Computing the Address of a Code Label............................................................................ 30 5.2 Calls ...................................................................................................................... 30 5.2.1 Direct Call .................................................................................................... 30 5.2.2 Far Call Trampoline......................................................................................... 30 5.2.3 Indirect Calls................................................................................................. 30 6 Helper Function API............................................................................................................ 31 6.1 Floating-Point Behavior ................................................................................................ 31 6.2 C Helper Function API ................................................................................................. 31 6.3 Floating-Point Helper Functions for C99............................................................................. 33 7 Standard C Library API ....................................................................................................... 34 7.1 Reserved Symbols ..................................................................................................... 34 7.2 <assert.h> Implementation ............................................................................................ 34 7.3 <complex.h> Implementation ........................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages78 Page
-
File Size-