2004-03-06 Filip Navara <xnavara@volny.cz>
[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.2 2004/03/06 01:22:02 navaraf 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 UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */
75 } VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION;
76
77 NTSTATUS STDCALL
78 VidDispatchOpen(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
79
80 NTSTATUS STDCALL
81 VidDispatchClose(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
82
83 NTSTATUS STDCALL
84 VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
85
86 PVOID STDCALL
87 InternalMapMemory(
88 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
89 IN PHYSICAL_ADDRESS IoAddress,
90 IN ULONG NumberOfUchars,
91 IN UCHAR InIoSpace,
92 OUT NTSTATUS *Status);
93
94 VOID STDCALL
95 InternalUnmapMemory(
96 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
97 IN PVOID MappedAddress);
98
99 VP_STATUS STDCALL
100 IntInt10AllocateBuffer(
101 IN PVOID Context,
102 OUT PUSHORT Seg,
103 OUT PUSHORT Off,
104 IN OUT PULONG Length);
105
106 VP_STATUS STDCALL
107 IntInt10FreeBuffer(
108 IN PVOID Context,
109 IN USHORT Seg,
110 IN USHORT Off);
111
112 VP_STATUS STDCALL
113 IntInt10ReadMemory(
114 IN PVOID Context,
115 IN USHORT Seg,
116 IN USHORT Off,
117 OUT PVOID Buffer,
118 IN ULONG Length);
119
120 VP_STATUS STDCALL
121 IntInt10WriteMemory(
122 IN PVOID Context,
123 IN USHORT Seg,
124 IN USHORT Off,
125 IN PVOID Buffer,
126 IN ULONG Length);
127
128 VP_STATUS STDCALL
129 IntInt10CallBios(
130 IN PVOID Context,
131 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments);
132
133 #endif /* VIDEOPRT_H */