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

4.104.114.84.95
Last change on this file since 8adc214 was 8adc214, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/21/04 at 11:35:50

Cosmetics.

  • Property mode set to 100644
File size: 2.8 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 __ARM_ASM_h
33#define __ARM_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/* ANSI concatenation macros.  */
61
62#define CONCAT1(a, b) CONCAT2(a, b)
63#define CONCAT2(a, b) a ## b
64
65/* Use the right prefix for global labels.  */
66
67#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
68
69/* Use the right prefix for registers.  */
70
71#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
72
73/*
74 *  define macros for all of the registers on this CPU
75 *
76 *  EXAMPLE:     #define d0 REG (d0)
77 */
78
79#define r0  REG(r0)
80#define r1  REG(r1)
81#define r2  REG(r2)
82#define r3  REG(r3)
83#define r4  REG(r4)
84#define r5  REG(r5)
85#define r6  REG(r6)
86#define r7  REG(r7)
87#define r8  REG(r8)
88#define r9  REG(r9)
89#define r10 REG(r10)
90#define r11 REG(r11)
91#define r12 REG(r12)
92#define r13 REG(r13)
93#define r14 REG(r14)
94#define r15 REG(r15)
95
96#define CPSR REG(CPSR)
97
98#define SPSR REG(SPSR)
99
100/*
101 *  Define macros to handle section beginning and ends.
102 */
103
104
105#define BEGIN_CODE_DCL .text
106#define END_CODE_DCL
107#define BEGIN_DATA_DCL .data
108#define END_DATA_DCL
109#define BEGIN_CODE .text
110#define END_CODE
111#define BEGIN_DATA
112#define END_DATA
113#define BEGIN_BSS
114#define END_BSS
115#define END
116
117/*
118 *  Following must be tailor for a particular flavor of the C compiler.
119 *  They may need to put underscores in front of the symbols.
120 */
121
122#define PUBLIC(sym) .globl SYM (sym)
123#define EXTERN(sym) .globl SYM (sym)
124
125#endif
Note: See TracBrowser for help on using the repository browser.