RTEMS  5.0.0
asm.h
Go to the documentation of this file.
1 
17 /*
18  * COPYRIGHT:
19  *
20  * This file is based on similar code found in newlib available
21  * from ftp.cygnus.com. The file which was used had no copyright
22  * notice. This file is freely distributable as long as the source
23  * of the file is noted. This file is:
24  *
25  * COPYRIGHT (c) 1994-1997.
26  * On-Line Applications Research Corporation (OAR).
27  */
28 
29 #ifndef _RTEMS_ASM_H
30 #define _RTEMS_ASM_H
31 
32 /*
33  * Indicate we are in an assembly file and get the basic CPU definitions.
34  */
35 
36 #ifndef ASM
37 #define ASM
38 #endif
39 #include <rtems/score/cpuopts.h>
40 #include <rtems/score/cpu.h>
41 
52 /*
53  * Recent versions of GNU cpp define variables which indicate the
54  * need for underscores and percents. If not using GNU cpp or
55  * the version does not support this, then you will obviously
56  * have to define these as appropriate.
57  */
58 
59 #ifndef __USER_LABEL_PREFIX__
60 #define __USER_LABEL_PREFIX__ _
61 #endif
62 
63 #ifndef __REGISTER_PREFIX__
64 #define __REGISTER_PREFIX__
65 #endif
66 
67 #include <rtems/concat.h>
68 
69 /* Use the right prefix for global labels. */
70 
71 #define SYM(x) CONCAT0 (__USER_LABEL_PREFIX__, x)
72 
73 /* Use the right prefix for registers. */
74 
75 #define REG(x) CONCAT0 (__REGISTER_PREFIX__, x)
76 
77 #define d0 REG (d0)
78 #define d1 REG (d1)
79 #define d2 REG (d2)
80 #define d3 REG (d3)
81 #define d4 REG (d4)
82 #define d5 REG (d5)
83 #define d6 REG (d6)
84 #define d7 REG (d7)
85 #define a0 REG (a0)
86 #define a1 REG (a1)
87 #define a2 REG (a2)
88 #define a3 REG (a3)
89 #define a4 REG (a4)
90 #define a5 REG (a5)
91 #define a6 REG (a6)
92 #define a7 REG (a7)
93 #define sp REG (sp)
94 
95 #define msp REG (msp)
96 #define usp REG (usp)
97 #define isp REG (isp)
98 #define sr REG (sr)
99 #define vbr REG (vbr)
100 #define dfc REG (dfc)
101 #define sfc REG (sfc)
102 
103 /* mcf52xx special regs */
104 #define cacr REG (cacr)
105 #define acr0 REG (acr0)
106 #define acr1 REG (acr1)
107 #define rambar0 REG (rambar0)
108 #define mbar REG (mbar)
109 
110 /* additional v4e special regs */
111 #define rambar1 REG (rambar1)
112 #define macsr REG (macsr)
113 #define acc0 REG (acc0)
114 #define acc1 REG (acc1)
115 #define acc2 REG (acc2)
116 #define acc3 REG (acc3)
117 #define accext01 REG (accext01)
118 #define accext23 REG (accext23)
119 #define mask REG (mask)
120 
121 
122 #define fp0 REG (fp0)
123 #define fp1 REG (fp1)
124 #define fp2 REG (fp2)
125 #define fp3 REG (fp3)
126 #define fp4 REG (fp4)
127 #define fp5 REG (fp5)
128 #define fp6 REG (fp6)
129 #define fp7 REG (fp7)
130 
131 #define fpc REG (fpc)
132 #define fpi REG (fpi)
133 #define fps REG (fps)
134 #define fpsr REG (fpsr)
135 
136 
137 /*
138  * Define macros to handle section beginning and ends.
139  */
140 
141 
142 #define BEGIN_CODE_DCL .text
143 #define END_CODE_DCL
144 #define BEGIN_DATA_DCL .data
145 #define END_DATA_DCL
146 #define BEGIN_CODE .text
147 #define END_CODE
148 #define BEGIN_DATA .data
149 #define END_DATA
150 #define BEGIN_BSS .bss
151 #define END_BSS
152 #define END
153 
154 /*
155  * Following must be tailor for a particular flavor of the C compiler.
156  * They may need to put underscores in front of the symbols.
157  */
158 
159 #define PUBLIC(sym) .globl SYM (sym)
160 #define EXTERN(sym) .globl SYM (sym)
161 
164 #endif