- Added stubs for some of the new w2k/xp functions.
[reactos.git] / reactos / drivers / video / videoprt / videoprt.h
1 /*
2 * VideoPort driver
3 *
4 * Copyright (C) 2002, 2003, 2004 ReactOS Team
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 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 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; see the file COPYING.LIB.
18 * If not, write to the Free Software Foundation,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 * $Id: videoprt.h,v 1.3 2004/03/06 22:25:22 dwelch Exp $
22 */
23
24 #ifndef VIDEOPRT_H
25 #define VIDEOPRT_H
26
27 #include <ddk/miniport.h>
28 #include <ddk/video.h>
29 #include <ddk/ntddvdeo.h>
30 #include "internal/ps.h"
31 /*#define NDEBUG*/
32 #include <debug.h>
33
34 /*
35 * FIXME: Definition missing from w32api!
36 */
37 #ifndef SYNCH_LEVEL
38 #define SYNCH_LEVEL (IPI_LEVEL - 2)
39 #endif
40 VOID FASTCALL KfLowerIrql(IN KIRQL NewIrql);
41 #define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
42 KIRQL FASTCALL KfRaiseIrql(IN KIRQL NewIrql);
43 NTKERNELAPI VOID HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
44
45 #define TAG_VIDEO_PORT TAG('V', 'I', 'D', 'P')
46
47 extern PEPROCESS Csrss;
48
49 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
50 {
51 LIST_ENTRY List;
52 PVOID MappedAddress;
53 ULONG NumberOfUchars;
54 PHYSICAL_ADDRESS IoAddress;
55 ULONG SystemIoBusNumber;
56 UINT MappingCount;
57 } VIDEO_PORT_ADDRESS_MAPPING, *PVIDEO_PORT_ADDRESS_MAPPING;
58
59 typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
60 {
61 PDEVICE_OBJECT DeviceObject;
62 PKINTERRUPT InterruptObject;
63 KSPIN_LOCK InterruptSpinLock;
64 ULONG InterruptVector;
65 ULONG InterruptLevel;
66 PVIDEO_HW_INITIALIZE HwInitialize;
67 PVIDEO_HW_RESET_HW HwResetHw;
68 PVIDEO_HW_TIMER HwTimer;
69 PVIDEO_HW_INTERRUPT HwInterrupt;
70 LIST_ENTRY AddressMappingListHead;
71 INTERFACE_TYPE AdapterInterfaceType;
72 ULONG SystemIoBusNumber;
73 UNICODE_STRING RegistryPath;
74 KDPC DpcObject;
75 UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */
76 } VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION;
77
78 NTSTATUS STDCALL
79 VidDispatchOpen(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
80
81 NTSTATUS STDCALL
82 VidDispatchClose(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
83
84 NTSTATUS STDCALL
85 VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
86
87 PVOID STDCALL
88 InternalMapMemory(
89 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
90 IN PHYSICAL_ADDRESS IoAddress,
91 IN ULONG NumberOfUchars,
92 IN UCHAR InIoSpace,
93 OUT NTSTATUS *Status);
94
95 VOID STDCALL
96 InternalUnmapMemory(
97 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
98 IN PVOID MappedAddress);
99
100 VP_STATUS STDCALL
101 IntInt10AllocateBuffer(
102 IN PVOID Context,
103 OUT PUSHORT Seg,
104 OUT PUSHORT Off,
105 IN OUT PULONG Length);
106
107 VP_STATUS STDCALL
108 IntInt10FreeBuffer(
109 IN PVOID Context,
110 IN USHORT Seg,
111 IN USHORT Off);
112
113 VP_STATUS STDCALL
114 IntInt10ReadMemory(
115 IN PVOID Context,
116 IN USHORT Seg,
117 IN USHORT Off,
118 OUT PVOID Buffer,
119 IN ULONG Length);
120
121 VP_STATUS STDCALL
122 IntInt10WriteMemory(
123 IN PVOID Context,
124 IN USHORT Seg,
125 IN USHORT Off,
126 IN PVOID Buffer,
127 IN ULONG Length);
128
129 VP_STATUS STDCALL
130 IntInt10CallBios(
131 IN PVOID Context,
132 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments);
133
134 #endif /* VIDEOPRT_H */