OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [cpu/] [sh/] [asm.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  asm.h
2
 *
3
 *  This include file attempts to address the problems
4
 *  caused by incompatible flavors of assemblers and
5
 *  toolsets.  It primarily addresses variations in the
6
 *  use of leading underscores on symbols and the requirement
7
 *  that register names be preceded by a %.
8
 *
9
 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
10
 *           Bernd Becker (becker@faw.uni-ulm.de)
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
 *
23
 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
24
 *
25
 *  This program is distributed in the hope that it will be useful,
26
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28
 *
29
 *
30
 *  COPYRIGHT (c) 1998-2001.
31
 *  On-Line Applications Research Corporation (OAR).
32
 *
33
 *  The license and distribution terms for this file may be
34
 *  found in the file LICENSE in this distribution or at
35
 *  http://www.OARcorp.com/rtems/license.html.
36
 *
37
 *  asm.h,v 1.5 2001/10/12 17:46:47 joel Exp
38
 */
39
 
40
#ifndef __CPU_SH_ASM_h
41
#define __CPU_SH_ASM_h
42
 
43
/*
44
 *  Indicate we are in an assembly file and get the basic CPU definitions.
45
 */
46
 
47
#ifndef ASM
48
#define ASM
49
#endif
50
 
51
#include <rtems/score/cpuopts.h>
52
#include <rtems/score/sh.h>
53
 
54
/*
55
 *  Recent versions of GNU cpp define variables which indicate the
56
 *  need for underscores and percents.  If not using GNU cpp or
57
 *  the version does not support this, then you will obviously
58
 *  have to define these as appropriate.
59
 */
60
 
61
#ifndef __USER_LABEL_PREFIX__
62
#define __USER_LABEL_PREFIX__ _
63
#endif
64
 
65
#ifndef __REGISTER_PREFIX__
66
#define __REGISTER_PREFIX__
67
#endif
68
 
69
/* ANSI concatenation macros.  */
70
 
71
#define CONCAT1(a, b) CONCAT2(a, b)
72
#define CONCAT2(a, b) a ## b
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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.