3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: hal/halx86/generic/portio.c
5 * PURPOSE: I/O Functions for access to ports
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES ******************************************************************/
16 // HAL Port to Inlined Port
18 #define H2I(Port) PtrToUshort(Port)
20 /* FUNCTIONS *****************************************************************/
24 READ_PORT_BUFFER_UCHAR(IN PUCHAR Port
,
28 __inbytestring(H2I(Port
), Buffer
, Count
);
33 READ_PORT_BUFFER_USHORT(IN PUSHORT Port
,
37 __inwordstring(H2I(Port
), Buffer
, Count
);
42 READ_PORT_BUFFER_ULONG(IN PULONG Port
,
46 __indwordstring(H2I(Port
), Buffer
, Count
);
51 READ_PORT_UCHAR(IN PUCHAR Port
)
53 return __inbyte(H2I(Port
));
58 READ_PORT_USHORT(IN PUSHORT Port
)
60 return __inword(H2I(Port
));
65 READ_PORT_ULONG(IN PULONG Port
)
67 return __indword(H2I(Port
));
72 WRITE_PORT_BUFFER_UCHAR(IN PUCHAR Port
,
76 __outbytestring(H2I(Port
), Buffer
, Count
);
81 WRITE_PORT_BUFFER_USHORT(IN PUSHORT Port
,
85 __outwordstring(H2I(Port
), Buffer
, Count
);
90 WRITE_PORT_BUFFER_ULONG(IN PULONG Port
,
94 __outdwordstring(H2I(Port
), Buffer
, Count
);
99 WRITE_PORT_UCHAR(IN PUCHAR Port
,
102 __outbyte(H2I(Port
), Value
);
107 WRITE_PORT_USHORT(IN PUSHORT Port
,
110 __outword(H2I(Port
), Value
);
115 WRITE_PORT_ULONG(IN PULONG Port
,
118 __outdword(H2I(Port
), Value
);