9ed80ec794b8bb03cc5219a300a45fb6c9d3c763
[reactos.git] / subsystems / ntvdm / io.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: io.c
5 * PURPOSE: I/O Port Handlers
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #ifndef _IO_H_
11 #define _IO_H_
12
13 /* DEFINES ********************************************************************/
14
15 #define EMULATOR_MAX_IOPORTS_NUM 0x10000
16
17 /* FUNCTIONS ******************************************************************/
18
19 typedef UCHAR (WINAPI *EMULATOR_INB_PROC)(ULONG Port);
20 typedef USHORT (WINAPI *EMULATOR_INW_PROC)(ULONG Port);
21 typedef ULONG (WINAPI *EMULATOR_IND_PROC)(ULONG Port);
22
23 typedef VOID (WINAPI *EMULATOR_INSB_PROC)(ULONG Port, PUCHAR Buffer, ULONG Count);
24 typedef VOID (WINAPI *EMULATOR_INSW_PROC)(ULONG Port, PUSHORT Buffer, ULONG Count);
25 typedef VOID (WINAPI *EMULATOR_INSD_PROC)(ULONG Port, PULONG Buffer, ULONG Count);
26
27 typedef VOID (WINAPI *EMULATOR_OUTB_PROC)(ULONG Port, UCHAR Data);
28 typedef VOID (WINAPI *EMULATOR_OUTW_PROC)(ULONG Port, USHORT Data);
29 typedef VOID (WINAPI *EMULATOR_OUTD_PROC)(ULONG Port, ULONG Data);
30
31 typedef VOID (WINAPI *EMULATOR_OUTSB_PROC)(ULONG Port, PUCHAR Buffer, ULONG Count);
32 typedef VOID (WINAPI *EMULATOR_OUTSW_PROC)(ULONG Port, PUSHORT Buffer, ULONG Count);
33 typedef VOID (WINAPI *EMULATOR_OUTSD_PROC)(ULONG Port, PULONG Buffer, ULONG Count);
34
35
36 UCHAR
37 IOReadB(ULONG Port);
38 VOID
39 IOReadStrB(ULONG Port,
40 PUCHAR Buffer,
41 ULONG Count);
42
43 VOID
44 IOWriteB(ULONG Port,
45 UCHAR Buffer);
46 VOID
47 IOWriteStrB(ULONG Port,
48 PUCHAR Buffer,
49 ULONG Count);
50
51 USHORT
52 IOReadW(ULONG Port);
53 VOID
54 IOReadStrW(ULONG Port,
55 PUSHORT Buffer,
56 ULONG Count);
57
58 VOID
59 IOWriteW(ULONG Port,
60 USHORT Buffer);
61 VOID
62 IOWriteStrW(ULONG Port,
63 PUSHORT Buffer,
64 ULONG Count);
65
66 ULONG
67 IOReadD(ULONG Port);
68 VOID
69 IOReadStrD(ULONG Port,
70 PULONG Buffer,
71 ULONG Count);
72
73 VOID
74 IOWriteD(ULONG Port,
75 ULONG Buffer);
76 VOID
77 IOWriteStrD(ULONG Port,
78 PULONG Buffer,
79 ULONG Count);
80
81
82 VOID RegisterIoPort(ULONG Port,
83 EMULATOR_INB_PROC InHandler,
84 EMULATOR_OUTB_PROC OutHandler);
85
86 VOID UnregisterIoPort(ULONG Port);
87
88 VOID WINAPI EmulatorReadIo
89 (
90 PFAST486_STATE State,
91 ULONG Port,
92 PVOID Buffer,
93 ULONG DataCount,
94 UCHAR DataSize
95 );
96
97 VOID WINAPI EmulatorWriteIo
98 (
99 PFAST486_STATE State,
100 ULONG Port,
101 PVOID Buffer,
102 ULONG DataCount,
103 UCHAR DataSize
104 );
105
106 #endif // _IO_H_
107
108 /* EOF */