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