source: rtems/cpukit/score/cpu/mips/rtems/asm.h @ b72e847b

4.8
Last change on this file since b72e847b was c6ea319, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/27/05 at 07:29:04

2005-10-27 Ralf Corsepius <ralf.corsepius@…>

  • rtems/asm.h: Remove private version of CONCAT macros. Include <rtems/concat.h> instead.
  • Property mode set to 100644
File size: 3.4 KB
Line 
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 _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/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#include <rtems/concat.h>
58
59/* Use the right prefix for global labels.  */
60
61#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
62
63/* Use the right prefix for registers.  */
64
65#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
66
67/*
68 *  define macros for all of the registers on this CPU
69 *
70 *  EXAMPLE:     #define d0 REG (d0)
71 */
72
73/*
74 *  Define macros to handle section beginning and ends.
75 */
76
77
78#define BEGIN_CODE_DCL .text
79#define END_CODE_DCL
80#define BEGIN_DATA_DCL .data
81#define END_DATA_DCL
82#define BEGIN_CODE .text
83#define END_CODE
84#define BEGIN_DATA
85#define END_DATA
86#define BEGIN_BSS
87#define END_BSS
88#define END
89
90/*
91 *  Following must be tailor for a particular flavor of the C compiler.
92 *  They may need to put underscores in front of the symbols.
93 */
94
95#define PUBLIC(sym) .globl SYM (sym)
96#define EXTERN(sym) .globl SYM (sym)
97
98/*
99 *  Debugger macros for assembly language routines. Allows the
100 *  programmer to set up the necessary stack frame info
101 *  required by debuggers to do stack traces.
102 */
103
104#ifndef XDS
105#define FRAME(name,frm_reg,offset,ret_reg)      \
106        .globl  name;                           \
107        .ent    name;                           \
108name:;                                          \
109        .frame  frm_reg,offset,ret_reg
110#define ENDFRAME(name)                          \
111        .end name
112#else
113#define FRAME(name,frm_reg,offset,ret_reg)      \
114        .globl  _##name;\
115_##name:
116#define ENDFRAME(name)
117#endif /* XDS */
118
119/*
120 * Hardware Floating Point Registers
121 */
122
123#define R_FP0   0
124#define R_FP1   1
125#define R_FP2   2
126#define R_FP3   3
127#define R_FP4   4
128#define R_FP5   5
129#define R_FP6   6
130#define R_FP7   7
131#define R_FP8   8
132#define R_FP9   9
133#define R_FP10  10
134#define R_FP11  11
135#define R_FP12  12
136#define R_FP13  13
137#define R_FP14  14
138#define R_FP15  15
139#define R_FP16  16
140#define R_FP17  17
141#define R_FP18  18
142#define R_FP19  19
143#define R_FP20  20
144#define R_FP21  21
145#define R_FP22  22
146#define R_FP23  23
147#define R_FP24  24
148#define R_FP25  25
149#define R_FP26  26
150#define R_FP27  27
151#define R_FP28  28
152#define R_FP29  29
153#define R_FP30  30
154#define R_FP31  31
155
156#endif
157/* end of include file */
158
Note: See TracBrowser for help on using the repository browser.