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 BOOLEAN InterruptShared
;
97 ULONG AdapterInterfaceType
;
98 ULONG SystemIoBusNumber
;
99 ULONG SystemIoSlotNumber
;
100 LIST_ENTRY AddressMappingListHead
;
102 VIDEO_PORT_DRIVER_EXTENSION
*DriverExtension
;
104 AGP_BUS_INTERFACE_STANDARD AgpInterface
;
106 CHAR MiniPortDeviceExtension
[1];
107 } VIDEO_PORT_DEVICE_EXTENSION
, *PVIDEO_PORT_DEVICE_EXTENSION
;
109 #define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
112 VIDEO_PORT_DEVICE_EXTENSION, \
113 MiniPortDeviceExtension)
119 IN PVOID HwDeviceExtension
,
120 IN OUT PINTERFACE Interface
);
125 IntVideoPortAddDevice(
126 IN PDRIVER_OBJECT DriverObject
,
127 IN PDEVICE_OBJECT PhysicalDeviceObject
);
130 IntVideoPortDispatchOpen(
131 IN PDEVICE_OBJECT DeviceObject
,
135 IntVideoPortDispatchClose(
136 IN PDEVICE_OBJECT DeviceObject
,
140 IntVideoPortDispatchCleanup(
141 IN PDEVICE_OBJECT DeviceObject
,
145 IntVideoPortDispatchDeviceControl(
146 IN PDEVICE_OBJECT DeviceObject
,
150 IntVideoPortDispatchPnp(
151 IN PDEVICE_OBJECT DeviceObject
,
155 IntVideoPortDispatchPower(
156 IN PDEVICE_OBJECT DeviceObject
,
160 IntVideoPortUnload(PDRIVER_OBJECT DriverObject
);
165 IntVideoPortSetupTimer(
166 IN PDEVICE_OBJECT DeviceObject
,
167 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
);
172 IntVideoPortSetupInterrupt(
173 IN PDEVICE_OBJECT DeviceObject
,
174 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
175 IN PVIDEO_PORT_CONFIG_INFO ConfigInfo
);
180 IntVideoPortMapPhysicalMemory(
182 IN PHYSICAL_ADDRESS PhysicalAddress
,
183 IN ULONG SizeInBytes
,
185 IN OUT PVOID
*VirtualAddress OPTIONAL
);
189 extern ULONG CsrssInitialized
;
190 extern PEPROCESS Csrss
;
193 VideoPortEnumerateChildren(
194 IN PVOID HwDeviceExtension
,
198 VideoPortGetProcAddress(
199 IN PVOID HwDeviceExtension
,
200 IN PUCHAR FunctionName
);
203 IntAttachToCSRSS(PEPROCESS
*CallingProcess
, PEPROCESS
*PrevAttachedProcess
);
206 IntDetachFromCSRSS(PEPROCESS
*CallingProcess
, PEPROCESS
*PrevAttachedProcess
);
209 IntVideoPortCreateAdapterDeviceObject(
210 IN PDRIVER_OBJECT DriverObject
,
211 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
212 IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL
,
213 OUT PDEVICE_OBJECT
*DeviceObject OPTIONAL
);
216 IntVideoPortFindAdapter(
217 IN PDRIVER_OBJECT DriverObject
,
218 IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension
,
219 IN PDEVICE_OBJECT DeviceObject
);
224 IntInt10AllocateBuffer(
228 IN OUT PULONG Length
);
255 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments
);
259 IN PVOID HwDeviceExtension
,
260 IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments
);
262 #endif /* VIDEOPRT_H */