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/nios2.h>
0041 
0042 /**
0043  * @defgroup RTEMSScoreCPUnios2ASM nios2 Assembler Support
0044  *
0045  * @ingroup RTEMSScoreCPUnios2
0046  *
0047  * @brief nios2 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) CONCAT1 (__USER_LABEL_PREFIX__, x)
0072 
0073 /* Use the right prefix for registers.  */
0074 
0075 #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
0076 
0077 /*
0078  *  define macros for all of the registers on this CPU
0079  *
0080  *  EXAMPLE:     #define d0 REG (d0)
0081  */
0082 
0083 /*
0084  *  Define macros to handle section beginning and ends.
0085  */
0086 
0087 
0088 #define BEGIN_CODE_DCL .text
0089 #define END_CODE_DCL
0090 #define BEGIN_DATA_DCL .data
0091 #define END_DATA_DCL
0092 #define BEGIN_CODE .text
0093 #define END_CODE
0094 #define BEGIN_DATA
0095 #define END_DATA
0096 #define BEGIN_BSS
0097 #define END_BSS
0098 #define END
0099 
0100 /*
0101  *  Following must be tailor for a particular flavor of the C compiler.
0102  *  They may need to put underscores in front of the symbols.
0103  */
0104 
0105 #define PUBLIC(sym) .globl SYM (sym)
0106 #define EXTERN(sym) .globl SYM (sym)
0107 
0108 /** @} */
0109 
0110 #endif