1 | /** |
---|
2 | * @file rtems/asm.h |
---|
3 | * |
---|
4 | * This include file attempts to address the problems |
---|
5 | * caused by incompatible flavors of assemblers and |
---|
6 | * toolsets. It primarily addresses variations in the |
---|
7 | * use of leading underscores on symbols and the requirement |
---|
8 | * that register names be preceded by a %. |
---|
9 | */ |
---|
10 | |
---|
11 | /* |
---|
12 | * NOTE: The spacing in the use of these macros |
---|
13 | * is critical to them working as advertised. |
---|
14 | * |
---|
15 | * COPYRIGHT: |
---|
16 | * |
---|
17 | * This file is based on similar code found in newlib available |
---|
18 | * from ftp.cygnus.com. The file which was used had no copyright |
---|
19 | * notice. This file is freely distributable as long as the source |
---|
20 | * of the file is noted. This file is: |
---|
21 | * |
---|
22 | * COPYRIGHT (c) 1994-1997. |
---|
23 | * On-Line Applications Research Corporation (OAR). |
---|
24 | * |
---|
25 | * $Id$ |
---|
26 | */ |
---|
27 | /* @(#)asm.h 03/15/96 1.1 */ |
---|
28 | |
---|
29 | #ifndef __NO_CPU_ASM_h |
---|
30 | #define __NO_CPU_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/mips.h> |
---|
41 | |
---|
42 | /* |
---|
43 | * Recent versions of GNU cpp define variables which indicate the |
---|
44 | * need for underscores and percents. If not using GNU cpp or |
---|
45 | * the version does not support this, then you will obviously |
---|
46 | * have to define these as appropriate. |
---|
47 | */ |
---|
48 | |
---|
49 | #ifndef __USER_LABEL_PREFIX__ |
---|
50 | #define __USER_LABEL_PREFIX__ _ |
---|
51 | #endif |
---|
52 | |
---|
53 | #ifndef __REGISTER_PREFIX__ |
---|
54 | #define __REGISTER_PREFIX__ |
---|
55 | #endif |
---|
56 | |
---|
57 | /* ANSI concatenation macros. */ |
---|
58 | |
---|
59 | #define CONCAT1(a, b) CONCAT2(a, b) |
---|
60 | #define CONCAT2(a, b) a ## b |
---|
61 | |
---|
62 | /* Use the right prefix for global labels. */ |
---|
63 | |
---|
64 | #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) |
---|
65 | |
---|
66 | /* Use the right prefix for registers. */ |
---|
67 | |
---|
68 | #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) |
---|
69 | |
---|
70 | /* |
---|
71 | * define macros for all of the registers on this CPU |
---|
72 | * |
---|
73 | * EXAMPLE: #define d0 REG (d0) |
---|
74 | */ |
---|
75 | |
---|
76 | /* |
---|
77 | * Define macros to handle section beginning and ends. |
---|
78 | */ |
---|
79 | |
---|
80 | |
---|
81 | #define BEGIN_CODE_DCL .text |
---|
82 | #define END_CODE_DCL |
---|
83 | #define BEGIN_DATA_DCL .data |
---|
84 | #define END_DATA_DCL |
---|
85 | #define BEGIN_CODE .text |
---|
86 | #define END_CODE |
---|
87 | #define BEGIN_DATA |
---|
88 | #define END_DATA |
---|
89 | #define BEGIN_BSS |
---|
90 | #define END_BSS |
---|
91 | #define END |
---|
92 | |
---|
93 | /* |
---|
94 | * Following must be tailor for a particular flavor of the C compiler. |
---|
95 | * They may need to put underscores in front of the symbols. |
---|
96 | */ |
---|
97 | |
---|
98 | #define PUBLIC(sym) .globl SYM (sym) |
---|
99 | #define EXTERN(sym) .globl SYM (sym) |
---|
100 | |
---|
101 | /* |
---|
102 | * Debugger macros for assembly language routines. Allows the |
---|
103 | * programmer to set up the necessary stack frame info |
---|
104 | * required by debuggers to do stack traces. |
---|
105 | */ |
---|
106 | |
---|
107 | #ifndef XDS |
---|
108 | #define FRAME(name,frm_reg,offset,ret_reg) \ |
---|
109 | .globl name; \ |
---|
110 | .ent name; \ |
---|
111 | name:; \ |
---|
112 | .frame frm_reg,offset,ret_reg |
---|
113 | #define ENDFRAME(name) \ |
---|
114 | .end name |
---|
115 | #else |
---|
116 | #define FRAME(name,frm_reg,offset,ret_reg) \ |
---|
117 | .globl _##name;\ |
---|
118 | _##name: |
---|
119 | #define ENDFRAME(name) |
---|
120 | #endif XDS |
---|
121 | |
---|
122 | /* |
---|
123 | * Hardware Floating Point Registers |
---|
124 | */ |
---|
125 | |
---|
126 | #define R_FP0 0 |
---|
127 | #define R_FP1 1 |
---|
128 | #define R_FP2 2 |
---|
129 | #define R_FP3 3 |
---|
130 | #define R_FP4 4 |
---|
131 | #define R_FP5 5 |
---|
132 | #define R_FP6 6 |
---|
133 | #define R_FP7 7 |
---|
134 | #define R_FP8 8 |
---|
135 | #define R_FP9 9 |
---|
136 | #define R_FP10 10 |
---|
137 | #define R_FP11 11 |
---|
138 | #define R_FP12 12 |
---|
139 | #define R_FP13 13 |
---|
140 | #define R_FP14 14 |
---|
141 | #define R_FP15 15 |
---|
142 | #define R_FP16 16 |
---|
143 | #define R_FP17 17 |
---|
144 | #define R_FP18 18 |
---|
145 | #define R_FP19 19 |
---|
146 | #define R_FP20 20 |
---|
147 | #define R_FP21 21 |
---|
148 | #define R_FP22 22 |
---|
149 | #define R_FP23 23 |
---|
150 | #define R_FP24 24 |
---|
151 | #define R_FP25 25 |
---|
152 | #define R_FP26 26 |
---|
153 | #define R_FP27 27 |
---|
154 | #define R_FP28 28 |
---|
155 | #define R_FP29 29 |
---|
156 | #define R_FP30 30 |
---|
157 | #define R_FP31 31 |
---|
158 | |
---|
159 | #endif |
---|
160 | /* end of include file */ |
---|
161 | |
---|