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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [c/] [src/] [exec/] [score/] [cpu/] [i960/] [asm.h] - Blame information for rev 208

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 158 chris
/*  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
 *
10
 *  NOTE: The spacing in the use of these macros
11
 *        is critical to them working as advertised.
12
 *
13
 *  COPYRIGHT:
14
 *
15
 *  This file is based on similar code found in newlib available
16
 *  from ftp.cygnus.com.  The file which was used had no copyright
17
 *  notice.  This file is freely distributable as long as the source
18
 *  of the file is noted.  This file is:
19
 *
20
 *  COPYRIGHT (c) 1994-1997.
21
 *  On-Line Applications Research Corporation (OAR).
22
 *
23 208 chris
 *  $Id: asm.h,v 1.2 2001-09-27 11:59:27 chris Exp $
24 158 chris
 */
25
 
26
#ifndef __i960_ASM_h
27
#define __i960_ASM_h
28
 
29
/*
30
 *  Indicate we are in an assembly file and get the basic CPU definitions.
31
 */
32
 
33
#ifndef ASM
34
#define ASM
35
#endif
36
#include <rtems/score/targopts.h>
37
#include <rtems/score/i960.h>
38
 
39
/*
40
 *  Recent versions of GNU cpp define variables which indicate the
41
 *  need for underscores and percents.  If not using GNU cpp or
42
 *  the version does not support this, then you will obviously
43
 *  have to define these as appropriate.
44
 */
45
 
46
#ifndef __USER_LABEL_PREFIX__
47
#define __USER_LABEL_PREFIX__ _
48
#endif
49
 
50
#ifndef __REGISTER_PREFIX__
51
#define __REGISTER_PREFIX__
52
#endif
53
 
54
/* ANSI concatenation macros.  */
55
 
56
#define CONCAT1(a, b) CONCAT2(a, b)
57
#define CONCAT2(a, b) a ## b
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
#define g0  REG (g0)
68
#define g1  REG (g1)
69
#define g2  REG (g2)
70
#define g3  REG (g3)
71
#define g4  REG (g4)
72
#define g5  REG (g5)
73
#define g6  REG (g6)
74
#define g7  REG (g7)
75
#define g8  REG (g8)
76
#define g9  REG (g9)
77
#define g10 REG (g10)
78
#define g11 REG (g11)
79
#define g12 REG (g12)
80
#define g13 REG (g13)
81
#define g14 REG (g14)
82
#define g15 REG (g15)
83
 
84
/*
85
 *  Define macros to handle section beginning and ends.
86
 */
87
 
88
 
89
#define BEGIN_CODE_DCL .text
90
#define END_CODE_DCL
91
#define BEGIN_DATA_DCL .data
92
#define END_DATA_DCL
93
#define BEGIN_CODE .text
94
#define END_CODE
95
#define BEGIN_DATA
96
#define END_DATA
97
#define BEGIN_BSS
98
#define END_BSS
99
#define END
100
 
101
/*
102
 *  Following must be tailor for a particular flavor of the C compiler.
103
 *  They may need to put underscores in front of the symbols.
104
 */
105
 
106
#define PUBLIC(sym) .globl SYM (sym)
107
#define EXTERN(sym) .globl SYM (sym)
108
 
109
#endif
110
/* end of include file */

powered by: WebSVN 2.1.0

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