Back to home page

LXR

 
 

    


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

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.
0024  */
0025 
0026 #ifndef _RTEMS_ASM_H
0027 #define _RTEMS_ASM_H
0028 
0029 /*
0030  *  Indicate we are in an assembly file and get the basic CPU definitions.
0031  */
0032 
0033 #ifndef ASM
0034 #define ASM
0035 #endif
0036 #ifndef __ASM__
0037 #define __ASM__
0038 #endif
0039 
0040 #include <rtems/score/cpuopts.h>
0041 #include <rtems/score/cpu.h>
0042 
0043 /**
0044  * @defgroup RTEMSScoreCPUSPARC64ASM SPARC64 Assembler Support
0045  *
0046  * @ingroup RTEMSScoreCPUSPARC64
0047  *
0048  * @brief SPARC64 Assembler Support
0049  *
0050  * @{
0051  */
0052 
0053 /*
0054  *  Recent versions of GNU cpp define variables which indicate the
0055  *  need for underscores and percents.  If not using GNU cpp or
0056  *  the version does not support this, then you will obviously
0057  *  have to define these as appropriate.
0058  */
0059 
0060 /* XXX __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ do not work on gcc 2.7.0 */
0061 /* XXX The following ifdef magic fixes the problem but results in a warning   */
0062 /* XXX when compiling assembly code.                                          */
0063 
0064 #ifndef __USER_LABEL_PREFIX__
0065 #define __USER_LABEL_PREFIX__ _
0066 #endif
0067 
0068 #ifndef __REGISTER_PREFIX__
0069 #define __REGISTER_PREFIX__
0070 #endif
0071 
0072 #include <rtems/concat.h>
0073 
0074 /* Use the right prefix for global labels.  */
0075 
0076 #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
0077 
0078 /* Use the right prefix for registers.  */
0079 
0080 #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
0081 
0082 /*
0083  *  define macros for all of the registers on this CPU
0084  *
0085  *  EXAMPLE:     #define d0 REG (d0)
0086  */
0087 
0088 /*
0089  *  Define macros to handle section beginning and ends.
0090  */
0091 
0092 
0093 #define BEGIN_CODE_DCL .text
0094 #define END_CODE_DCL
0095 #define BEGIN_DATA_DCL .data
0096 #define END_DATA_DCL
0097 #define BEGIN_CODE .text
0098 #define END_CODE
0099 #define BEGIN_DATA
0100 #define END_DATA
0101 #define BEGIN_BSS
0102 #define END_BSS
0103 #define END
0104 
0105 /*
0106  *  Following must be tailor for a particular flavor of the C compiler.
0107  *  They may need to put underscores in front of the symbols.
0108  */
0109 
0110 #define PUBLIC(sym) .globl SYM (sym)
0111 #define EXTERN(sym) .globl SYM (sym)
0112 
0113 #endif
0114 
0115 /** @} */