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
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.
19 Private data for the Gop driver that is bound to the Unix Thunk protocol
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>
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"
42 #include <Guid/EventGroup.h>
52 EFI_INPUT_KEY Q
[MAX_Q
];
55 #define UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('U', 'g', 'S', 'n')
56 typedef struct _UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY
{
59 EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn
;
61 LIST_ENTRY NotifyEntry
;
62 } UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY
;
64 #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
67 UINT32 HorizontalResolution
;
68 UINT32 VerticalResolution
;
75 extern EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding
;
76 extern EFI_COMPONENT_NAME_PROTOCOL gUnixGopComponentName
;
78 #define UNIX_UGA_CLASS_NAME L"UnixGopWindow"
80 #define GOP_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('G', 'o', 'p', 'N')
85 EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput
;
86 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn
;
87 EFI_SIMPLE_POINTER_PROTOCOL SimplePointer
;
89 EFI_UNIX_THUNK_PROTOCOL
*UnixThunk
;
90 EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
;
92 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
94 EFI_SIMPLE_POINTER_MODE PointerMode
;
96 // GOP Private Data for QueryMode ()
98 GOP_MODE_DATA
*ModeData
;
102 // UGA Private Data knowing when to start hardware
104 BOOLEAN HardwareNeedsStarting
;
108 GOP_QUEUE_FIXED Queue
;
110 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInEx
;
111 EFI_KEY_STATE KeyState
;
112 LIST_ENTRY NotifyList
;
118 #define GOP_PRIVATE_DATA_FROM_THIS(a) \
119 CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)
121 #define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a) \
122 CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)
124 #define GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS(a) \
125 CR(a, GOP_PRIVATE_DATA, SimpleTextInEx, GOP_PRIVATE_DATA_SIGNATURE)
127 #define GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS(a) \
128 CR(a, GOP_PRIVATE_DATA, SimplePointer, GOP_PRIVATE_DATA_SIGNATURE)
132 // Global Protocol Variables
134 extern EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding
;
135 extern EFI_COMPONENT_NAME_PROTOCOL gUnixGopComponentName
;
136 extern EFI_COMPONENT_NAME2_PROTOCOL gUnixGopComponentName2
;
139 // Gop Hardware abstraction internal worker functions
143 IN EFI_UNIX_IO_PROTOCOL
*UnixIo
149 TODO: Add function description
153 UnixIo - TODO: add argument description
157 TODO: add return values
164 IN GOP_PRIVATE_DATA
*Private
170 TODO: Add function description
174 Private - TODO: add argument description
178 TODO: add return values
185 IN GOP_PRIVATE_DATA
*Private
191 TODO: Add function description
195 Private - TODO: add argument description
199 TODO: add return values
205 // EFI 1.1 driver model prototypes for Win UNIX UGA
211 IN EFI_HANDLE ImageHandle
,
212 IN EFI_SYSTEM_TABLE
*SystemTable
218 TODO: Add function description
222 ImageHandle - TODO: add argument description
223 SystemTable - TODO: add argument description
227 TODO: add return values
234 UnixGopDriverBindingSupported (
235 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
236 IN EFI_HANDLE Handle
,
237 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
243 TODO: Add function description
247 This - TODO: add argument description
248 Handle - TODO: add argument description
249 RemainingDevicePath - TODO: add argument description
253 TODO: add return values
260 UnixGopDriverBindingStart (
261 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
262 IN EFI_HANDLE Handle
,
263 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
269 TODO: Add function description
273 This - TODO: add argument description
274 Handle - TODO: add argument description
275 RemainingDevicePath - TODO: add argument description
279 TODO: add return values
286 UnixGopDriverBindingStop (
287 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
288 IN EFI_HANDLE Handle
,
289 IN UINTN NumberOfChildren
,
290 IN EFI_HANDLE
*ChildHandleBuffer
296 TODO: Add function description
300 This - TODO: add argument description
301 Handle - TODO: add argument description
302 NumberOfChildren - TODO: add argument description
303 ChildHandleBuffer - TODO: add argument description
307 TODO: add return values
314 IN GOP_PRIVATE_DATA
*Private
,
321 TODO: Add function description
325 Private - TODO: add argument description
326 Key - TODO: add argument description
330 TODO: add return values
336 UnixGopInitializeSimpleTextInForWindow (
337 IN GOP_PRIVATE_DATA
*Private
343 TODO: Add function description
347 Private - TODO: add argument description
351 TODO: add return values
357 UnixGopInitializeSimplePointerForWindow (
358 IN GOP_PRIVATE_DATA
*Private
364 TODO: Add function description
368 Private - TODO: add argument description
372 TODO: add return values