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

4.9
Last change on this file since d0279f6e 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.1 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 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
13 *           Bernd Becker (becker@faw.uni-ulm.de)
14 *
15 *  NOTE: The spacing in the use of these macros
16 *        is critical to them working as advertised.
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 *
26 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
27 *
28 *  This program is distributed in the hope that it will be useful,
29 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
30 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31 *
32 *
33 *  COPYRIGHT (c) 1998-2001.
34 *  On-Line Applications Research Corporation (OAR).
35 *
36 *  The license and distribution terms for this file may be
37 *  found in the file LICENSE in this distribution or at
38 *  http://www.rtems.com/license/LICENSE.
39 *
40 *  $Id$
41 */
42
43#ifndef _RTEMS_ASM_H
44#define _RTEMS_ASM_H
45
46/*
47 *  Indicate we are in an assembly file and get the basic CPU definitions.
48 */
49
50#ifndef ASM
51#define ASM
52#endif
53
54#include <rtems/score/cpuopts.h>
55#include <rtems/score/sh.h>
56
57/*
58 *  Recent versions of GNU cpp define variables which indicate the
59 *  need for underscores and percents.  If not using GNU cpp or
60 *  the version does not support this, then you will obviously
61 *  have to define these as appropriate.
62 */
63
64#ifndef __USER_LABEL_PREFIX__
65#define __USER_LABEL_PREFIX__ _
66#endif
67
68#ifndef __REGISTER_PREFIX__
69#define __REGISTER_PREFIX__
70#endif
71
72#include <rtems/concat.h>
73
74/* Use the right prefix for global labels.  */
75
76#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
77
78/* Use the right prefix for registers.  */
79
80#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
81
82/*
83 *  define macros for all of the registers on this CPU
84 *
85 *  EXAMPLE:     #define d0 REG (d0)
86 */
87#define r0 REG (r0)
88#define r1 REG (r1)
89#define r2 REG (r2)
90#define r3 REG (r3)
91#define r4 REG (r4)
92#define r5 REG (r5)
93#define r6 REG (r6)
94#define r7 REG (r7)
95#define r8 REG (r8)
96#define r9 REG (r9)
97#define r10 REG (r10)
98#define r11 REG (r11)
99#define r12 REG (r12)
100#define r13 REG (r13)
101#define r14 REG (r14)
102#define r15 REG (r15)
103#define vbr REG (vbr)
104#define gbr REG (gbr)
105#define pr REG (pr)
106#define mach REG (mach)
107#define macl REG (macl)
108#define sr REG (sr)
109#define pc REG (pc)
110
111/*
112 *  Define macros to handle section beginning and ends.
113 */
114
115
116#define BEGIN_CODE_DCL .text
117#define END_CODE_DCL
118#define BEGIN_DATA_DCL .data
119#define END_DATA_DCL
120#define BEGIN_CODE .text
121#define END_CODE
122#define BEGIN_DATA
123#define END_DATA
124#define BEGIN_BSS
125#define END_BSS
126#define END
127
128/*
129 *  Following must be tailor for a particular flavor of the C compiler.
130 *  They may need to put underscores in front of the symbols.
131 */
132
133#define PUBLIC(sym) .global SYM (sym)
134#define EXTERN(sym) .global SYM (sym)
135
136#endif
Note: See TracBrowser for help on using the repository browser.