source: rtems/cpukit/score/cpu/sparc/rtems/asm.h @ c62d36f

4.104.114.84.95
Last change on this file since c62d36f was c62d36f, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 6, 1995 at 8:01:20 PM

SPARC merged and successfully tested w/o interrupt support

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*  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.
19 *
20 *  $Id$
21 */
22
23#ifndef __SPARC_ASM_h
24#define __SPARC_ASM_h
25
26/*
27 *  Indicate we are in an assembly file and get the basic CPU definitions.
28 */
29
30#define ASM
31#include <rtems/score/sparc.h>
32
33/*
34 *  Recent versions of GNU cpp define variables which indicate the
35 *  need for underscores and percents.  If not using GNU cpp or
36 *  the version does not support this, then you will obviously
37 *  have to define these as appropriate.
38 */
39
40/* XXX This does not appear to work on gcc 2.7.0 on the sparc */
41#undef  __USER_LABEL_PREFIX__
42#ifndef __USER_LABEL_PREFIX__
43#define __USER_LABEL_PREFIX__ _
44#endif
45
46#ifndef __REGISTER_PREFIX__
47#define __REGISTER_PREFIX__
48#endif
49
50/* ANSI concatenation macros.  */
51
52#define CONCAT1(a, b) CONCAT2(a, b)
53#define CONCAT2(a, b) a ## b
54
55/* Use the right prefix for global labels.  */
56
57#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
58
59/* Use the right prefix for registers.  */
60
61#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
62
63/*
64 *  define macros for all of the registers on this CPU
65 *
66 *  EXAMPLE:     #define d0 REG (d0)
67 */
68
69/*
70 *  Define macros to handle section beginning and ends.
71 */
72
73
74#define BEGIN_CODE_DCL .text
75#define END_CODE_DCL
76#define BEGIN_DATA_DCL .data
77#define END_DATA_DCL
78#define BEGIN_CODE .text
79#define END_CODE
80#define BEGIN_DATA
81#define END_DATA
82#define BEGIN_BSS
83#define END_BSS
84#define END
85
86/*
87 *  Following must be tailor for a particular flavor of the C compiler.
88 *  They may need to put underscores in front of the symbols.
89 */
90
91#define PUBLIC(sym) .globl SYM (sym)
92#define EXTERN(sym) .globl SYM (sym)
93
94#endif
95/* end of include file */
96
97
Note: See TracBrowser for help on using the repository browser.