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 /* @(#)asm.h       03/15/96     1.1 */
0029 
0030 #ifndef _RTEMS_ASM_H
0031 #define _RTEMS_ASM_H
0032 
0033 /*
0034  *  Indicate we are in an assembly file and get the basic CPU definitions.
0035  */
0036 
0037 #ifndef ASM
0038 #define ASM
0039 #endif
0040 #include <rtems/score/cpuopts.h>
0041 #include <rtems/score/mips.h>
0042 
0043 /*
0044  *  Recent versions of GNU cpp define variables which indicate the
0045  *  need for underscores and percents.  If not using GNU cpp or
0046  *  the version does not support this, then you will obviously
0047  *  have to define these as appropriate.
0048  */
0049 
0050 #ifndef __USER_LABEL_PREFIX__
0051 #define __USER_LABEL_PREFIX__ _
0052 #endif
0053 
0054 #ifndef __REGISTER_PREFIX__
0055 #define __REGISTER_PREFIX__
0056 #endif
0057 
0058 #include <rtems/concat.h>
0059 
0060 /* Use the right prefix for global labels.  */
0061 
0062 #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
0063 
0064 /* Use the right prefix for registers.  */
0065 
0066 #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
0067 
0068 /*
0069  *  define macros for all of the registers on this CPU
0070  *
0071  *  EXAMPLE:     #define d0 REG (d0)
0072  */
0073 
0074 /*
0075  *  Define macros to handle section beginning and ends.
0076  */
0077 
0078 
0079 #define BEGIN_CODE_DCL .text
0080 #define END_CODE_DCL
0081 #define BEGIN_DATA_DCL .data
0082 #define END_DATA_DCL
0083 #define BEGIN_CODE .text
0084 #define END_CODE
0085 #define BEGIN_DATA
0086 #define END_DATA
0087 #define BEGIN_BSS
0088 #define END_BSS
0089 #define END
0090 
0091 /*
0092  *  Following must be tailor for a particular flavor of the C compiler.
0093  *  They may need to put underscores in front of the symbols.
0094  */
0095 
0096 #define PUBLIC(sym) .globl SYM (sym)
0097 #define EXTERN(sym) .globl SYM (sym)
0098 
0099 /*
0100  *  Debugger macros for assembly language routines. Allows the
0101  *  programmer to set up the necessary stack frame info
0102  *  required by debuggers to do stack traces.
0103  */
0104 
0105 #ifndef XDS
0106 #define FRAME(name,frm_reg,offset,ret_reg)      \
0107         .globl  name;                           \
0108         .ent    name;                           \
0109 name:;                                          \
0110         .frame  frm_reg,offset,ret_reg
0111 #define ENDFRAME(name)                          \
0112         .end name
0113 #else
0114 #define FRAME(name,frm_reg,offset,ret_reg)      \
0115         .globl  _##name;\
0116 _##name:
0117 #define ENDFRAME(name)
0118 #endif /* XDS */
0119 
0120 /*
0121  * Hardware Floating Point Registers
0122  */
0123 
0124 #define R_FP0   0
0125 #define R_FP1   1
0126 #define R_FP2   2
0127 #define R_FP3   3
0128 #define R_FP4   4
0129 #define R_FP5   5
0130 #define R_FP6   6
0131 #define R_FP7   7
0132 #define R_FP8   8
0133 #define R_FP9   9
0134 #define R_FP10  10
0135 #define R_FP11  11
0136 #define R_FP12  12
0137 #define R_FP13  13
0138 #define R_FP14  14
0139 #define R_FP15  15
0140 #define R_FP16  16
0141 #define R_FP17  17
0142 #define R_FP18  18
0143 #define R_FP19  19
0144 #define R_FP20  20
0145 #define R_FP21  21
0146 #define R_FP22  22
0147 #define R_FP23  23
0148 #define R_FP24  24
0149 #define R_FP25  25
0150 #define R_FP26  26
0151 #define R_FP27  27
0152 #define R_FP28  28
0153 #define R_FP29  29
0154 #define R_FP30  30
0155 #define R_FP31  31
0156 
0157 #endif
0158 /* end of include file */
0159