4 * Copyright (C) 2002, 2003, 2004 ReactOS Team
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.
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.
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.
27 #include <ddk/miniport.h>
28 #include <ddk/video.h>
29 #include <ddk/ntddvdeo.h>
30 #include <ddk/ntapi.h>
31 #include <ddk/ntagp.h>
35 int swprintf(wchar_t *buf
, const wchar_t *fmt
, ...);
36 int vsprintf(char *buf
, const char *fmt
, va_list args
);
39 HalDisableSystemInterrupt(ULONG Vector
,
43 HalEnableSystemInterrupt(ULONG Vector
,
45 KINTERRUPT_MODE InterruptMode
);
47 PIMAGE_NT_HEADERS STDCALL
RtlImageNtHeader(IN PVOID BaseAddress
);
49 #define TAG_VIDEO_PORT TAG('V', 'I', 'D', 'P')
51 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
56 PHYSICAL_ADDRESS IoAddress
;
57 ULONG SystemIoBusNumber
;
59 } VIDEO_PORT_ADDRESS_MAPPING
, *PVIDEO_PORT_ADDRESS_MAPPING
;
61 struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
;
63 typedef struct _VIDEO_PORT_AGP_MAPPING
67 PHYSICAL_ADDRESS PhysicalAddress
;
68 } VIDEO_PORT_AGP_MAPPING
, *PVIDEO_PORT_AGP_MAPPING
;
70 typedef struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
72 PVIDEO_PORT_AGP_MAPPING AgpMapping
;
75 } VIDEO_PORT_AGP_VIRTUAL_MAPPING
, *PVIDEO_PORT_AGP_VIRTUAL_MAPPING
;
77 typedef struct _VIDEO_PORT_DRIVER_EXTENSION
79 VIDEO_HW_INITIALIZATION_DATA InitializationData
;
81 UNICODE_STRING RegistryPath
;
82 } VIDEO_PORT_DRIVER_EXTENSION
, *PVIDEO_PORT_DRIVER_EXTENSION
;
84 typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
87 PDEVICE_OBJECT PhysicalDeviceObject
;
88 PDEVICE_OBJECT FunctionalDeviceObject
;
89 PDEVICE_OBJECT NextDeviceObject
;
90 UNICODE_STRING RegistryPath
;
91 PKINTERRUPT InterruptObject
;
92 KSPIN_LOCK InterruptSpinLock
;
93 PCM_RESOURCE_LIST AllocatedResources
;
94 ULONG InterruptVector
;
96 ULONG AdapterInterfaceType
;
97 ULONG SystemIoBusNumber
;
98 ULONG SystemIoSlotNumber
;
99 LIST_ENTRY AddressMappingListHead
;
101 VIDEO_PORT_DRIVER_EXTENSION
*DriverExtension
;
103 AGP_BUS_INTERFACE_STANDARD AgpInterface
;
105 CHAR MiniPortDeviceExtension
[1];
106 } VIDEO_PORT_DEVICE_EXTENSION
, *PVIDEO_PORT_DEVICE_EXTENSION
;
108 #define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
111 VIDEO_PORT_DEVICE_EXTENSION, \
112 MiniPortDeviceExtension)
118 IN PVOID HwDeviceExtension
,
119 IN OUT PINTERFACE Interface
);
124 IntVideoPortAddDevice(
125 IN PDRIVER_OBJECT DriverObject
,
126 IN PDEVICE_OBJECT PhysicalDeviceObject
);
129 IntVideoPortDispatchOpen(
130 IN PDEVICE_OBJECT DeviceObject
,
134 IntVideoPortDispatchClose(
135 IN PDEVICE_OBJECT DeviceObject
,
139 IntVideoPortDispatchCleanup(
140 IN PDEVICE_OBJECT DeviceObject
,
144 IntVideoPortDispatchDeviceControl(
145 IN PDEVICE_OBJECT DeviceObject
,
149 IntVideoPortDispatchPnp(
150 IN PDEVICE_OBJECT DeviceObject
,
154 IntVideoPortDispatchPower(
155 IN PDEVICE_OBJECT DeviceObject
,
159 IntVideoPortUnload(PDRIVER_OBJECT DriverObject
);
164 IntVideoPortSetupTimer(
165 IN PDEVICE_OBJECT DeviceObject
,
166 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
);
171 IntVideoPortSetupInterrupt(
172 IN PDEVICE_OBJECT DeviceObject
,
173 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
174 IN PVIDEO_PORT_CONFIG_INFO ConfigInfo
);
179 IntVideoPortMapPhysicalMemory(
181 IN PHYSICAL_ADDRESS PhysicalAddress
,
182 IN ULONG SizeInBytes
,
184 IN OUT PVOID
*VirtualAddress OPTIONAL
);
188 extern ULONG CsrssInitialized
;
189 extern PEPROCESS Csrss
;
192 VideoPortEnumerateChildren(
193 IN PVOID HwDeviceExtension
,
197 VideoPortGetProcAddress(
198 IN PVOID HwDeviceExtension
,
199 IN PUCHAR FunctionName
);
202 IntAttachToCSRSS(PEPROCESS
*CallingProcess
, PEPROCESS
*PrevAttachedProcess
);
205 IntDetachFromCSRSS(PEPROCESS
*CallingProcess
, PEPROCESS
*PrevAttachedProcess
);
208 IntVideoPortCreateAdapterDeviceObject(
209 IN PDRIVER_OBJECT DriverObject
,
210 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
211 IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL
,
212 OUT PDEVICE_OBJECT
*DeviceObject OPTIONAL
);
215 IntVideoPortFindAdapter(
216 IN PDRIVER_OBJECT DriverObject
,
217 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
218 IN PDEVICE_OBJECT DeviceObject
);
223 IntInt10AllocateBuffer(
227 IN OUT PULONG Length
);
254 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments
);
258 IN PVOID HwDeviceExtension
,
259 IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments
);
261 #endif /* VIDEOPRT_H */