1 /*
2 Copyright (C) 2007 by Ellips BV. All rights reserved.
3 
4 Permission to use, copy, modify, and distribute this
5 software is freely granted, provided that this notice
6 is preserved.
7  */
8 /*
9  ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
10  ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  */
12 
13 #ifndef __USER_LABEL_PREFIX__
14 #define __USER_LABEL_PREFIX__ _
15 #endif
16 
17 #define __REG_PREFIX__ %
18 
19 /* ANSI concatenation macros.  */
20 
21 #define CONCAT1(a, b) CONCAT2(a, b)
22 #define CONCAT2(a, b) a##b
23 
24 /* Use the right prefix for global labels.  */
25 
26 #define SYM(x) CONCAT1(__USER_LABEL_PREFIX__, x)
27 
28 /* Use the right prefix for registers.  */
29 
30 #define REG(x) CONCAT1(__REG_PREFIX__, x)
31 
32 #define rax REG(rax)
33 #define rbx REG(rbx)
34 #define rcx REG(rcx)
35 #define rdx REG(rdx)
36 #define rsi REG(rsi)
37 #define rdi REG(rdi)
38 #define rbp REG(rbp)
39 #define rsp REG(rsp)
40 
41 #define r8  REG(r8)
42 #define r9  REG(r9)
43 #define r10 REG(r10)
44 #define r11 REG(r11)
45 #define r12 REG(r12)
46 #define r13 REG(r13)
47 #define r14 REG(r14)
48 #define r15 REG(r15)
49 
50 #define eax REG(eax)
51 #define ebx REG(ebx)
52 #define ecx REG(ecx)
53 #define edx REG(edx)
54 #define esi REG(esi)
55 #define edi REG(edi)
56 #define ebp REG(ebp)
57 #define esp REG(esp)
58 
59 #define st0 REG(st)
60 #define st1 REG(st(1))
61 #define st2 REG(st(2))
62 #define st3 REG(st(3))
63 #define st4 REG(st(4))
64 #define st5 REG(st(5))
65 #define st6 REG(st(6))
66 #define st7 REG(st(7))
67 
68 #define ax REG(ax)
69 #define bx REG(bx)
70 #define cx REG(cx)
71 #define dx REG(dx)
72 
73 #define ah REG(ah)
74 #define bh REG(bh)
75 #define ch REG(ch)
76 #define dh REG(dh)
77 
78 #define al REG(al)
79 #define bl REG(bl)
80 #define cl REG(cl)
81 #define dl REG(dl)
82 
83 #define sil REG(sil)
84 
85 #define mm1 REG(mm1)
86 #define mm2 REG(mm2)
87 #define mm3 REG(mm3)
88 #define mm4 REG(mm4)
89 #define mm5 REG(mm5)
90 #define mm6 REG(mm6)
91 #define mm7 REG(mm7)
92 
93 #define xmm0 REG(xmm0)
94 #define xmm1 REG(xmm1)
95 #define xmm2 REG(xmm2)
96 #define xmm3 REG(xmm3)
97 #define xmm4 REG(xmm4)
98 #define xmm5 REG(xmm5)
99 #define xmm6 REG(xmm6)
100 #define xmm7 REG(xmm7)
101 
102 #define cr0 REG(cr0)
103 #define cr1 REG(cr1)
104 #define cr2 REG(cr2)
105 #define cr3 REG(cr3)
106 #define cr4 REG(cr4)
107 
108 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION
109 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function
110 #else
111 #define SOTYPE_FUNCTION(sym)
112 #endif
113 
114 #ifndef _I386MACH_DISABLE_HW_INTERRUPTS
115 #define        __CLI
116 #define        __STI
117 #else
118 #define __CLI  cli
119 #define __STI  sti
120 #endif
121