source: rtems/cpukit/score/cpu/m68k/rtems/asm.h @ d0279f6e

4.9
Last change on this file since d0279f6e was e0b8176, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 07/11/08 at 10:05:13

added support for mcf548x

  • Property mode set to 100644
File size: 3.3 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
28#ifndef _RTEMS_ASM_H
29#define _RTEMS_ASM_H
30
31/*
32 *  Indicate we are in an assembly file and get the basic CPU definitions.
33 */
34
35#ifndef ASM
36#define ASM
37#endif
38#include <rtems/score/cpuopts.h>
39#include <rtems/score/cpu.h>
40
41/*
42 *  Recent versions of GNU cpp define variables which indicate the
43 *  need for underscores and percents.  If not using GNU cpp or
44 *  the version does not support this, then you will obviously
45 *  have to define these as appropriate.
46 */
47
48#ifndef __USER_LABEL_PREFIX__
49#define __USER_LABEL_PREFIX__ _
50#endif
51
52#ifndef __REGISTER_PREFIX__
53#define __REGISTER_PREFIX__
54#endif
55
56#include <rtems/concat.h>
57
58/* Use the right prefix for global labels.  */
59
60#define SYM(x) CONCAT0 (__USER_LABEL_PREFIX__, x)
61
62/* Use the right prefix for registers.  */
63
64#define REG(x) CONCAT0 (__REGISTER_PREFIX__, x)
65
66#define d0 REG (d0)
67#define d1 REG (d1)
68#define d2 REG (d2)
69#define d3 REG (d3)
70#define d4 REG (d4)
71#define d5 REG (d5)
72#define d6 REG (d6)
73#define d7 REG (d7)
74#define a0 REG (a0)
75#define a1 REG (a1)
76#define a2 REG (a2)
77#define a3 REG (a3)
78#define a4 REG (a4)
79#define a5 REG (a5)
80#define a6 REG (a6)
81#define a7 REG (a7)
82#define sp REG (sp)
83
84#define msp REG (msp)
85#define usp REG (usp)
86#define isp REG (isp)
87#define sr  REG (sr)
88#define vbr REG (vbr)
89#define dfc REG (dfc)
90#define sfc REG (sfc)
91
92/* mcf52xx special regs */
93#define cacr    REG (cacr)
94#define acr0    REG (acr0)
95#define acr1    REG (acr1)
96#define rambar0 REG (rambar0)
97#define mbar    REG (mbar)
98
99/* additional v4e special regs */
100#define rambar1   REG (rambar1)
101#define macsr     REG (macsr)
102#define acc0      REG (acc0)
103#define acc1      REG (acc1)
104#define acc2      REG (acc2)
105#define acc3      REG (acc3)
106#define accext01  REG (accext01)
107#define accext23  REG (accext23)
108#define mask      REG (mask)
109
110
111#define fp0 REG (fp0)
112#define fp1 REG (fp1)
113#define fp2 REG (fp2)
114#define fp3 REG (fp3)
115#define fp4 REG (fp4)
116#define fp5 REG (fp5)
117#define fp6 REG (fp6)
118#define fp7 REG (fp7)
119
120#define fpc REG (fpc)
121#define fpi REG (fpi)
122#define fps REG (fps)
123#define fpsr REG (fpsr)
124
125
126/*
127 *  Define macros to handle section beginning and ends.
128 */
129
130
131#define BEGIN_CODE_DCL .text
132#define END_CODE_DCL
133#define BEGIN_DATA_DCL .data
134#define END_DATA_DCL
135#define BEGIN_CODE .text
136#define END_CODE
137#define BEGIN_DATA .data
138#define END_DATA
139#define BEGIN_BSS .bss
140#define END_BSS
141#define END
142
143/*
144 *  Following must be tailor for a particular flavor of the C compiler.
145 *  They may need to put underscores in front of the symbols.
146 */
147
148#define PUBLIC(sym) .globl SYM (sym)
149#define EXTERN(sym) .globl SYM (sym)
150
151#endif
Note: See TracBrowser for help on using the repository browser.