source: rtems/cpukit/score/cpu/i386/rtems/asm.h @ 16e1b45

4.104.115
Last change on this file since 16e1b45 was 16e1b45, checked in by Till Straumann <strauman@…>, on 10/28/09 at 02:45:24

2009-10-27 Till Straumann <strauman@…>

  • score/cpu/i386/rtems/asm.h: Added definition for cr4 register.
  • Property mode set to 100644
File size: 2.9 KB
Line 
1/**
2 * @file rtems/asm.h
3 *
4 *  This include file attempts to address the problems
5 *  caused by incompatible flavors of assemblers and
6 *  toolsets.  It primarily addresses variations in the
7 *  use of leading underscores on symbols and the requirement
8 *  that register names be preceded by a %.
9 */
10
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 *  $Id$
26 */
27
28#ifndef _RTEMS_ASM_H
29#define _RTEMS_ASM_H
30
31/*
32 *  Indicate we are in an assembly file and get the basic CPU definitions.
33 */
34
35#ifndef ASM
36#define ASM
37#endif
38#include <rtems/score/cpuopts.h>
39#include <rtems/score/i386.h>
40
41/*
42 *  Recent versions of GNU cpp define variables which indicate the
43 *  need for underscores and percents.  If not using GNU cpp or
44 *  the version does not support this, then you will obviously
45 *  have to define these as appropriate.
46 */
47
48#ifndef __USER_LABEL_PREFIX__
49#define __USER_LABEL_PREFIX__
50#endif
51
52/*
53 *  Looks like there is a bug in gcc 2.6.2 where this is not
54 *  defined correctly when configured as i386-coff and
55 *  i386-aout.
56 */
57
58#undef __REGISTER_PREFIX__
59#define __REGISTER_PREFIX__ %
60
61/*
62#ifndef __REGISTER_PREFIX__
63#define __REGISTER_PREFIX__
64#endif
65*/
66
67#include <rtems/concat.h>
68
69/* Use the right prefix for global labels.  */
70
71#define SYM(x) CONCAT0 (__USER_LABEL_PREFIX__, x)
72
73/* Use the right prefix for registers.  */
74
75#define REG(x) CONCAT0 (__REGISTER_PREFIX__, x)
76
77#define eax REG (eax)
78#define ebx REG (ebx)
79#define ecx REG (ecx)
80#define edx REG (edx)
81#define esi REG (esi)
82#define edi REG (edi)
83#define esp REG (esp)
84#define ebp REG (ebp)
85#define cr0 REG (cr0)
86#define cr4 REG (cr4)
87
88#define ax REG (ax)
89#define bx REG (bx)
90#define cx REG (cx)
91#define dx REG (dx)
92#define si REG (si)
93#define di REG (di)
94#define sp REG (sp)
95#define bp REG (bp)
96
97#define ah REG (ah)
98#define bh REG (bh)
99#define ch REG (ch)
100#define dh REG (dh)
101
102#define al REG (al)
103#define bl REG (bl)
104#define cl REG (cl)
105#define dl REG (dl)
106
107#define cs REG (cs)
108#define ds REG (ds)
109#define es REG (es)
110#define fs REG (fs)
111#define gs REG (gs)
112#define ss REG (ss)
113
114/*
115 *  Define macros to handle section beginning and ends.
116 */
117
118
119#define BEGIN_CODE_DCL .text
120#define END_CODE_DCL
121#define BEGIN_DATA_DCL .data
122#define END_DATA_DCL
123#define BEGIN_CODE .text
124#define END_CODE
125#define BEGIN_DATA .data
126#define END_DATA
127#define BEGIN_BSS .bss
128#define END_BSS
129#define END
130
131/*
132 *  Following must be tailor for a particular flavor of the C compiler.
133 *  They may need to put underscores in front of the symbols.
134 */
135
136#define PUBLIC(sym) .globl SYM (sym)
137#define EXTERN(sym) .globl SYM (sym)
138
139#endif
Note: See TracBrowser for help on using the repository browser.