RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
cpukit
score
cpu
powerpc
include
rtems
asm.h
Go to the documentation of this file.
1
16
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) 1995.
26
* i-cubed ltd.
27
*
28
* COPYRIGHT (c) 1994.
29
* On-Line Applications Research Corporation (OAR).
30
*/
31
32
#ifndef _RTEMS_ASM_H
33
#define _RTEMS_ASM_H
34
35
/*
36
* Indicate we are in an assembly file and get the basic CPU definitions.
37
*/
38
39
#ifndef ASM
40
#define ASM
41
#endif
42
#include <rtems/score/cpuopts.h>
43
#include <
rtems/score/powerpc.h
>
44
54
55
/*
56
* Recent versions of GNU cpp define variables which indicate the
57
* need for underscores and percents. If not using GNU cpp or
58
* the version does not support this, then you will obviously
59
* have to define these as appropriate.
60
*/
61
62
#ifndef __USER_LABEL_PREFIX__
63
#define __USER_LABEL_PREFIX__
64
#endif
65
66
#ifndef __REGISTER_PREFIX__
67
#define __REGISTER_PREFIX__
68
#endif
69
70
#ifndef __FLOAT_REGISTER_PREFIX__
71
#define __FLOAT_REGISTER_PREFIX__ __REGISTER_PREFIX__
72
#endif
73
74
#ifndef __PROC_LABEL_PREFIX__
75
#define __PROC_LABEL_PREFIX__ __USER_LABEL_PREFIX__
76
#endif
77
78
/* Use the right prefix for global labels. */
79
80
#define SYM(x) RTEMS_XCONCAT (__USER_LABEL_PREFIX__, x)
81
82
/* Use the right prefix for procedure labels. */
83
84
#define PROC(x) RTEMS_XCONCAT (__PROC_LABEL_PREFIX__, x)
85
86
/* Use the right prefix for registers. */
87
88
#define REG(x) RTEMS_XCONCAT (__REGISTER_PREFIX__, x)
89
90
/* Use the right prefix for floating point registers. */
91
92
#define FREG(x) RTEMS_XCONCAT (__FLOAT_REGISTER_PREFIX__, x)
93
94
/*
95
* define macros for all of the registers on this CPU
96
*
97
* EXAMPLE: #define d0 REG (d0)
98
*/
99
#define r0 REG(0)
100
#define r1 REG(1)
101
#define r2 REG(2)
102
#define r3 REG(3)
103
#define r4 REG(4)
104
#define r5 REG(5)
105
#define r6 REG(6)
106
#define r7 REG(7)
107
#define r8 REG(8)
108
#define r9 REG(9)
109
#define r10 REG(10)
110
#define r11 REG(11)
111
#define r12 REG(12)
112
#define r13 REG(13)
113
#define r14 REG(14)
114
#define r15 REG(15)
115
#define r16 REG(16)
116
#define r17 REG(17)
117
#define r18 REG(18)
118
#define r19 REG(19)
119
#define r20 REG(20)
120
#define r21 REG(21)
121
#define r22 REG(22)
122
#define r23 REG(23)
123
#define r24 REG(24)
124
#define r25 REG(25)
125
#define r26 REG(26)
126
#define r27 REG(27)
127
#define r28 REG(28)
128
#define r29 REG(29)
129
#define r30 REG(30)
130
#define r31 REG(31)
131
#define f0 FREG(0)
132
#define f1 FREG(1)
133
#define f2 FREG(2)
134
#define f3 FREG(3)
135
#define f4 FREG(4)
136
#define f5 FREG(5)
137
#define f6 FREG(6)
138
#define f7 FREG(7)
139
#define f8 FREG(8)
140
#define f9 FREG(9)
141
#define f10 FREG(10)
142
#define f11 FREG(11)
143
#define f12 FREG(12)
144
#define f13 FREG(13)
145
#define f14 FREG(14)
146
#define f15 FREG(15)
147
#define f16 FREG(16)
148
#define f17 FREG(17)
149
#define f18 FREG(18)
150
#define f19 FREG(19)
151
#define f20 FREG(20)
152
#define f21 FREG(21)
153
#define f22 FREG(22)
154
#define f23 FREG(23)
155
#define f24 FREG(24)
156
#define f25 FREG(25)
157
#define f26 FREG(26)
158
#define f27 FREG(27)
159
#define f28 FREG(28)
160
#define f29 FREG(29)
161
#define f30 FREG(30)
162
#define f31 FREG(31)
163
#define v0 0
164
#define v1 1
165
#define v2 2
166
#define v3 3
167
#define v4 4
168
#define v5 5
169
#define v6 6
170
#define v7 7
171
#define v8 8
172
#define v9 9
173
#define v10 10
174
#define v11 11
175
#define v12 12
176
#define v13 13
177
#define v14 14
178
#define v15 15
179
#define v16 16
180
#define v17 17
181
#define v18 18
182
#define v19 19
183
#define v20 20
184
#define v21 21
185
#define v22 22
186
#define v23 23
187
#define v24 24
188
#define v25 25
189
#define v26 26
190
#define v27 27
191
#define v28 28
192
#define v29 29
193
#define v30 30
194
#define v31 31
195
196
/*
197
* Some special purpose registers (SPRs).
198
*/
199
#define srr0 0x01a
200
#define srr1 0x01b
201
#define srr2 0x3de
/* IBM 400 series only */
202
#define srr3 0x3df
/* IBM 400 series only */
203
#define csrr0 58
/* Book E */
204
#define csrr1 59
/* Book E */
205
#define mcsrr0 570
/* e500 */
206
#define mcsrr1 571
/* e500 */
207
#define dsrr0 574
/* e200 */
208
#define dsrr1 575
/* e200 */
209
210
#define sprg0 0x110
211
#define sprg1 0x111
212
#define sprg2 0x112
213
#define sprg3 0x113
214
#define sprg4 276
215
#define sprg5 277
216
#define sprg6 278
217
#define sprg7 279
218
219
#define usprg0 256
220
221
#define dar 0x013
/* Data Address Register */
222
#define dec 0x016
/* Decrementer Register */
223
224
#if defined(ppc403) || defined(ppc405)
225
/* the following SPR/DCR registers exist only in IBM 400 series */
226
#define dear 0x3d5
227
#define evpr 0x3d6
/* SPR: exception vector prefix register */
228
#define iccr 0x3fb
/* SPR: instruction cache control reg. */
229
#define dccr 0x3fa
/* SPR: data cache control reg. */
230
231
#if defined (ppc403)
232
#define exisr 0x040
/* DCR: external interrupt status register */
233
#define exier 0x042
/* DCR: external interrupt enable register */
234
#endif
/* ppc403 */
235
#if defined(ppc405)
236
#define exisr 0x0C0
/* DCR: external interrupt status register */
237
#define exier 0x0C2
/* DCR: external interrupt enable register */
238
#endif
/* ppc405 */
239
240
#define br0 0x080
/* DCR: memory bank register 0 */
241
#define br1 0x081
/* DCR: memory bank register 1 */
242
#define br2 0x082
/* DCR: memory bank register 2 */
243
#define br3 0x083
/* DCR: memory bank register 3 */
244
#define br4 0x084
/* DCR: memory bank register 4 */
245
#define br5 0x085
/* DCR: memory bank register 5 */
246
#define br6 0x086
/* DCR: memory bank register 6 */
247
#define br7 0x087
/* DCR: memory bank register 7 */
248
249
/* end of IBM400 series register definitions */
250
251
#elif defined(mpc860) || defined(mpc821)
252
/* The following registers are for the MPC8x0 */
253
#define der 0x095
/* Debug Enable Register */
254
#define ictrl 0x09E
/* Instruction Support Control Register */
255
#define immr 0x27E
/* Internal Memory Map Register */
256
/* end of MPC8x0 registers */
257
#endif
258
259
/*
260
* Following must be tailor for a particular flavor of the C compiler.
261
* They may need to put underscores in front of the symbols.
262
*/
263
264
#define PUBLIC_VAR(sym) .globl SYM (sym)
265
#define EXTERN_VAR(sym) .extern SYM (sym)
266
#define PUBLIC_PROC(sym) .globl PROC (sym)
267
#define EXTERN_PROC(sym) .extern PROC (sym)
268
269
/* Other potentially assembler specific operations */
270
#if PPC_ASM == PPC_ASM_ELF
271
#define ALIGN(n,p) .align p
272
#define DESCRIPTOR(x) \
273
.section .descriptors,"aw"; \
274
PUBLIC_VAR (x); \
275
SYM (x):; \
276
.long PROC (x); \
277
.long s.got; \
278
.long 0
279
280
#define EXT_SYM_REF(x) .long x
281
#define EXT_PROC_REF(x) .long x
282
283
/*
284
* Define macros to handle section beginning and ends.
285
*/
286
287
#define BEGIN_CODE_DCL .text
288
#define END_CODE_DCL
289
#define BEGIN_DATA_DCL .data
290
#define END_DATA_DCL
291
#define BEGIN_CODE .text
292
#define END_CODE
293
#define BEGIN_DATA .data
294
#define END_DATA
295
#define BEGIN_BSS .bss
296
#define END_BSS
297
#define END
298
299
#else
300
#error "PPC_ASM_TYPE is not properly defined"
301
#endif
302
#ifndef PPC_ASM
303
#error "PPC_ASM_TYPE is not properly defined"
304
#endif
305
306
#if defined(__powerpc64__)
307
#define PPC64_NOP_FOR_LINKER_TOC_POINTER_RESTORE nop
308
#else
309
#define PPC64_NOP_FOR_LINKER_TOC_POINTER_RESTORE
310
#endif
311
312
#endif
313
powerpc.h
IBM/Motorola PowerPC Definitions.
Generated by
1.18.0