205be024623f90604ed7d697d7610c258b7b1d3a
[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 VOID RegisterIoPort(ULONG Port,
37 EMULATOR_INB_PROC InHandler,
38 EMULATOR_OUTB_PROC OutHandler);
39
40 VOID UnregisterIoPort(ULONG Port);
41
42 VOID WINAPI EmulatorReadIo
43 (
44 PFAST486_STATE State,
45 ULONG Port,
46 PVOID Buffer,
47 ULONG DataCount,
48 UCHAR DataSize
49 );
50
51 VOID WINAPI EmulatorWriteIo
52 (
53 PFAST486_STATE State,
54 ULONG Port,
55 PVOID Buffer,
56 ULONG DataCount,
57 UCHAR DataSize
58 );
59
60 #endif // _IO_H_
61
62 /* EOF */