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

4.115
Last change on this file since 1362b7a was 1362b7a, checked in by Alex Ivanov <alexivanov97@…>, on 01/08/13 at 17:39:08

score: Doxygen Clean Up Task #4

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