1 /*
2 * VideoPort driver
3 *
4 * Copyright (C) 2002-2004, 2007 ReactOS Team
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22 #include "videoprt.h"
23
24 #define NDEBUG
25 #include <debug.h>
26
27 VP_STATUS
28 NTAPI
VideoPortFlushRegistry(PVOID HwDeviceExtension)29 VideoPortFlushRegistry(
30 PVOID HwDeviceExtension)
31 {
32 UNIMPLEMENTED;
33 return 0;
34 }
35
36 ULONG
37 NTAPI
VideoPortGetAssociatedDeviceID(IN PVOID DeviceObject)38 VideoPortGetAssociatedDeviceID(
39 IN PVOID DeviceObject)
40 {
41 UNIMPLEMENTED;
42 return 0;
43 }
44
45
46 ULONG
47 NTAPI
VideoPortGetBytesUsed(IN PVOID HwDeviceExtension,IN PDMA pDma)48 VideoPortGetBytesUsed(
49 IN PVOID HwDeviceExtension,
50 IN PDMA pDma)
51 {
52 UNIMPLEMENTED;
53 return 0;
54 }
55
56 PVOID
57 NTAPI
VideoPortGetMdl(IN PVOID HwDeviceExtension,IN PDMA pDma)58 VideoPortGetMdl(
59 IN PVOID HwDeviceExtension,
60 IN PDMA pDma)
61 {
62 UNIMPLEMENTED;
63 return 0;
64 }
65
66 VOID
67 NTAPI
VideoPortSetBytesUsed(IN PVOID HwDeviceExtension,IN OUT PDMA pDma,IN ULONG BytesUsed)68 VideoPortSetBytesUsed(
69 IN PVOID HwDeviceExtension,
70 IN OUT PDMA pDma,
71 IN ULONG BytesUsed)
72 {
73 UNIMPLEMENTED;
74 }
75
76 BOOLEAN
77 NTAPI
VideoPortUnlockPages(IN PVOID hwDeviceExtension,IN PDMA pDma)78 VideoPortUnlockPages(
79 IN PVOID hwDeviceExtension,
80 IN PDMA pDma)
81 {
82 UNIMPLEMENTED;
83 return 0;
84 }
85
_Function_class_(KDEFERRED_ROUTINE)86 _Function_class_(KDEFERRED_ROUTINE)
87 VOID
88 NTAPI
89 WdDdiWatchdogDpcCallback(
90 _In_ PKDPC Dpc,
91 _In_opt_ PVOID DeferredContext,
92 _In_opt_ PVOID SystemArgument1,
93 _In_opt_ PVOID SystemArgument2)
94 {
95 UNIMPLEMENTED;
96 }
97
98 LONG
99 FASTCALL
VideoPortInterlockedDecrement(IN PLONG Addend)100 VideoPortInterlockedDecrement(
101 IN PLONG Addend)
102 {
103 return _InterlockedDecrement(Addend);
104 }
105
106 LONG
107 FASTCALL
VideoPortInterlockedIncrement(IN PLONG Addend)108 VideoPortInterlockedIncrement(
109 IN PLONG Addend)
110 {
111 return _InterlockedIncrement(Addend);
112 }
113
114 LONG
115 FASTCALL
VideoPortInterlockedExchange(IN OUT PLONG Target,IN LONG Value)116 VideoPortInterlockedExchange(
117 IN OUT PLONG Target,
118 IN LONG Value)
119 {
120 return InterlockedExchange(Target, Value);
121 }
122
123 #ifdef _M_AMD64
124 UCHAR
125 NTAPI
VideoPortReadPortUchar(PUCHAR Port)126 VideoPortReadPortUchar(
127 PUCHAR Port)
128 {
129 return READ_PORT_UCHAR(Port);
130 }
131
132 USHORT
133 NTAPI
VideoPortReadPortUshort(PUSHORT Port)134 VideoPortReadPortUshort(
135 PUSHORT Port)
136 {
137 return READ_PORT_USHORT(Port);
138 }
139
140 ULONG
141 NTAPI
VideoPortReadPortUlong(PULONG Port)142 VideoPortReadPortUlong(
143 PULONG Port)
144 {
145 return READ_PORT_ULONG(Port);
146 }
147
148 VOID
149 NTAPI
VideoPortReadPortBufferUchar(PUCHAR Port,PUCHAR Buffer,ULONG Count)150 VideoPortReadPortBufferUchar(
151 PUCHAR Port,
152 PUCHAR Buffer,
153 ULONG Count)
154 {
155 READ_PORT_BUFFER_UCHAR(Port, Buffer, Count);
156 }
157
158 VOID
159 NTAPI
VideoPortReadPortBufferUshort(PUSHORT Port,PUSHORT Buffer,ULONG Count)160 VideoPortReadPortBufferUshort(
161 PUSHORT Port,
162 PUSHORT Buffer,
163 ULONG Count)
164 {
165 READ_PORT_BUFFER_USHORT(Port, Buffer, Count);
166 }
167
168 VOID
169 NTAPI
VideoPortReadPortBufferUlong(PULONG Port,PULONG Buffer,ULONG Count)170 VideoPortReadPortBufferUlong(
171 PULONG Port,
172 PULONG Buffer,
173 ULONG Count)
174 {
175 READ_PORT_BUFFER_ULONG(Port, Buffer, Count);
176 }
177
178 UCHAR
179 NTAPI
VideoPortReadRegisterUchar(PUCHAR Register)180 VideoPortReadRegisterUchar(
181 PUCHAR Register)
182 {
183 return READ_REGISTER_UCHAR(Register);
184 }
185
186 USHORT
187 NTAPI
VideoPortReadRegisterUshort(PUSHORT Register)188 VideoPortReadRegisterUshort(
189 PUSHORT Register)
190 {
191 return READ_REGISTER_USHORT(Register);
192 }
193
194 ULONG
195 NTAPI
VideoPortReadRegisterUlong(PULONG Register)196 VideoPortReadRegisterUlong(
197 PULONG Register)
198 {
199 return READ_REGISTER_ULONG(Register);
200 }
201
202 VOID
203 NTAPI
VideoPortReadRegisterBufferUchar(PUCHAR Register,PUCHAR Buffer,ULONG Count)204 VideoPortReadRegisterBufferUchar(
205 PUCHAR Register,
206 PUCHAR Buffer,
207 ULONG Count)
208 {
209 READ_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
210 }
211
212 VOID
213 NTAPI
VideoPortReadRegisterBufferUshort(PUSHORT Register,PUSHORT Buffer,ULONG Count)214 VideoPortReadRegisterBufferUshort(
215 PUSHORT Register,
216 PUSHORT Buffer,
217 ULONG Count)
218 {
219 READ_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
220 }
221
222 VOID
223 NTAPI
VideoPortReadRegisterBufferUlong(PULONG Register,PULONG Buffer,ULONG Count)224 VideoPortReadRegisterBufferUlong(
225 PULONG Register,
226 PULONG Buffer,
227 ULONG Count)
228 {
229 READ_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
230 }
231
232 VOID
233 NTAPI
VideoPortWritePortUchar(PUCHAR Port,UCHAR Value)234 VideoPortWritePortUchar(
235 PUCHAR Port,
236 UCHAR Value)
237 {
238 WRITE_PORT_UCHAR(Port, Value);
239 }
240
241 VOID
242 NTAPI
VideoPortWritePortUshort(PUSHORT Port,USHORT Value)243 VideoPortWritePortUshort(
244 PUSHORT Port,
245 USHORT Value)
246 {
247 WRITE_PORT_USHORT(Port, Value);
248 }
249
250 VOID
251 NTAPI
VideoPortWritePortUlong(PULONG Port,ULONG Value)252 VideoPortWritePortUlong(
253 PULONG Port,
254 ULONG Value)
255 {
256 WRITE_PORT_ULONG(Port, Value);
257 }
258
259 VOID
260 NTAPI
VideoPortWritePortBufferUchar(PUCHAR Port,PUCHAR Buffer,ULONG Count)261 VideoPortWritePortBufferUchar(
262 PUCHAR Port,
263 PUCHAR Buffer,
264 ULONG Count)
265 {
266 WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count);
267 }
268
269 VOID
270 NTAPI
VideoPortWritePortBufferUshort(PUSHORT Port,PUSHORT Buffer,ULONG Count)271 VideoPortWritePortBufferUshort(
272 PUSHORT Port,
273 PUSHORT Buffer,
274 ULONG Count)
275 {
276 WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count);
277 }
278
279 VOID
280 NTAPI
VideoPortWritePortBufferUlong(PULONG Port,PULONG Buffer,ULONG Count)281 VideoPortWritePortBufferUlong(
282 PULONG Port,
283 PULONG Buffer,
284 ULONG Count)
285 {
286 WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count);
287 }
288
289 VOID
290 NTAPI
VideoPortWriteRegisterUchar(PUCHAR Register,UCHAR Value)291 VideoPortWriteRegisterUchar(
292 PUCHAR Register,
293 UCHAR Value)
294 {
295 WRITE_REGISTER_UCHAR(Register, Value);
296 }
297
298 VOID
299 NTAPI
VideoPortWriteRegisterUshort(PUSHORT Register,USHORT Value)300 VideoPortWriteRegisterUshort(
301 PUSHORT Register,
302 USHORT Value)
303 {
304 WRITE_REGISTER_USHORT(Register, Value);
305 }
306
307 VOID
308 NTAPI
VideoPortWriteRegisterUlong(PULONG Register,ULONG Value)309 VideoPortWriteRegisterUlong(
310 PULONG Register,
311 ULONG Value)
312 {
313 WRITE_REGISTER_ULONG(Register, Value);
314 }
315
316 VOID
317 NTAPI
VideoPortWriteRegisterBufferUchar(PUCHAR Register,PUCHAR Buffer,ULONG Count)318 VideoPortWriteRegisterBufferUchar(
319 PUCHAR Register,
320 PUCHAR Buffer,
321 ULONG Count)
322 {
323 WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
324 }
325
326 VOID
327 NTAPI
VideoPortWriteRegisterBufferUshort(PUSHORT Register,PUSHORT Buffer,ULONG Count)328 VideoPortWriteRegisterBufferUshort(
329 PUSHORT Register,
330 PUSHORT Buffer,
331 ULONG Count)
332 {
333 WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
334 }
335
336 VOID
337 NTAPI
VideoPortWriteRegisterBufferUlong(PULONG Register,PULONG Buffer,ULONG Count)338 VideoPortWriteRegisterBufferUlong(
339 PULONG Register,
340 PULONG Buffer,
341 ULONG Count)
342 {
343 WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
344 }
345
346 VOID
347 NTAPI
VideoPortQuerySystemTime(OUT PLARGE_INTEGER CurrentTime)348 VideoPortQuerySystemTime(
349 OUT PLARGE_INTEGER CurrentTime)
350 {
351 KeQuerySystemTime(CurrentTime);
352 }
353
354 #endif /* _M_AMD64 */
355