Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:24

0001 /**
0002  * @file
0003  * 
0004  * @brief Address the Problems Caused by Incompatible Flavor of 
0005  * Assemblers and Toolsets
0006  *
0007  * This include file attempts to address the problems
0008  * caused by incompatible flavors of assemblers and
0009  * toolsets.  It primarily addresses variations in the
0010  * use of leading underscores on symbols and the requirement
0011  * that register names be preceded by a %.
0012  * 
0013  * NOTE: The spacing in the use of these macros
0014  *       is critical to them working as advertised.
0015  */
0016 
0017 /*
0018  *  COPYRIGHT:
0019  *
0020  *  This file is based on similar code found in newlib available
0021  *  from ftp.cygnus.com.  The file which was used had no copyright
0022  *  notice.  This file is freely distributable as long as the source
0023  *  of the file is noted.  This file is:
0024  *
0025  *  COPYRIGHT (c) 1994-1997.
0026  *  On-Line Applications Research Corporation (OAR).
0027  */
0028 
0029 #ifndef _RTEMS_ASM_H
0030 #define _RTEMS_ASM_H
0031 
0032 /*
0033  *  Indicate we are in an assembly file and get the basic CPU definitions.
0034  */
0035 
0036 #ifndef ASM
0037 #define ASM
0038 #endif
0039 #include <rtems/score/cpuopts.h>
0040 #include <rtems/score/cpu.h>
0041 
0042 /**
0043  * @defgroup RTEMSScoreCPUm68kASM m68k Assembler Support
0044  *
0045  * @ingroup RTEMSScoreCPUm68k
0046  *
0047  * @brief Motorola 68000 and NXP ColdFire (m68k) Assembler Support
0048  *
0049  * @{
0050  */
0051 
0052 /*
0053  *  Recent versions of GNU cpp define variables which indicate the
0054  *  need for underscores and percents.  If not using GNU cpp or
0055  *  the version does not support this, then you will obviously
0056  *  have to define these as appropriate.
0057  */
0058 
0059 #ifndef __USER_LABEL_PREFIX__
0060 #define __USER_LABEL_PREFIX__ _
0061 #endif
0062 
0063 #ifndef __REGISTER_PREFIX__
0064 #define __REGISTER_PREFIX__
0065 #endif
0066 
0067 #include <rtems/concat.h>
0068 
0069 /* Use the right prefix for global labels.  */
0070 
0071 #define SYM(x) CONCAT0 (__USER_LABEL_PREFIX__, x)
0072 
0073 /* Use the right prefix for registers.  */
0074 
0075 #define REG(x) CONCAT0 (__REGISTER_PREFIX__, x)
0076 
0077 #define d0 REG (d0)
0078 #define d1 REG (d1)
0079 #define d2 REG (d2)
0080 #define d3 REG (d3)
0081 #define d4 REG (d4)
0082 #define d5 REG (d5)
0083 #define d6 REG (d6)
0084 #define d7 REG (d7)
0085 #define a0 REG (a0)
0086 #define a1 REG (a1)
0087 #define a2 REG (a2)
0088 #define a3 REG (a3)
0089 #define a4 REG (a4)
0090 #define a5 REG (a5)
0091 #define a6 REG (a6)
0092 #define a7 REG (a7)
0093 #define sp REG (sp)
0094 
0095 #define msp REG (msp)
0096 #define usp REG (usp)
0097 #define isp REG (isp)
0098 #define sr  REG (sr)
0099 #define vbr REG (vbr)
0100 #define dfc REG (dfc)
0101 #define sfc REG (sfc)
0102 
0103 /* mcf52xx special regs */
0104 #define cacr    REG (cacr)
0105 #define acr0    REG (acr0)
0106 #define acr1    REG (acr1)
0107 #define rambar0 REG (rambar0)
0108 #define mbar    REG (mbar)
0109 
0110 /* additional v4e special regs */
0111 #define rambar1   REG (rambar1)
0112 #define macsr     REG (macsr)
0113 #define acc0      REG (acc0)
0114 #define acc1      REG (acc1)
0115 #define acc2      REG (acc2)
0116 #define acc3      REG (acc3)
0117 #define accext01  REG (accext01)
0118 #define accext23  REG (accext23)
0119 #define mask      REG (mask)
0120 
0121 
0122 #define fp0 REG (fp0)
0123 #define fp1 REG (fp1)
0124 #define fp2 REG (fp2)
0125 #define fp3 REG (fp3)
0126 #define fp4 REG (fp4)
0127 #define fp5 REG (fp5)
0128 #define fp6 REG (fp6)
0129 #define fp7 REG (fp7)
0130 
0131 #define fpc REG (fpc)
0132 #define fpi REG (fpi)
0133 #define fps REG (fps)
0134 #define fpsr REG (fpsr)
0135 
0136 
0137 /*
0138  *  Define macros to handle section beginning and ends.
0139  */
0140 
0141 
0142 #define BEGIN_CODE_DCL .text
0143 #define END_CODE_DCL
0144 #define BEGIN_DATA_DCL .data
0145 #define END_DATA_DCL
0146 #define BEGIN_CODE .text
0147 #define END_CODE
0148 #define BEGIN_DATA .data
0149 #define END_DATA
0150 #define BEGIN_BSS .bss
0151 #define END_BSS
0152 #define END
0153 
0154 /*
0155  *  Following must be tailor for a particular flavor of the C compiler.
0156  *  They may need to put underscores in front of the symbols.
0157  */
0158 
0159 #define PUBLIC(sym) .globl SYM (sym)
0160 #define EXTERN(sym) .globl SYM (sym)
0161 
0162 /** @} */
0163 
0164 #endif