3 Copyright (c) 2004 - 2008, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Console based on Posix APIs.
20 This file attaches a SimpleTextIn protocol to a previously open window.
22 The constructor for this protocol depends on an open window. Currently
23 the SimpleTextOut protocol creates a window when it's constructor is called.
24 Thus this code must run after the constructor for the SimpleTextOut
34 #include <Protocol/UnixIo.h>
35 #include <Protocol/SimpleTextIn.h>
36 #include <Protocol/SimpleTextOut.h>
38 #include <Library/DebugLib.h>
39 #include <Library/BaseLib.h>
40 #include <Library/UefiDriverEntryPoint.h>
41 #include <Library/UefiLib.h>
42 #include <Library/BaseMemoryLib.h>
43 #include <Library/MemoryAllocationLib.h>
44 #include <Library/UefiBootServicesTableLib.h>
46 extern EFI_DRIVER_BINDING_PROTOCOL gUnixConsoleDriverBinding
;
47 extern EFI_COMPONENT_NAME_PROTOCOL gUnixConsoleComponentName
;
49 #define UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE \
50 EFI_SIGNATURE_32('U','X','s','c')
57 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut
;
58 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutMode
;
60 EFI_UNIX_IO_PROTOCOL
*UnixIo
;
61 EFI_UNIX_THUNK_PROTOCOL
*UnixThunk
;
64 // SimpleTextOut Private Data including Posix types.
66 // HANDLE NtOutHandle;
69 //COORD MaxScreenSize;
74 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn
;
76 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
78 } UNIX_SIMPLE_TEXT_PRIVATE_DATA
;
80 #define UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS(a) \
81 CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextOut, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
83 #define UNIX_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS(a) \
84 CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextIn, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
87 // Console Globale Variables
89 extern EFI_DRIVER_BINDING_PROTOCOL gUnixConsoleDriverBinding
;
90 extern EFI_COMPONENT_NAME_PROTOCOL gUnixConsoleComponentName
;
95 } UNIX_SIMPLE_TEXT_OUT_MODE
;
99 // Simple Text Out protocol member functions
104 UnixSimpleTextOutReset (
105 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
106 IN BOOLEAN ExtendedVerification
112 TODO: Add function description
116 This - TODO: add argument description
117 ExtendedVerification - TODO: add argument description
121 TODO: add return values
128 UnixSimpleTextOutOutputString (
129 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
136 TODO: Add function description
140 This - TODO: add argument description
141 String - TODO: add argument description
145 TODO: add return values
152 UnixSimpleTextOutTestString (
153 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
160 TODO: Add function description
164 This - TODO: add argument description
165 String - TODO: add argument description
169 TODO: add return values
176 UnixSimpleTextOutQueryMode (
177 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
186 TODO: Add function description
190 This - TODO: add argument description
191 ModeNumber - TODO: add argument description
192 Columns - TODO: add argument description
193 Rows - TODO: add argument description
197 TODO: add return values
204 UnixSimpleTextOutSetMode (
205 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
212 TODO: Add function description
216 This - TODO: add argument description
217 ModeNumber - TODO: add argument description
221 TODO: add return values
228 UnixSimpleTextOutSetAttribute (
229 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
236 TODO: Add function description
240 This - TODO: add argument description
241 Attribute - TODO: add argument description
245 TODO: add return values
252 UnixSimpleTextOutClearScreen (
253 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
259 TODO: Add function description
263 This - TODO: add argument description
267 TODO: add return values
274 UnixSimpleTextOutSetCursorPosition (
275 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
283 TODO: Add function description
287 This - TODO: add argument description
288 Column - TODO: add argument description
289 Row - TODO: add argument description
293 TODO: add return values
300 UnixSimpleTextOutEnableCursor (
301 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
308 TODO: Add function description
312 This - TODO: add argument description
313 Enable - TODO: add argument description
317 TODO: add return values
324 // Simple Text Out constructor and destructor.
327 UnixSimpleTextOutOpenWindow (
328 IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA
*Private
334 TODO: Add function description
338 Private - TODO: add argument description
342 TODO: add return values
348 UnixSimpleTextOutCloseWindow (
349 IN OUT UNIX_SIMPLE_TEXT_PRIVATE_DATA
*Console
355 TODO: Add function description
359 Console - TODO: add argument description
363 TODO: add return values
370 // Simple Text In protocol member functions.
374 UnixSimpleTextInReset (
375 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
376 IN BOOLEAN ExtendedVerification
382 TODO: Add function description
386 This - TODO: add argument description
387 ExtendedVerification - TODO: add argument description
391 TODO: add return values
398 UnixSimpleTextInReadKeyStroke (
399 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
400 OUT EFI_INPUT_KEY
*Key
406 TODO: Add function description
410 This - TODO: add argument description
411 Key - TODO: add argument description
415 TODO: add return values
422 UnixSimpleTextInWaitForKey (
430 TODO: Add function description
434 Event - TODO: add argument description
435 Context - TODO: add argument description
439 TODO: add return values
446 // Simple Text In constructor
449 UnixSimpleTextInAttachToWindow (
450 IN UNIX_SIMPLE_TEXT_PRIVATE_DATA
*Private
456 TODO: Add function description
460 Private - TODO: add argument description
464 TODO: add return values
474 InitializeUnixConsole (
475 IN EFI_HANDLE ImageHandle
,
476 IN EFI_SYSTEM_TABLE
*SystemTable
482 TODO: Add function description
486 ImageHandle - TODO: add argument description
487 SystemTable - TODO: add argument description
491 TODO: add return values
497 AppendDevicePathInstanceToVar (
498 IN CHAR16
*VariableName
,
499 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePathInstance
505 TODO: Add function description
509 VariableName - TODO: add argument description
510 DevicePathInstance - TODO: add argument description
514 TODO: add return values