]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/UnixGopDxe/UnixGop.h
Change the type of NotifyHandle from EFI_HANDLE to VOID * for SimpleTextInEx protocol.
[mirror_edk2.git] / UnixPkg / UnixGopDxe / UnixGop.h
1 /*++
2
3 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
4 Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name:
14
15 UnixGop.h
16
17 Abstract:
18
19 Private data for the Gop driver that is bound to the Unix Thunk protocol
20
21 --*/
22
23 #ifndef _UNIX_UGA_H_
24 #define _UNIX_UGA_H_
25
26 #include <PiDxe.h>
27 #include "UnixDxe.h"
28 #include <Library/DebugLib.h>
29 #include <Library/BaseLib.h>
30 #include <Library/UefiDriverEntryPoint.h>
31 #include <Library/UefiLib.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/UefiBootServicesTableLib.h>
35
36 #include <Protocol/GraphicsOutput.h>
37 #include <Protocol/SimpleTextIn.h>
38 #include <Protocol/SimpleTextInEx.h>
39 #include <Protocol/SimplePointer.h>
40 #include "Protocol/UnixUgaIo.h"
41
42 #include <Guid/EventGroup.h>
43
44
45
46 #define MAX_Q 256
47
48 typedef struct {
49 UINTN Front;
50 UINTN Rear;
51 UINTN Count;
52 EFI_INPUT_KEY Q[MAX_Q];
53 } GOP_QUEUE_FIXED;
54
55 #define UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('U', 'g', 'S', 'n')
56 typedef struct _UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY {
57 UINTN Signature;
58 EFI_KEY_DATA KeyData;
59 EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;
60 EFI_EVENT Event;
61 LIST_ENTRY NotifyEntry;
62 } UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY;
63
64 #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
65
66 typedef struct {
67 UINT32 HorizontalResolution;
68 UINT32 VerticalResolution;
69 UINT32 ColorDepth;
70 UINT32 RefreshRate;
71 } GOP_MODE_DATA;
72
73
74
75 extern EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding;
76 extern EFI_COMPONENT_NAME_PROTOCOL gUnixGopComponentName;
77
78 #define UNIX_UGA_CLASS_NAME L"UnixGopWindow"
79
80 #define GOP_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('G', 'o', 'p', 'N')
81 typedef struct {
82 UINT64 Signature;
83
84 EFI_HANDLE Handle;
85 EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
86 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;
87 EFI_SIMPLE_POINTER_PROTOCOL SimplePointer;
88
89 EFI_UNIX_THUNK_PROTOCOL *UnixThunk;
90 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo;
91
92 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
93
94 EFI_SIMPLE_POINTER_MODE PointerMode;
95 //
96 // GOP Private Data for QueryMode ()
97 //
98 GOP_MODE_DATA *ModeData;
99
100
101 //
102 // UGA Private Data knowing when to start hardware
103 //
104 BOOLEAN HardwareNeedsStarting;
105
106 CHAR16 *WindowName;
107
108 GOP_QUEUE_FIXED Queue;
109
110 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInEx;
111 EFI_KEY_STATE KeyState;
112 LIST_ENTRY NotifyList;
113
114
115 } GOP_PRIVATE_DATA;
116
117
118 #define GOP_PRIVATE_DATA_FROM_THIS(a) \
119 CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)
120
121 #define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a) \
122 CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)
123
124 #define GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS(a) \
125 CR(a, GOP_PRIVATE_DATA, SimpleTextInEx, GOP_PRIVATE_DATA_SIGNATURE)
126
127 #define GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS(a) \
128 CR(a, GOP_PRIVATE_DATA, SimplePointer, GOP_PRIVATE_DATA_SIGNATURE)
129
130
131 //
132 // Global Protocol Variables
133 //
134 extern EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding;
135 extern EFI_COMPONENT_NAME_PROTOCOL gUnixGopComponentName;
136 extern EFI_COMPONENT_NAME2_PROTOCOL gUnixGopComponentName2;
137
138 //
139 // Gop Hardware abstraction internal worker functions
140 //
141 EFI_STATUS
142 UnixGopSupported (
143 IN EFI_UNIX_IO_PROTOCOL *UnixIo
144 )
145 /*++
146
147 Routine Description:
148
149 TODO: Add function description
150
151 Arguments:
152
153 UnixIo - TODO: add argument description
154
155 Returns:
156
157 TODO: add return values
158
159 --*/
160 ;
161
162 EFI_STATUS
163 UnixGopConstructor (
164 IN GOP_PRIVATE_DATA *Private
165 )
166 /*++
167
168 Routine Description:
169
170 TODO: Add function description
171
172 Arguments:
173
174 Private - TODO: add argument description
175
176 Returns:
177
178 TODO: add return values
179
180 --*/
181 ;
182
183 EFI_STATUS
184 UnixGopDestructor (
185 IN GOP_PRIVATE_DATA *Private
186 )
187 /*++
188
189 Routine Description:
190
191 TODO: Add function description
192
193 Arguments:
194
195 Private - TODO: add argument description
196
197 Returns:
198
199 TODO: add return values
200
201 --*/
202 ;
203
204 //
205 // EFI 1.1 driver model prototypes for Win UNIX UGA
206 //
207
208 EFI_STATUS
209 EFIAPI
210 UnixGopInitialize (
211 IN EFI_HANDLE ImageHandle,
212 IN EFI_SYSTEM_TABLE *SystemTable
213 )
214 /*++
215
216 Routine Description:
217
218 TODO: Add function description
219
220 Arguments:
221
222 ImageHandle - TODO: add argument description
223 SystemTable - TODO: add argument description
224
225 Returns:
226
227 TODO: add return values
228
229 --*/
230 ;
231
232 EFI_STATUS
233 EFIAPI
234 UnixGopDriverBindingSupported (
235 IN EFI_DRIVER_BINDING_PROTOCOL *This,
236 IN EFI_HANDLE Handle,
237 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
238 )
239 /*++
240
241 Routine Description:
242
243 TODO: Add function description
244
245 Arguments:
246
247 This - TODO: add argument description
248 Handle - TODO: add argument description
249 RemainingDevicePath - TODO: add argument description
250
251 Returns:
252
253 TODO: add return values
254
255 --*/
256 ;
257
258 EFI_STATUS
259 EFIAPI
260 UnixGopDriverBindingStart (
261 IN EFI_DRIVER_BINDING_PROTOCOL *This,
262 IN EFI_HANDLE Handle,
263 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
264 )
265 /*++
266
267 Routine Description:
268
269 TODO: Add function description
270
271 Arguments:
272
273 This - TODO: add argument description
274 Handle - TODO: add argument description
275 RemainingDevicePath - TODO: add argument description
276
277 Returns:
278
279 TODO: add return values
280
281 --*/
282 ;
283
284 EFI_STATUS
285 EFIAPI
286 UnixGopDriverBindingStop (
287 IN EFI_DRIVER_BINDING_PROTOCOL *This,
288 IN EFI_HANDLE Handle,
289 IN UINTN NumberOfChildren,
290 IN EFI_HANDLE *ChildHandleBuffer
291 )
292 /*++
293
294 Routine Description:
295
296 TODO: Add function description
297
298 Arguments:
299
300 This - TODO: add argument description
301 Handle - TODO: add argument description
302 NumberOfChildren - TODO: add argument description
303 ChildHandleBuffer - TODO: add argument description
304
305 Returns:
306
307 TODO: add return values
308
309 --*/
310 ;
311
312 EFI_STATUS
313 GopPrivateAddQ (
314 IN GOP_PRIVATE_DATA *Private,
315 IN EFI_INPUT_KEY Key
316 )
317 /*++
318
319 Routine Description:
320
321 TODO: Add function description
322
323 Arguments:
324
325 Private - TODO: add argument description
326 Key - TODO: add argument description
327
328 Returns:
329
330 TODO: add return values
331
332 --*/
333 ;
334
335 EFI_STATUS
336 UnixGopInitializeSimpleTextInForWindow (
337 IN GOP_PRIVATE_DATA *Private
338 )
339 /*++
340
341 Routine Description:
342
343 TODO: Add function description
344
345 Arguments:
346
347 Private - TODO: add argument description
348
349 Returns:
350
351 TODO: add return values
352
353 --*/
354 ;
355
356 EFI_STATUS
357 UnixGopInitializeSimplePointerForWindow (
358 IN GOP_PRIVATE_DATA *Private
359 )
360 /*++
361
362 Routine Description:
363
364 TODO: Add function description
365
366 Arguments:
367
368 Private - TODO: add argument description
369
370 Returns:
371
372 TODO: add return values
373
374 --*/
375 ;
376 #endif