RTEMS CPU Kit with SuperCore  4.11.3
asm.h
Go to the documentation of this file.
1 
17 /*
18  * COPYRIGHT:
19  *
20  * This file is based on similar code found in newlib available
21  * from ftp.cygnus.com. The file which was used had no copyright
22  * notice. This file is freely distributable as long as the source
23  * of the file is noted.
24  */
25 
26 #ifndef _RTEMS_ASM_H
27 #define _RTEMS_ASM_H
28 
29 /*
30  * Indicate we are in an assembly file and get the basic CPU definitions.
31  */
32 
33 #ifndef ASM
34 #define ASM
35 #endif
36 #ifndef __ASM__
37 #define __ASM__
38 #endif
39 
40 #include <rtems/score/cpuopts.h>
41 #include <rtems/score/cpu.h>
42 
43 /*
44  * Recent versions of GNU cpp define variables which indicate the
45  * need for underscores and percents. If not using GNU cpp or
46  * the version does not support this, then you will obviously
47  * have to define these as appropriate.
48  */
49 
50 /* XXX __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ do not work on gcc 2.7.0 */
51 /* XXX The following ifdef magic fixes the problem but results in a warning */
52 /* XXX when compiling assembly code. */
53 
54 #ifndef __USER_LABEL_PREFIX__
55 #define __USER_LABEL_PREFIX__ _
56 #endif
57 
58 #ifndef __REGISTER_PREFIX__
59 #define __REGISTER_PREFIX__
60 #endif
61 
62 #include <rtems/concat.h>
63 
64 /* Use the right prefix for global labels. */
65 
66 #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
67 
68 /* Use the right prefix for registers. */
69 
70 #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
71 
72 /*
73  * define macros for all of the registers on this CPU
74  *
75  * EXAMPLE: #define d0 REG (d0)
76  */
77 
78 /*
79  * Define macros to handle section beginning and ends.
80  */
81 
82 
83 #define BEGIN_CODE_DCL .text
84 #define END_CODE_DCL
85 #define BEGIN_DATA_DCL .data
86 #define END_DATA_DCL
87 #define BEGIN_CODE .text
88 #define END_CODE
89 #define BEGIN_DATA
90 #define END_DATA
91 #define BEGIN_BSS
92 #define END_BSS
93 #define END
94 
95 /*
96  * Following must be tailor for a particular flavor of the C compiler.
97  * They may need to put underscores in front of the symbols.
98  */
99 
100 #define PUBLIC(sym) .globl SYM (sym)
101 #define EXTERN(sym) .globl SYM (sym)
102 
103 #endif
This include file defines ANSI concatenation macros.