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