[ac7d5ef0] | 1 | /* asm.h |
---|
| 2 | * |
---|
| 3 | * This include file attempts to address the problems |
---|
| 4 | * caused by incompatible flavors of assemblers and |
---|
| 5 | * toolsets. It primarily addresses variations in the |
---|
| 6 | * use of leading underscores on symbols and the requirement |
---|
| 7 | * that register names be preceded by a %. |
---|
| 8 | * |
---|
| 9 | * |
---|
| 10 | * NOTE: The spacing in the use of these macros |
---|
| 11 | * is critical to them working as advertised. |
---|
| 12 | * |
---|
| 13 | * COPYRIGHT: |
---|
| 14 | * |
---|
| 15 | * This file is based on similar code found in newlib available |
---|
| 16 | * from ftp.cygnus.com. The file which was used had no copyright |
---|
| 17 | * notice. This file is freely distributable as long as the source |
---|
| 18 | * of the file is noted. This file is: |
---|
| 19 | * |
---|
| 20 | * COPYRIGHT (c) 1994. |
---|
| 21 | * On-Line Applications Research Corporation (OAR). |
---|
| 22 | * |
---|
| 23 | * $Id$ |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | #ifndef __M68k_ASM_h |
---|
| 27 | #define __M68k_ASM_h |
---|
| 28 | |
---|
| 29 | /* |
---|
| 30 | * Indicate we are in an assembly file and get the basic CPU definitions. |
---|
| 31 | */ |
---|
| 32 | |
---|
[12d6f14] | 33 | #ifndef ASM |
---|
[ac7d5ef0] | 34 | #define ASM |
---|
[12d6f14] | 35 | #endif |
---|
[b9181082] | 36 | #include <rtems/score/targopts.h> |
---|
| 37 | #include <rtems/score/cpu.h> |
---|
[ac7d5ef0] | 38 | |
---|
| 39 | /* |
---|
| 40 | * Recent versions of GNU cpp define variables which indicate the |
---|
| 41 | * need for underscores and percents. If not using GNU cpp or |
---|
| 42 | * the version does not support this, then you will obviously |
---|
| 43 | * have to define these as appropriate. |
---|
| 44 | */ |
---|
| 45 | |
---|
| 46 | #ifndef __USER_LABEL_PREFIX__ |
---|
| 47 | #define __USER_LABEL_PREFIX__ _ |
---|
| 48 | #endif |
---|
| 49 | |
---|
| 50 | #ifndef __REGISTER_PREFIX__ |
---|
| 51 | #define __REGISTER_PREFIX__ |
---|
| 52 | #endif |
---|
| 53 | |
---|
| 54 | /* ANSI concatenation macros. */ |
---|
| 55 | |
---|
| 56 | #define CONCAT1(a, b) CONCAT2(a, b) |
---|
| 57 | #define CONCAT2(a, b) a ## b |
---|
| 58 | |
---|
| 59 | /* Use the right prefix for global labels. */ |
---|
| 60 | |
---|
| 61 | #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) |
---|
| 62 | |
---|
| 63 | /* Use the right prefix for registers. */ |
---|
| 64 | |
---|
| 65 | #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) |
---|
| 66 | |
---|
| 67 | #define d0 REG (d0) |
---|
| 68 | #define d1 REG (d1) |
---|
| 69 | #define d2 REG (d2) |
---|
| 70 | #define d3 REG (d3) |
---|
| 71 | #define d4 REG (d4) |
---|
| 72 | #define d5 REG (d5) |
---|
| 73 | #define d6 REG (d6) |
---|
| 74 | #define d7 REG (d7) |
---|
| 75 | #define a0 REG (a0) |
---|
| 76 | #define a1 REG (a1) |
---|
| 77 | #define a2 REG (a2) |
---|
| 78 | #define a3 REG (a3) |
---|
| 79 | #define a4 REG (a4) |
---|
| 80 | #define a5 REG (a5) |
---|
| 81 | #define a6 REG (a6) |
---|
| 82 | #define a7 REG (a7) |
---|
| 83 | |
---|
| 84 | #define msp REG (msp) |
---|
| 85 | #define usp REG (usp) |
---|
| 86 | #define isp REG (isp) |
---|
[f398452] | 87 | #define sr REG (sr) |
---|
| 88 | #define vbr REG (vbr) |
---|
| 89 | #define dfc REG (dfc) |
---|
[ac7d5ef0] | 90 | |
---|
| 91 | #define fp0 REG (fp0) |
---|
| 92 | #define fp1 REG (fp1) |
---|
| 93 | #define fp2 REG (fp2) |
---|
| 94 | #define fp3 REG (fp3) |
---|
| 95 | #define fp4 REG (fp4) |
---|
| 96 | #define fp5 REG (fp5) |
---|
| 97 | #define fp6 REG (fp6) |
---|
| 98 | #define fp7 REG (fp7) |
---|
| 99 | |
---|
| 100 | #define fpc REG (fpc) |
---|
| 101 | #define fpi REG (fpi) |
---|
| 102 | #define fps REG (fps) |
---|
| 103 | |
---|
| 104 | /* |
---|
| 105 | * Define macros to handle section beginning and ends. |
---|
| 106 | */ |
---|
| 107 | |
---|
| 108 | |
---|
| 109 | #define BEGIN_CODE_DCL .text |
---|
| 110 | #define END_CODE_DCL |
---|
| 111 | #define BEGIN_DATA_DCL .data |
---|
| 112 | #define END_DATA_DCL |
---|
| 113 | #define BEGIN_CODE .text |
---|
| 114 | #define END_CODE |
---|
| 115 | #define BEGIN_DATA |
---|
| 116 | #define END_DATA |
---|
| 117 | #define BEGIN_BSS |
---|
| 118 | #define END_BSS |
---|
| 119 | #define END |
---|
| 120 | |
---|
| 121 | /* |
---|
| 122 | * Following must be tailor for a particular flavor of the C compiler. |
---|
| 123 | * They may need to put underscores in front of the symbols. |
---|
| 124 | */ |
---|
| 125 | |
---|
| 126 | #define PUBLIC(sym) .globl SYM (sym) |
---|
| 127 | #define EXTERN(sym) .globl SYM (sym) |
---|
| 128 | |
---|
| 129 | #endif |
---|
| 130 | /* end of include file */ |
---|
| 131 | |
---|
| 132 | |
---|