source: rtems/cpukit/score/cpu/arm/rtems/asm.h @ c6ea319

4.104.114.84.95
Last change on this file since c6ea319 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: 2.7 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 *  NOTE: The spacing in the use of these macros
12 *        is critical to them working as advertised.
13 */
14 
15/*
16 *  COPYRIGHT:
17 *
18 *  This file is based on similar code found in newlib available
19 *  from ftp.cygnus.com.  The file which was used had no copyright
20 *  notice.  This file is freely distributable as long as the source
21 *  of the file is noted.  This file is:
22 *
23 *  COPYRIGHT (c) 2000 Canon Research Centre France SA.
24 *  Emmanuel Raguet, mailto:raguet@crf.canon.fr
25 *
26 *  The license and distribution terms for this file may be
27 *  found in the file LICENSE in this distribution or at
28 *  http://www.rtems.com/license/LICENSE.
29 *
30 */
31
32#ifndef _RTEMS_ASM_H
33#define _RTEMS_ASM_H
34
35/*
36 *  Indicate we are in an assembly file and get the basic CPU definitions.
37 */
38
39#ifndef ASM
40#define ASM
41#endif
42#include <rtems/score/cpuopts.h>
43#include <rtems/score/arm.h>
44
45/*
46 *  Recent versions of GNU cpp define variables which indicate the
47 *  need for underscores and percents.  If not using GNU cpp or
48 *  the version does not support this, then you will obviously
49 *  have to define these as appropriate.
50 */
51
52#ifndef __USER_LABEL_PREFIX__
53#define __USER_LABEL_PREFIX__ _
54#endif
55
56#ifndef __REGISTER_PREFIX__
57#define __REGISTER_PREFIX__
58#endif
59
60#include <rtems/concat.h>
61
62/* Use the right prefix for global labels.  */
63
64#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
65
66/* Use the right prefix for registers.  */
67
68#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
69
70/*
71 *  define macros for all of the registers on this CPU
72 *
73 *  EXAMPLE:     #define d0 REG (d0)
74 */
75
76#define r0  REG(r0)
77#define r1  REG(r1)
78#define r2  REG(r2)
79#define r3  REG(r3)
80#define r4  REG(r4)
81#define r5  REG(r5)
82#define r6  REG(r6)
83#define r7  REG(r7)
84#define r8  REG(r8)
85#define r9  REG(r9)
86#define r10 REG(r10)
87#define r11 REG(r11)
88#define r12 REG(r12)
89#define r13 REG(r13)
90#define r14 REG(r14)
91#define r15 REG(r15)
92
93#define CPSR REG(CPSR)
94
95#define SPSR REG(SPSR)
96
97/*
98 *  Define macros to handle section beginning and ends.
99 */
100
101
102#define BEGIN_CODE_DCL .text
103#define END_CODE_DCL
104#define BEGIN_DATA_DCL .data
105#define END_DATA_DCL
106#define BEGIN_CODE .text
107#define END_CODE
108#define BEGIN_DATA
109#define END_DATA
110#define BEGIN_BSS
111#define END_BSS
112#define END
113
114/*
115 *  Following must be tailor for a particular flavor of the C compiler.
116 *  They may need to put underscores in front of the symbols.
117 */
118
119#define PUBLIC(sym) .globl SYM (sym)
120#define EXTERN(sym) .globl SYM (sym)
121
122#endif
Note: See TracBrowser for help on using the repository browser.