RTEMS  5.0.0
asm.h
Go to the documentation of this file.
1 
17 /*
18  * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
19  * Bernd Becker (becker@faw.uni-ulm.de)
20  *
21  * COPYRIGHT:
22  *
23  * This file is based on similar code found in newlib available
24  * from ftp.cygnus.com. The file which was used had no copyright
25  * notice. This file is freely distributable as long as the source
26  * of the file is noted. This file is:
27  *
28  *
29  * COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
30  *
31  * This program is distributed in the hope that it will be useful,
32  * but WITHOUT ANY WARRANTY; without even the implied warranty of
33  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
34  *
35  *
36  * COPYRIGHT (c) 1998-2001.
37  * On-Line Applications Research Corporation (OAR).
38  *
39  * The license and distribution terms for this file may be
40  * found in the file LICENSE in this distribution or at
41  * http://www.rtems.org/license/LICENSE.
42  */
43 
44 #ifndef _RTEMS_ASM_H
45 #define _RTEMS_ASM_H
46 
47 /*
48  * Indicate we are in an assembly file and get the basic CPU definitions.
49  */
50 
51 #ifndef ASM
52 #define ASM
53 #endif
54 
55 #include <rtems/score/cpuopts.h>
56 #include <rtems/score/sh.h>
57 
68 /*
69  * Recent versions of GNU cpp define variables which indicate the
70  * need for underscores and percents. If not using GNU cpp or
71  * the version does not support this, then you will obviously
72  * have to define these as appropriate.
73  */
74 
75 #ifndef __USER_LABEL_PREFIX__
76 #define __USER_LABEL_PREFIX__ _
77 #endif
78 
79 #ifndef __REGISTER_PREFIX__
80 #define __REGISTER_PREFIX__
81 #endif
82 
83 #include <rtems/concat.h>
84 
85 /* Use the right prefix for global labels. */
86 
87 #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
88 
89 /* Use the right prefix for registers. */
90 
91 #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
92 
93 /*
94  * define macros for all of the registers on this CPU
95  *
96  * EXAMPLE: #define d0 REG (d0)
97  */
98 #define r0 REG (r0)
99 #define r1 REG (r1)
100 #define r2 REG (r2)
101 #define r3 REG (r3)
102 #define r4 REG (r4)
103 #define r5 REG (r5)
104 #define r6 REG (r6)
105 #define r7 REG (r7)
106 #define r8 REG (r8)
107 #define r9 REG (r9)
108 #define r10 REG (r10)
109 #define r11 REG (r11)
110 #define r12 REG (r12)
111 #define r13 REG (r13)
112 #define r14 REG (r14)
113 #define r15 REG (r15)
114 #define vbr REG (vbr)
115 #define gbr REG (gbr)
116 #define pr REG (pr)
117 #define mach REG (mach)
118 #define macl REG (macl)
119 #define sr REG (sr)
120 #define pc REG (pc)
121 
122 /*
123  * Define macros to handle section beginning and ends.
124  */
125 
126 
127 #define BEGIN_CODE_DCL .text
128 #define END_CODE_DCL
129 #define BEGIN_DATA_DCL .data
130 #define END_DATA_DCL
131 #define BEGIN_CODE .text
132 #define END_CODE
133 #define BEGIN_DATA
134 #define END_DATA
135 #define BEGIN_BSS
136 #define END_BSS
137 #define END
138 
139 /*
140  * Following must be tailor for a particular flavor of the C compiler.
141  * They may need to put underscores in front of the symbols.
142  */
143 
144 #define PUBLIC(sym) .global SYM (sym)
145 #define EXTERN(sym) .global SYM (sym)
146 
147 #endif
Hitachi SH CPU Department Source.