Fix compilation warnings.
[v86d.git] / v86_x86emu.h
blob0557816f8f57e3fe87dc90e097a7ff557b89d4b3
1 #ifndef __H_V86_X86EMU
2 #define __H_V86_X86EMU
4 #define X86_EAX M.x86.R_EAX
5 #define X86_EBX M.x86.R_EBX
6 #define X86_ECX M.x86.R_ECX
7 #define X86_EDX M.x86.R_EDX
8 #define X86_ESI M.x86.R_ESI
9 #define X86_EDI M.x86.R_EDI
10 #define X86_EBP M.x86.R_EBP
11 #define X86_EIP M.x86.R_EIP
12 #define X86_ESP M.x86.R_ESP
13 #define X86_EFLAGS M.x86.R_EFLG
15 #define X86_FLAGS M.x86.R_FLG
16 #define X86_AX M.x86.R_AX
17 #define X86_BX M.x86.R_BX
18 #define X86_CX M.x86.R_CX
19 #define X86_DX M.x86.R_DX
20 #define X86_SI M.x86.R_SI
21 #define X86_DI M.x86.R_DI
22 #define X86_BP M.x86.R_BP
23 #define X86_IP M.x86.R_IP
24 #define X86_SP M.x86.R_SP
25 #define X86_CS M.x86.R_CS
26 #define X86_DS M.x86.R_DS
27 #define X86_ES M.x86.R_ES
28 #define X86_SS M.x86.R_SS
29 #define X86_FS M.x86.R_FS
30 #define X86_GS M.x86.R_GS
32 #define X86_AL M.x86.R_AL
33 #define X86_BL M.x86.R_BL
34 #define X86_CL M.x86.R_CL
35 #define X86_DL M.x86.R_DL
37 #define X86_AH M.x86.R_AH
38 #define X86_BH M.x86.R_BH
39 #define X86_CH M.x86.R_CH
40 #define X86_DH M.x86.R_DH
42 #define X86_TF_MASK 0x00000100
43 #define X86_IF_MASK 0x00000200
44 #define X86_IOPL_MASK 0x00003000
45 #define X86_NT_MASK 0x00004000
46 #define X86_VM_MASK 0x00020000
47 #define X86_AC_MASK 0x00040000
48 #define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
49 #define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
50 #define X86_ID_MASK 0x00200000
52 #define DEFAULT_V86_FLAGS (X86_IF_MASK | X86_IOPL_MASK)
54 extern int iopl (int __level);
55 extern int ioperm (unsigned long int __from, unsigned long int __num,
56 int __turn_on);
58 #define __BUILDIO(bwl,bw,type) \
59 static void x_out ## bwl (u16 port, type value) { \
60 /*printf("out" #bwl " %x, %x\n", port, value);*/ \
61 __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" \
62 : : "a"(value), "Nd"(port)); \
63 } \
65 static type x_in ## bwl (u16 port) { \
66 type value; \
67 __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" \
68 : "=a"(value) \
69 : "Nd"(port)); \
70 /*printf("in" #bwl " %x = %x\n", port, value);*/ \
71 return value; \
73 #endif /* __H_V86_X86EMU */