blob: d7daac82d980528ea450a9ae65d21f1893dde99f [file] [log] [blame]
Li-Ta Lo81521262004-07-08 17:18:27 +00001/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.h,v 1.2 2001/01/06 20:19:13 tsi Exp $ */
2/*
3 * XFree86 int10 module
4 * execute BIOS int 10h calls in x86 real mode environment
5 * Copyright 1999 Egbert Eich
6 */
7#ifndef XF86X86EMU_H_
8#define XF86X86EMU_H_
9#include <x86emu.h>
10
11#define M _X86EMU_env
12
13#define X86_EAX M.x86.R_EAX
14#define X86_EBX M.x86.R_EBX
15#define X86_ECX M.x86.R_ECX
16#define X86_EDX M.x86.R_EDX
17#define X86_ESI M.x86.R_ESI
18#define X86_EDI M.x86.R_EDI
19#define X86_EBP M.x86.R_EBP
20#define X86_EIP M.x86.R_EIP
21#define X86_ESP M.x86.R_ESP
22#define X86_EFLAGS M.x86.R_EFLG
23
24#define X86_FLAGS M.x86.R_FLG
25#define X86_AX M.x86.R_AX
26#define X86_BX M.x86.R_BX
27#define X86_CX M.x86.R_CX
28#define X86_DX M.x86.R_DX
29#define X86_SI M.x86.R_SI
30#define X86_DI M.x86.R_DI
31#define X86_BP M.x86.R_BP
32#define X86_IP M.x86.R_IP
33#define X86_SP M.x86.R_SP
34#define X86_CS M.x86.R_CS
35#define X86_DS M.x86.R_DS
36#define X86_ES M.x86.R_ES
37#define X86_SS M.x86.R_SS
38#define X86_FS M.x86.R_FS
39#define X86_GS M.x86.R_GS
40
41#define X86_AL M.x86.R_AL
42#define X86_BL M.x86.R_BL
43#define X86_CL M.x86.R_CL
44#define X86_DL M.x86.R_DL
45
46#define X86_AH M.x86.R_AH
47#define X86_BH M.x86.R_BH
48#define X86_CH M.x86.R_CH
49#define X86_DH M.x86.R_DH
50
51
52/* int10 info structure */
53typedef struct {
54 u16 BIOSseg;
55 u16 inb40time;
56 struct _mem *mem;
57 int num;
58 int ax;
59 int bx;
60 int cx;
61 int dx;
62 int si;
63 int di;
64 int es;
65 int bp;
66 int flags;
67 int stackseg;
68} _ptr, *ptr;
69
70typedef struct _mem {
71 u8(*rb) (ptr, int);
72 u16(*rw) (ptr, int);
73 u32(*rl) (ptr, int);
74 void (*wb) (ptr, int, u8);
75 void (*ww) (ptr, int, u16);
76 void (*wl) (ptr, int, u32);
77} mem;
78
79#define MEM_WB(where, what) wrb(where,what)
80#define MEM_WW(where, what) wrw(where, what)
81#define MEM_WL(where, what) wrl(where, what)
82
83#define MEM_RB(where) rdb(where)
84#define MEM_RW(where) rdw(where)
85#define MEM_RL(where) rdl(where)
86
87extern ptr current;
88
89#endif