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