C6000 Embedded Application Binary Interface (Rev. A)

C6000 Embedded Application Binary Interface (Rev. A)

C6000 Embedded Application Binary Interface Application Report Literature Number: SPRAB89A September 2011–Revised March 2014 Contents 1 Introduction ...................................................................................................................... 10 1.1 ABIs for the C6000 .................................................................................................... 10 1.2 Scope .................................................................................................................... 11 1.3 ABI Variants ............................................................................................................ 12 1.4 Toolchains and Interoperability ....................................................................................... 13 1.5 Libraries ................................................................................................................. 13 1.6 Types of Object Files .................................................................................................. 13 1.7 Segments ............................................................................................................... 14 1.8 C6000 Architecture Overview ........................................................................................ 14 1.9 Reference Documents ................................................................................................ 15 1.10 Code Fragment Notation .............................................................................................. 15 2 Data Representation .......................................................................................................... 16 2.1 Basic Types ............................................................................................................. 16 2.2 Data in Registers ....................................................................................................... 17 2.3 Data in Memory ........................................................................................................ 17 2.4 Complex Types ......................................................................................................... 18 2.5 Structures and Unions ................................................................................................. 18 2.6 Arrays .................................................................................................................... 19 2.7 Bit Fields ................................................................................................................ 19 2.7.1 Volatile Bit Fields ........................................................................................... 20 2.8 Enumeration Types .................................................................................................... 21 3 Calling Conventions .......................................................................................................... 22 3.1 Call and Return ........................................................................................................ 22 3.1.1 Return Address Computation ............................................................................. 22 3.1.2 Call Instructions ............................................................................................ 22 3.1.3 Return Instruction .......................................................................................... 22 3.1.4 Pipeline Conventions ...................................................................................... 23 3.1.5 Weak Functions ............................................................................................ 23 3.2 Register Conventions .................................................................................................. 23 3.3 Argument Passing ..................................................................................................... 25 3.4 Return Values .......................................................................................................... 25 3.5 Structures or Unions Passed and Returned by Reference ....................................................... 26 3.6 Conventions for Compiler Helper Functions ........................................................................ 26 3.7 Scratch Registers for Inter-Section Calls ........................................................................... 26 3.8 Setting Up DP .......................................................................................................... 26 4 Data Allocation and Addressing .......................................................................................... 27 4.1 Data Sections and Segments ........................................................................................ 27 4.2 Allocation and Addressing of Static Data ........................................................................... 28 4.2.1 Addressing Methods for Static Data ..................................................................... 29 4.2.1.1 Near DP-Relative Addressing ........................................................................ 29 4.2.1.2 Far DP-Relative Addressing .......................................................................... 29 4.2.1.3 Absolute Addressing .................................................................................. 30 2 Table of Contents SPRAB89A–September 2011–Revised March 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated www.ti.com 4.2.1.4 GOT-Indirect Addressing ............................................................................. 30 4.2.1.5 PC-Relative Addressing .............................................................................. 30 4.2.2 Placement Conventions for Static Data ................................................................. 30 4.2.2.1 Abstract Conventions for Placement ................................................................ 30 4.2.2.2 Abstract Conventions for Addressing ............................................................... 31 4.2.2.3 Linker Requirements .................................................................................. 31 4.2.3 Initialization of Static Data ................................................................................ 31 4.3 Automatic Variables ................................................................................................... 32 4.4 Frame Layout ........................................................................................................... 32 4.4.1 Stack Alignment ............................................................................................ 33 4.4.2 Register Save Order ....................................................................................... 34 4.4.2.1 Big-Endian Pair Swapping ............................................................................ 34 4.4.2.2 Examples ............................................................................................... 35 4.4.3 DATA_MEM_BANK ........................................................................................ 36 4.4.4 C64x+ Specific Stack Layouts ............................................................................ 36 4.4.4.1 _ _c6xabi_push_rts Layout ........................................................................... 36 4.4.4.2 Compact Frame Layout ............................................................................... 37 4.5 Heap-Allocated Objects ............................................................................................... 38 5 Code Allocation and Addressing ......................................................................................... 39 5.1 Computing the Address of a Code Label ........................................................................... 39 5.1.1 Absolute Addressing for Code ............................................................................ 39 5.1.2 PC-Relative Addressing ................................................................................... 39 5.1.3 PC-Relative Addressing Within the Same Section .................................................... 39 5.1.4 Short-Offset PC-Relative Addressing (C64x) ........................................................... 40 5.1.5 GOT-Based Addressing for Code ........................................................................ 40 5.2 Branching ............................................................................................................... 40 5.3 Calls ..................................................................................................................... 40 5.3.1 Direct PC-Relative Call .................................................................................... 40 5.3.2 Far Call Trampoline ........................................................................................ 40 5.3.3 Indirect Calls ................................................................................................ 41 5.4 Addressing Compact Instructions .................................................................................... 41 6 Addressing Model for Dynamic Linking ................................................................................ 43 6.1 Terms and Concepts .................................................................................................. 43 6.2 Overview of Dynamic Linking Mechanisms ........................................................................ 44 6.3 DSOs and DLLs .......................................................................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    144 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us