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. This file is:
24  *
25  *
26  * COPYRIGHT (c) 1989-1999.
27  * On-Line Applications Research Corporation (OAR).
28  *
29  * The license and distribution terms for this file may be
30  * found in the file LICENSE in this distribution or at
31  * http://www.rtems.org/license/LICENSE.
32  */
33 
34 #ifndef _RTEMS_ASM_H
35 #define _RTEMS_ASM_H
36 
37 /*
38  * Indicate we are in an assembly file and get the basic CPU definitions.
39  */
40 
41 #include <rtems/score/h8300.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 #ifndef __USER_LABEL_PREFIX__
51 #define __USER_LABEL_PREFIX__ _
52 #endif
53 
54 #ifndef __REGISTER_PREFIX__
55 #define __REGISTER_PREFIX__
56 #endif
57 
58 #include <rtems/concat.h>
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 #define r0 REG(r0)
74 #define r1 REG(r1)
75 #define r2 REG(r2)
76 #define r3 REG(r3)
77 #define r4 REG(r4)
78 #define r5 REG(r5)
79 #define r6 REG(r6)
80 #define r7 REG(r7)
81 
82 #define er0 REG(er0)
83 #define er1 REG(er1)
84 #define er2 REG(er2)
85 #define er3 REG(er3)
86 #define er4 REG(er4)
87 #define er5 REG(er5)
88 #define er6 REG(er6)
89 #define er7 REG(er7)
90 
91 #define sp REG(sp)
92 
93 /*
94  * Define macros to handle section beginning and ends.
95  */
96 
97 
98 #define BEGIN_CODE_DCL .text
99 #define END_CODE_DCL
100 #define BEGIN_DATA_DCL .data
101 #define END_DATA_DCL
102 #define BEGIN_CODE __asm__ ( ".text
103 #define END_CODE ");
104 #define BEGIN_DATA
105 #define END_DATA
106 #define BEGIN_BSS
107 #define END_BSS
108 #define END
109 
110 /*
111  * Following must be tailor for a particular flavor of the C compiler.
112  * They may need to put underscores in front of the symbols.
113  */
114 
115 #define PUBLIC(sym) .globl SYM (sym)
116 #define EXTERN(sym) .globl SYM (sym)
117 
118 #endif
Information Required to Build RTEMS for a Particular Member of the Hitachi H8/300 Family...
This include file defines ANSI concatenation macros.