source: rtems/c/src/exec/score/cpu/i386/asm.h @ 95990b57

4.104.114.84.95
Last change on this file since 95990b57 was 95990b57, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 25, 2000 at 5:30:13 PM

2000-08-17 Ralf Corsepius <corsepiu@…>

  • rtems/score/i386.h: cpu-variant define handling Rewrite due to introduction of multilib defines.
  • asm.h: include cpuopts.h instead of targopts.h
  • Property mode set to 100644
File size: 2.9 KB
Line 
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-1997.
21 *  On-Line Applications Research Corporation (OAR).
22 *
23 *  $Id$
24 */
25
26#ifndef __i386_ASM_h
27#define __i386_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#include <rtems/score/cpuopts.h>
37#include <rtems/score/i386.h>
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/*
47 *  Looks like there is a bug in gcc 2.6.2 where this is not
48 *  defined correctly when configured as i386-coff and
49 *  i386-aout.
50 */
51
52#undef __REGISTER_PREFIX__
53#define __REGISTER_PREFIX__ %
54
55/*
56#ifndef __REGISTER_PREFIX__
57#define __REGISTER_PREFIX__
58#endif
59*/
60
61/* ANSI concatenation macros.  */
62
63#define CONCAT1(a, b) CONCAT2(a, b)
64#define CONCAT2(a, b) a ## b
65
66/* Use the right prefix for global labels.  */
67
68#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
69
70/* Use the right prefix for registers.  */
71
72#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
73
74#define eax REG (eax)
75#define ebx REG (ebx)
76#define ecx REG (ecx)
77#define edx REG (edx)
78#define esi REG (esi)
79#define edi REG (edi)
80#define esp REG (esp)
81#define ebp REG (ebp)
82#define cr0 REG (cr0)
83
84#define ax REG (ax)
85#define bx REG (bx)
86#define cx REG (cx)
87#define dx REG (dx)
88#define si REG (si)
89#define di REG (di)
90#define sp REG (sp)
91#define bp REG (bp)
92
93#define ah REG (ah)
94#define bh REG (bh)
95#define ch REG (ch)
96#define dh REG (dh)
97
98#define al REG (al)
99#define bl REG (bl)
100#define cl REG (cl)
101#define dl REG (dl)
102
103#define cs REG (cs)
104#define ds REG (ds)
105#define es REG (es)
106#define fs REG (fs)
107#define gs REG (gs)
108#define ss REG (ss)
109
110/*
111 *  Define macros to handle section beginning and ends.
112 */
113
114
115#define BEGIN_CODE_DCL .text
116#define END_CODE_DCL
117#define BEGIN_DATA_DCL .data
118#define END_DATA_DCL
119#define BEGIN_CODE .text
120#define END_CODE
121#define BEGIN_DATA .data
122#define END_DATA
123#define BEGIN_BSS .bss
124#define END_BSS
125#define END
126
127/*
128 *  Following must be tailor for a particular flavor of the C compiler.
129 *  They may need to put underscores in front of the symbols.
130 */
131
132#define PUBLIC(sym) .globl SYM (sym)
133#define EXTERN(sym) .globl SYM (sym)
134
135#endif
136/* end of include file */
137
138
Note: See TracBrowser for help on using the repository browser.