3 Copyright (c) 2006 - 2008, 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
{
58 EFI_HANDLE NotifyHandle
;
60 EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn
;
62 LIST_ENTRY NotifyEntry
;
63 } UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY
;
65 #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
68 UINT32 HorizontalResolution
;
69 UINT32 VerticalResolution
;
76 extern EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding
;
77 extern EFI_COMPONENT_NAME_PROTOCOL gUnixGopComponentName
;
79 #define UNIX_UGA_CLASS_NAME L"UnixGopWindow"
81 #define GOP_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('G', 'o', 'p', 'N')
86 EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput
;
87 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn
;
88 EFI_SIMPLE_POINTER_PROTOCOL SimplePointer
;
90 EFI_UNIX_THUNK_PROTOCOL
*UnixThunk
;
91 EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
;
93 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
95 EFI_SIMPLE_POINTER_MODE PointerMode
;
97 // GOP Private Data for QueryMode ()
99 GOP_MODE_DATA
*ModeData
;
103 // UGA Private Data knowing when to start hardware
105 BOOLEAN HardwareNeedsStarting
;
109 GOP_QUEUE_FIXED Queue
;
111 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInEx
;
112 EFI_KEY_STATE KeyState
;
113 LIST_ENTRY NotifyList
;
119 #define GOP_PRIVATE_DATA_FROM_THIS(a) \
120 CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)
122 #define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a) \
123 CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)
125 #define GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS(a) \
126 CR(a, GOP_PRIVATE_DATA, SimpleTextInEx, GOP_PRIVATE_DATA_SIGNATURE)
128 #define GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS(a) \
129 CR(a, GOP_PRIVATE_DATA, SimplePointer, GOP_PRIVATE_DATA_SIGNATURE)
133 // Global Protocol Variables
135 extern EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding
;
136 extern EFI_COMPONENT_NAME_PROTOCOL gUnixGopComponentName
;
137 extern EFI_COMPONENT_NAME2_PROTOCOL gUnixGopComponentName2
;
140 // Gop Hardware abstraction internal worker functions
144 IN EFI_UNIX_IO_PROTOCOL
*UnixIo
150 TODO: Add function description
154 UnixIo - TODO: add argument description
158 TODO: add return values
165 IN GOP_PRIVATE_DATA
*Private
171 TODO: Add function description
175 Private - TODO: add argument description
179 TODO: add return values
186 IN GOP_PRIVATE_DATA
*Private
192 TODO: Add function description
196 Private - TODO: add argument description
200 TODO: add return values
206 // EFI 1.1 driver model prototypes for Win UNIX UGA
212 IN EFI_HANDLE ImageHandle
,
213 IN EFI_SYSTEM_TABLE
*SystemTable
219 TODO: Add function description
223 ImageHandle - TODO: add argument description
224 SystemTable - TODO: add argument description
228 TODO: add return values
235 UnixGopDriverBindingSupported (
236 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
237 IN EFI_HANDLE Handle
,
238 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
244 TODO: Add function description
248 This - TODO: add argument description
249 Handle - TODO: add argument description
250 RemainingDevicePath - TODO: add argument description
254 TODO: add return values
261 UnixGopDriverBindingStart (
262 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
263 IN EFI_HANDLE Handle
,
264 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
270 TODO: Add function description
274 This - TODO: add argument description
275 Handle - TODO: add argument description
276 RemainingDevicePath - TODO: add argument description
280 TODO: add return values
287 UnixGopDriverBindingStop (
288 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
289 IN EFI_HANDLE Handle
,
290 IN UINTN NumberOfChildren
,
291 IN EFI_HANDLE
*ChildHandleBuffer
297 TODO: Add function description
301 This - TODO: add argument description
302 Handle - TODO: add argument description
303 NumberOfChildren - TODO: add argument description
304 ChildHandleBuffer - TODO: add argument description
308 TODO: add return values
315 IN GOP_PRIVATE_DATA
*Private
,
322 TODO: Add function description
326 Private - TODO: add argument description
327 Key - TODO: add argument description
331 TODO: add return values
337 UnixGopInitializeSimpleTextInForWindow (
338 IN GOP_PRIVATE_DATA
*Private
344 TODO: Add function description
348 Private - TODO: add argument description
352 TODO: add return values
358 UnixGopInitializeSimplePointerForWindow (
359 IN GOP_PRIVATE_DATA
*Private
365 TODO: Add function description
369 Private - TODO: add argument description
373 TODO: add return values