db2ec7b6e71f77233a2ed820c5e5682ebdd1020d
[reactos.git] / reactos / ntoskrnl / hal / x86 / portio.c
1 /* $Id: portio.c,v 1.2 1999/12/12 03:48:47 phreak Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/hal/x86/portio.c
6 * PURPOSE: Port I/O functions
7 * PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
8 * UPDATE HISTORY:
9 * Created 18/10/99
10 */
11
12 #include <ddk/ntddk.h>
13 #include <internal/halio.h>
14
15
16 /* FUNCTIONS ****************************************************************/
17
18 VOID
19 READ_PORT_BUFFER_UCHAR (PUCHAR Port,
20 PUCHAR Buffer,
21 ULONG Count)
22 {
23 insb ((ULONG)Port, Buffer, Count);
24 }
25
26
27 VOID
28 READ_PORT_BUFFER_ULONG (PULONG Port,
29 PULONG Buffer,
30 ULONG Count)
31 {
32 insl ((ULONG)Port, Buffer, Count);
33 }
34
35
36 VOID
37 READ_PORT_BUFFER_USHORT (PUSHORT Port,
38 PUSHORT Buffer,
39 ULONG Count)
40 {
41 insw ((ULONG)Port, Buffer, Count);
42 }
43
44
45 UCHAR
46 READ_PORT_UCHAR (PUCHAR Port)
47 {
48 return inb_p ((ULONG)Port);
49 }
50
51
52 ULONG
53 READ_PORT_ULONG (PULONG Port)
54 {
55 return inl_p ((ULONG)Port);
56 }
57
58
59 USHORT
60 READ_PORT_USHORT (PUSHORT Port)
61 {
62 return inw_p ((ULONG)Port);
63 }
64
65
66 VOID
67 WRITE_PORT_BUFFER_UCHAR (PUCHAR Port,
68 PUCHAR Buffer,
69 ULONG Count)
70 {
71 outsb ((ULONG)Port, Buffer, Count);
72 }
73
74
75 VOID
76 WRITE_PORT_BUFFER_ULONG (PULONG Port,
77 PULONG Buffer,
78 ULONG Count)
79 {
80 outsl ((ULONG)Port, Buffer, Count);
81 }
82
83
84 VOID
85 WRITE_PORT_BUFFER_USHORT (PUSHORT Port,
86 PUSHORT Buffer,
87 ULONG Count)
88 {
89 outsw ((ULONG)Port, Buffer, Count);
90 }
91
92
93 VOID
94 WRITE_PORT_UCHAR (PUCHAR Port,
95 UCHAR Value)
96 {
97 outb_p ((ULONG)Port, Value);
98 }
99
100
101 VOID
102 WRITE_PORT_ULONG (PULONG Port,
103 ULONG Value)
104 {
105 outl_p ((ULONG)Port, Value);
106 }
107
108
109 VOID
110 WRITE_PORT_USHORT (PUSHORT Port,
111 USHORT Value)
112 {
113 outw_p ((ULONG)Port, Value);
114 }
115
116 /* EOF */