2013-11-26 20:20:51 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: GPL - See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Virtual DOS Machine
|
2015-09-18 17:01:49 +00:00
|
|
|
* FILE: subsystems/mvdm/ntvdm/io.h
|
2013-11-26 20:20:51 +00:00
|
|
|
* PURPOSE: I/O Port Handlers
|
|
|
|
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
|
|
|
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _IO_H_
|
|
|
|
#define _IO_H_
|
|
|
|
|
|
|
|
/* DEFINES ********************************************************************/
|
|
|
|
|
|
|
|
#define EMULATOR_MAX_IOPORTS_NUM 0x10000
|
|
|
|
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2014-10-23 11:44:07 +00:00
|
|
|
typedef UCHAR (WINAPI *EMULATOR_INB_PROC)(USHORT Port);
|
|
|
|
typedef USHORT (WINAPI *EMULATOR_INW_PROC)(USHORT Port);
|
|
|
|
typedef ULONG (WINAPI *EMULATOR_IND_PROC)(USHORT Port);
|
2013-11-26 20:20:51 +00:00
|
|
|
|
2014-10-23 11:44:07 +00:00
|
|
|
typedef VOID (WINAPI *EMULATOR_INSB_PROC)(USHORT Port, PUCHAR Buffer, ULONG Count);
|
|
|
|
typedef VOID (WINAPI *EMULATOR_INSW_PROC)(USHORT Port, PUSHORT Buffer, ULONG Count);
|
|
|
|
typedef VOID (WINAPI *EMULATOR_INSD_PROC)(USHORT Port, PULONG Buffer, ULONG Count);
|
2013-11-26 20:20:51 +00:00
|
|
|
|
2014-10-23 11:44:07 +00:00
|
|
|
typedef VOID (WINAPI *EMULATOR_OUTB_PROC)(USHORT Port, UCHAR Data);
|
|
|
|
typedef VOID (WINAPI *EMULATOR_OUTW_PROC)(USHORT Port, USHORT Data);
|
|
|
|
typedef VOID (WINAPI *EMULATOR_OUTD_PROC)(USHORT Port, ULONG Data);
|
2013-12-23 18:17:29 +00:00
|
|
|
|
2014-10-23 11:44:07 +00:00
|
|
|
typedef VOID (WINAPI *EMULATOR_OUTSB_PROC)(USHORT Port, PUCHAR Buffer, ULONG Count);
|
|
|
|
typedef VOID (WINAPI *EMULATOR_OUTSW_PROC)(USHORT Port, PUSHORT Buffer, ULONG Count);
|
|
|
|
typedef VOID (WINAPI *EMULATOR_OUTSD_PROC)(USHORT Port, PULONG Buffer, ULONG Count);
|
2013-12-23 18:17:29 +00:00
|
|
|
|
|
|
|
|
2014-01-11 14:40:03 +00:00
|
|
|
UCHAR
|
2014-10-23 11:44:07 +00:00
|
|
|
IOReadB(USHORT Port);
|
2014-01-11 14:40:03 +00:00
|
|
|
VOID
|
2014-10-23 12:21:46 +00:00
|
|
|
IOReadStrB(USHORT Port,
|
2014-01-11 14:40:03 +00:00
|
|
|
PUCHAR Buffer,
|
|
|
|
ULONG Count);
|
|
|
|
|
|
|
|
VOID
|
2014-10-23 11:44:07 +00:00
|
|
|
IOWriteB(USHORT Port,
|
2014-10-23 12:21:46 +00:00
|
|
|
UCHAR Buffer);
|
2014-01-11 14:40:03 +00:00
|
|
|
VOID
|
2014-10-23 12:21:46 +00:00
|
|
|
IOWriteStrB(USHORT Port,
|
2014-01-11 14:40:03 +00:00
|
|
|
PUCHAR Buffer,
|
|
|
|
ULONG Count);
|
|
|
|
|
|
|
|
USHORT
|
2014-10-23 11:44:07 +00:00
|
|
|
IOReadW(USHORT Port);
|
2014-01-11 14:40:03 +00:00
|
|
|
VOID
|
2014-10-23 12:21:46 +00:00
|
|
|
IOReadStrW(USHORT Port,
|
2014-01-11 14:40:03 +00:00
|
|
|
PUSHORT Buffer,
|
|
|
|
ULONG Count);
|
|
|
|
|
|
|
|
VOID
|
2014-10-23 12:21:46 +00:00
|
|
|
IOWriteW(USHORT Port,
|
2014-01-11 14:40:03 +00:00
|
|
|
USHORT Buffer);
|
|
|
|
VOID
|
2014-10-23 12:21:46 +00:00
|
|
|
IOWriteStrW(USHORT Port,
|
2014-01-11 14:40:03 +00:00
|
|
|
PUSHORT Buffer,
|
|
|
|
ULONG Count);
|
|
|
|
|
|
|
|
ULONG
|
2014-10-23 11:44:07 +00:00
|
|
|
IOReadD(USHORT Port);
|
2014-01-11 14:40:03 +00:00
|
|
|
VOID
|
2014-10-23 12:21:46 +00:00
|
|
|
IOReadStrD(USHORT Port,
|
2014-01-11 14:40:03 +00:00
|
|
|
PULONG Buffer,
|
|
|
|
ULONG Count);
|
|
|
|
|
|
|
|
VOID
|
2014-10-23 11:44:07 +00:00
|
|
|
IOWriteD(USHORT Port,
|
2014-10-23 12:21:46 +00:00
|
|
|
ULONG Buffer);
|
2014-01-11 14:40:03 +00:00
|
|
|
VOID
|
2014-10-23 12:21:46 +00:00
|
|
|
IOWriteStrD(USHORT Port,
|
2014-01-11 14:40:03 +00:00
|
|
|
PULONG Buffer,
|
|
|
|
ULONG Count);
|
|
|
|
|
|
|
|
|
2014-10-23 11:44:07 +00:00
|
|
|
VOID RegisterIoPort(USHORT Port,
|
2013-12-23 18:17:29 +00:00
|
|
|
EMULATOR_INB_PROC InHandler,
|
|
|
|
EMULATOR_OUTB_PROC OutHandler);
|
|
|
|
|
2014-10-23 11:44:07 +00:00
|
|
|
VOID UnregisterIoPort(USHORT Port);
|
2013-12-08 14:22:27 +00:00
|
|
|
|
2015-06-12 03:30:40 +00:00
|
|
|
VOID FASTCALL EmulatorReadIo
|
2013-11-26 20:20:51 +00:00
|
|
|
(
|
|
|
|
PFAST486_STATE State,
|
2014-10-23 11:44:07 +00:00
|
|
|
USHORT Port,
|
2013-11-26 20:20:51 +00:00
|
|
|
PVOID Buffer,
|
|
|
|
ULONG DataCount,
|
|
|
|
UCHAR DataSize
|
|
|
|
);
|
|
|
|
|
2015-06-12 03:30:40 +00:00
|
|
|
VOID FASTCALL EmulatorWriteIo
|
2013-11-26 20:20:51 +00:00
|
|
|
(
|
|
|
|
PFAST486_STATE State,
|
2014-10-23 11:44:07 +00:00
|
|
|
USHORT Port,
|
2013-11-26 20:20:51 +00:00
|
|
|
PVOID Buffer,
|
|
|
|
ULONG DataCount,
|
|
|
|
UCHAR DataSize
|
|
|
|
);
|
|
|
|
|
2015-10-03 21:47:46 +00:00
|
|
|
#endif /* _IO_H_ */
|