RTEMS CPU Kit with SuperCore  4.11.3
asm.h
Go to the documentation of this file.
1 
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  * COPYRIGHT (c) 2011
23  * Anthony Green
24  *
25  * COPYRIGHT (c) 1989-1999, 2010.
26  * On-Line Applications Research Corporation (OAR).
27  *
28  * The license and distribution terms for this file may be
29  * found in the file LICENSE in this distribution or at
30  * http://www.rtems.org/license/LICENSE.
31  *
32  * $Id: asm.h,v 1.9 2010/06/29 00:31:09 joel Exp $
33  */
34 
35 #ifndef _RTEMS_ASM_H
36 #define _RTEMS_ASM_H
37 
38 /*
39  * Indicate we are in an assembly file and get the basic CPU definitions.
40  */
41 
42 #include <rtems/score/moxie.h>
43 
44 /*
45  * Recent versions of GNU cpp define variables which indicate the
46  * need for underscores and percents. If not using GNU cpp or
47  * the version does not support this, then you will obviously
48  * have to define these as appropriate.
49  */
50 
51 #ifndef __USER_LABEL_PREFIX__
52 #define __USER_LABEL_PREFIX__
53 #endif
54 
55 #ifndef __REGISTER_PREFIX__
56 #define __REGISTER_PREFIX__ "$"
57 #endif
58 
59 #include <rtems/concat.h>
60 
61 /* Use the right prefix for global labels. */
62 
63 #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
64 
65 /* Use the right prefix for registers. */
66 
67 #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
68 
69 /*
70  * define macros for all of the registers on this CPU
71  *
72  * EXAMPLE: #define d0 REG (d0)
73  */
74 #define fp REG(fp)
75 #define sp REG(sp)
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 
91 /*
92  * Define macros to handle section beginning and ends.
93  */
94 
95 
96 #define BEGIN_CODE_DCL .text
97 #define END_CODE_DCL
98 #define BEGIN_DATA_DCL .data
99 #define END_DATA_DCL
100 #define BEGIN_CODE asm ( ".text
101 #define END_CODE ");
102 #define BEGIN_DATA
103 #define END_DATA
104 #define BEGIN_BSS
105 #define END_BSS
106 #define END
107 
108 /*
109  * Following must be tailor for a particular flavor of the C compiler.
110  * They may need to put underscores in front of the symbols.
111  */
112 
113 #define PUBLIC(sym) .globl SYM (sym)
114 #define EXTERN(sym) .globl SYM (sym)
115 
116 #endif
This include file defines ANSI concatenation macros.