e9e5acb17ea3758d5d4f3fbf78ef32b29e88a3b9
[reactos.git] / reactos / ntoskrnl / include / internal / v86m.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2000 David Welch <welch@cwcom.net>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 /*
20 * FILE: ntoskrnl/include/internal/v86m.h
21 * PURPOSE: V86 mode support
22 * PROGRAMMER: David Welch (welch@cwcom.net)
23 * UPDATE HISTORY:
24 * Created 10/12/00
25 */
26
27 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_V86M_H
28 #define __NTOSKRNL_INCLUDE_INTERNAL_V86M_H
29
30 #ifndef __ASM__
31
32 /* Emulate cli/sti instructions */
33 #define KV86M_EMULATE_CLI_STI (0x1)
34 /* Allow the v86 mode code to access i/o ports */
35 #define KV86M_ALLOW_IO_PORT_ACCESS (0x2)
36
37 typedef struct _KV86M_REGISTERS
38 {
39 /*
40 * General purpose registers
41 */
42
43 ULONG Ebp;
44 ULONG Edi;
45 ULONG Esi;
46 ULONG Edx;
47 ULONG Ecx;
48 ULONG Ebx;
49 ULONG Eax;
50 ULONG Ds;
51 ULONG Es;
52 ULONG Fs;
53 ULONG Gs;
54
55 /*
56 * Control registers
57 */
58 ULONG Eip;
59 ULONG Cs;
60 ULONG Eflags;
61 ULONG Esp;
62 ULONG Ss;
63
64 /*
65 * Control structures
66 */
67 ULONG RecoveryAddress;
68 UCHAR RecoveryInstruction[4];
69 ULONG Vif;
70 ULONG Flags;
71 PNTSTATUS PStatus;
72 } KV86M_REGISTERS, *PKV86M_REGISTERS;
73
74 NTSTATUS STDCALL
75 Ke386CallBios(UCHAR Int, PKV86M_REGISTERS Regs);
76
77 #else /* ASSEMBLER */
78
79 /*
80 * Definitions for the offsets of members in the KV86M_REGISTERS
81 */
82 #define KV86M_REGISTERS_EBP (0x0)
83 #define KV86M_REGISTERS_EDI (0x4)
84 #define KV86M_REGISTERS_ESI (0x8)
85 #define KV86M_REGISTERS_EDX (0xC)
86 #define KV86M_REGISTERS_ECX (0x10)
87 #define KV86M_REGISTERS_EBX (0x14)
88 #define KV86M_REGISTERS_EAX (0x18)
89 #define KV86M_REGISTERS_DS (0x1C)
90 #define KV86M_REGISTERS_ES (0x20)
91 #define KV86M_REGISTERS_FS (0x24)
92 #define KV86M_REGISTERS_GS (0x28)
93 #define KV86M_REGISTERS_EIP (0x2C)
94 #define KV86M_REGISTERS_CS (0x30)
95 #define KV86M_REGISTERS_EFLAGS (0x34)
96 #define KV86M_REGISTERS_ESP (0x38)
97 #define KV86M_REGISTERS_SS (0x3C)
98
99 #endif /* ASSEMBLER */
100
101 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_V86M_H */