Add WinNtSerialIoDxe driver into Nt32Pkg
[mirror_edk2.git] / Nt32Pkg / WinNtGopDxe / WinNtGop.h
CommitLineData
c9fc89a3 1/** @file\r
2\r
3Copyright (c) 2006, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 WinNtGop.h\r
15\r
16Abstract:\r
17\r
18 Private data for the Gop driver that is bound to the WinNt Thunk protocol\r
19\r
20\r
21**/\r
22\r
23#ifndef _WIN_NT_GOP_H_\r
24#define _WIN_NT_GOP_H_\r
25\r
c9fc89a3 26//@MT:#include "EfiWinNT.h"\r
27//@MT:#include "Tiano.h"\r
28//@MT:#include "EfiDriverLib.h"\r
29\r
30//\r
31// Driver Consumed Protocols\r
32//\r
33//@MT:#include EFI_PROTOCOL_DEFINITION (DevicePath)\r
34//@MT:#include EFI_PROTOCOL_DEFINITION (WinNtIo)\r
35\r
36//\r
37// Driver Produced Protocols\r
38//\r
39//@MT:#include EFI_PROTOCOL_DEFINITION (DriverBinding)\r
40//@MT:#include EFI_PROTOCOL_DEFINITION (ComponentName)\r
41//@MT:#include EFI_PROTOCOL_DEFINITION (GraphicsOutput)\r
42//@MT:#include "LinkedList.h"\r
43\r
44#define MAX_Q 256\r
45\r
46typedef struct {\r
47 UINTN Front;\r
48 UINTN Rear;\r
49 UINTN Count;\r
50 EFI_INPUT_KEY Q[MAX_Q];\r
51} GOP_QUEUE_FIXED;\r
52\r
53#define WIN_NT_GOP_CLASS_NAME L"WinNtGopWindow"\r
54\r
55#define GOP_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('S', 'g', 'o', 'N')\r
56\r
57#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff\r
58\r
59typedef struct {\r
60 UINT32 HorizontalResolution;\r
61 UINT32 VerticalResolution;\r
62 UINT32 ColorDepth;\r
63 UINT32 RefreshRate;\r
64} GOP_MODE_DATA;\r
65\r
66typedef struct {\r
67 UINT64 Signature;\r
68\r
69 EFI_HANDLE Handle;\r
70 EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;\r
71 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;\r
72\r
73 EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;\r
74\r
75 EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
76\r
77 //\r
78 // GOP Private Data for QueryMode ()\r
79 //\r
80 GOP_MODE_DATA *ModeData;\r
81\r
82 //\r
83 // GOP Private Data knowing when to start hardware\r
84 //\r
85 BOOLEAN HardwareNeedsStarting;\r
86\r
87 CHAR16 *WindowName;\r
88 CHAR16 Buffer[160];\r
89\r
90 HANDLE ThreadInited; // Semaphore\r
91 HANDLE ThreadHandle; // Thread\r
92 DWORD ThreadId;\r
93\r
94 HWND WindowHandle;\r
95 WNDCLASSEX WindowsClass;\r
96\r
97 //\r
98 // This screen is used to redraw the scree when windows events happen. It's\r
99 // updated in the main thread and displayed in the windows thread.\r
100 //\r
101 BITMAPV4HEADER *VirtualScreenInfo;\r
102 RGBQUAD *VirtualScreen;\r
103\r
104 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FillLine;\r
105\r
106 //\r
107 // Keyboard Queue used by Simple Text In. WinProc thread adds, and main\r
108 // thread removes.\r
109 //\r
110 CRITICAL_SECTION QCriticalSection;\r
111 GOP_QUEUE_FIXED Queue;\r
112\r
113} GOP_PRIVATE_DATA;\r
114\r
115#define GOP_PRIVATE_DATA_FROM_THIS(a) \\r
116 CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)\r
117\r
118#define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a) \\r
119 CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)\r
120\r
121//\r
122// Global Protocol Variables\r
123//\r
124extern EFI_DRIVER_BINDING_PROTOCOL gWinNtGopDriverBinding;\r
125extern EFI_COMPONENT_NAME_PROTOCOL gWinNtGopComponentName;\r
126\r
127//\r
128// Gop Hardware abstraction internal worker functions\r
129//\r
130\r
131/**\r
132 TODO: Add function description\r
133\r
134 @param WinNtIo TODO: add argument description\r
135\r
136 @return TODO: add return values\r
137\r
138**/\r
139EFI_STATUS\r
140WinNtGopSupported (\r
141 IN EFI_WIN_NT_IO_PROTOCOL *WinNtIo\r
142 )\r
143;\r
144\r
145\r
146/**\r
147 TODO: Add function description\r
148\r
149 @param Private TODO: add argument description\r
150\r
151 @return TODO: add return values\r
152\r
153**/\r
154EFI_STATUS\r
155WinNtGopConstructor (\r
156 IN GOP_PRIVATE_DATA *Private\r
157 )\r
158;\r
159\r
160\r
161/**\r
162 TODO: Add function description\r
163\r
164 @param Private TODO: add argument description\r
165\r
166 @return TODO: add return values\r
167\r
168**/\r
169EFI_STATUS\r
170WinNtGopDestructor (\r
171 IN GOP_PRIVATE_DATA *Private\r
172 )\r
173;\r
174\r
175//\r
176// EFI 1.1 driver model prototypes for Win NT GOP\r
177//\r
178\r
179\r
180/**\r
181 TODO: Add function description\r
182\r
183 @param ImageHandle TODO: add argument description\r
184 @param SystemTable TODO: add argument description\r
185\r
186 @return TODO: add return values\r
187\r
188**/\r
189EFI_STATUS\r
190EFIAPI\r
191WinNtGopInitialize (\r
192 IN EFI_HANDLE ImageHandle,\r
193 IN EFI_SYSTEM_TABLE *SystemTable\r
194 )\r
195;\r
196\r
197\r
198/**\r
199 TODO: Add function description\r
200\r
201 @param This TODO: add argument description\r
202 @param Handle TODO: add argument description\r
203 @param RemainingDevicePath TODO: add argument description\r
204\r
205 @return TODO: add return values\r
206\r
207**/\r
208EFI_STATUS\r
209EFIAPI\r
210WinNtGopDriverBindingSupported (\r
211 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
212 IN EFI_HANDLE Handle,\r
213 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
214 )\r
215;\r
216\r
217\r
218/**\r
219 TODO: Add function description\r
220\r
221 @param This TODO: add argument description\r
222 @param Handle TODO: add argument description\r
223 @param RemainingDevicePath TODO: add argument description\r
224\r
225 @return TODO: add return values\r
226\r
227**/\r
228EFI_STATUS\r
229EFIAPI\r
230WinNtGopDriverBindingStart (\r
231 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
232 IN EFI_HANDLE Handle,\r
233 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
234 )\r
235;\r
236\r
237\r
238/**\r
239 TODO: Add function description\r
240\r
241 @param This TODO: add argument description\r
242 @param Handle TODO: add argument description\r
243 @param NumberOfChildren TODO: add argument description\r
244 @param ChildHandleBuffer TODO: add argument description\r
245\r
246 @return TODO: add return values\r
247\r
248**/\r
249EFI_STATUS\r
250EFIAPI\r
251WinNtGopDriverBindingStop (\r
252 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
253 IN EFI_HANDLE Handle,\r
254 IN UINTN NumberOfChildren,\r
255 IN EFI_HANDLE *ChildHandleBuffer\r
256 )\r
257;\r
258\r
259\r
260/**\r
261 TODO: Add function description\r
262\r
263 @param Private TODO: add argument description\r
264 @param Key TODO: add argument description\r
265\r
266 @return TODO: add return values\r
267\r
268**/\r
269EFI_STATUS\r
270GopPrivateAddQ (\r
271 IN GOP_PRIVATE_DATA *Private,\r
272 IN EFI_INPUT_KEY Key\r
273 )\r
274;\r
275\r
276\r
277/**\r
278 TODO: Add function description\r
279\r
280 @param Private TODO: add argument description\r
281\r
282 @return TODO: add return values\r
283\r
284**/\r
285EFI_STATUS\r
286WinNtGopInitializeSimpleTextInForWindow (\r
287 IN GOP_PRIVATE_DATA *Private\r
288 )\r
289;\r
290\r
291\r
292/**\r
293 TODO: Add function description\r
294\r
295 @param Private TODO: add argument description\r
296\r
297 @return TODO: add return values\r
298\r
299**/\r
300EFI_STATUS\r
301WinNtGopDestroySimpleTextInForWindow (\r
302 IN GOP_PRIVATE_DATA *Private\r
303 )\r
304;\r
305\r
306\r
307/**\r
308 TODO: Add function description\r
309\r
310 @param String TODO: add argument description\r
311\r
312 @return TODO: add return values\r
313\r
314**/\r
315UINTN\r
316Atoi (\r
317 IN CHAR16 *String\r
318 )\r
319;\r
320\r
321#endif\r