2 Declarations and macros for the console abstraction.
4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 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.
14 #ifndef _LIBRARY_UEFI_CONSOLE_H
15 #define _LIBRARY_UEFI_CONSOLE_H
16 #include <Protocol/SimpleTextOut.h>
17 #include <Protocol/SimpleFileSystem.h>
19 /* The number of "special" character stream devices.
36 In support of the "everything is a file" paradigm of the Standard C Library,
37 the UEFI Console support is abstracted as an instance of EFI_FILE_PROTOCOL.
38 The member functions of the protocol translate as:
39 Open Associates a stream with one of the pseudo-devices: stdin,
40 stdout, or stderr; as defined by the UEFI System Table.
41 Close The stream is marked closed and released for use by a
43 Delete Returns RETURN_UNSUPPORTED. Does Nothing.
44 Read Blocks reading BufferSize characters using the
45 EFI_SIMPLE_TEXT_INPUT_PROTOCOL::ReadKeyStroke() function.
46 Write Sends BufferSize characters to the console for display. The
47 output is examined for new line characters, '\n', which are then
48 translated into a Return + New Line, '\r' '\n', sequence.
49 GetPosition Returns the number of characters input or output to this
50 stream. Return, '\r', characters inserted due to line ending
51 translation are not counted.
52 SetPosition Only valid for Stdout or Stderr. Offset is interpreted as a
53 CursorXY structure and is used to position the console cursor
54 using the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::SetCursorPosition()
56 GetInfo Populates an EFI_FILE_INFO Buffer with no useful information.
57 SetInfo Returns RETURN_UNSUPPORTED. Does Nothing.
58 Flush Returns RETURN_SUCCESS. Does Nothing.
63 UINT32 ConOutMode
; // Only valid for stdout & stderr
66 XYoffset MaxConXY
; // Only valid for stdout & stderr
67 EFI_HANDLE Dev
; // Could be either Input or Output
68 EFI_FILE_PROTOCOL Abstraction
;
74 IN EFI_FILE_PROTOCOL
*This
,
75 OUT EFI_FILE_PROTOCOL
**NewHandle
,
81 #endif /* _LIBRARY_UEFI_CONSOLE_H */