]> git.proxmox.com Git - mirror_edk2.git/blame - StdLibPrivateInternalFiles/Include/Efi/Console.h
Standard Libraries for EDK II.
[mirror_edk2.git] / StdLibPrivateInternalFiles / Include / Efi / Console.h
CommitLineData
2aa62f2b 1/** @file\r
2 Declarations and macros for the console abstraction.\r
3\r
4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials are licensed and made available under\r
6 the terms and conditions of the BSD License that accompanies this distribution.\r
7 The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14#ifndef _LIBRARY_UEFI_CONSOLE_H\r
15#define _LIBRARY_UEFI_CONSOLE_H\r
16#include <Protocol/SimpleTextOut.h>\r
17#include <Protocol/SimpleFileSystem.h>\r
18\r
19/* The number of "special" character stream devices.\r
20 These include:\r
21 stdin, stdout, stderr\r
22*/\r
23#define NUM_SPECIAL 3\r
24\r
25typedef struct {\r
26 UINT32 Column;\r
27 UINT32 Row;\r
28} CursorXY;\r
29\r
30typedef union {\r
31 UINT64 Offset;\r
32 CursorXY XYpos;\r
33} XYoffset;\r
34\r
35/**\r
36 In support of the "everything is a file" paradigm of the Standard C Library,\r
37 the UEFI Console support is abstracted as an instance of EFI_FILE_PROTOCOL.\r
38 The member functions of the protocol translate as:\r
39 Open Associates a stream with one of the pseudo-devices: stdin,\r
40 stdout, or stderr; as defined by the UEFI System Table.\r
41 Close The stream is marked closed and released for use by a\r
42 subsequent Open().\r
43 Delete Returns RETURN_UNSUPPORTED. Does Nothing.\r
44 Read Blocks reading BufferSize characters using the\r
45 EFI_SIMPLE_TEXT_INPUT_PROTOCOL::ReadKeyStroke() function.\r
46 Write Sends BufferSize characters to the console for display. The\r
47 output is examined for new line characters, '\n', which are then\r
48 translated into a Return + New Line, '\r' '\n', sequence.\r
49 GetPosition Returns the number of characters input or output to this\r
50 stream. Return, '\r', characters inserted due to line ending\r
51 translation are not counted.\r
52 SetPosition Only valid for Stdout or Stderr. Offset is interpreted as a\r
53 CursorXY structure and is used to position the console cursor\r
54 using the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::SetCursorPosition()\r
55 call.\r
56 GetInfo Populates an EFI_FILE_INFO Buffer with no useful information.\r
57 SetInfo Returns RETURN_UNSUPPORTED. Does Nothing.\r
58 Flush Returns RETURN_SUCCESS. Does Nothing.\r
59\r
60**/\r
61typedef struct {\r
62 UINT32 Cookie;\r
63 UINT32 ConOutMode; // Only valid for stdout & stderr\r
64 UINT64 NumRead;\r
65 UINT64 NumWritten;\r
66 XYoffset MaxConXY; // Only valid for stdout & stderr\r
67 EFI_HANDLE Dev; // Could be either Input or Output\r
68 EFI_FILE_PROTOCOL Abstraction;\r
69} ConInstance;\r
70\r
71EFI_STATUS\r
72EFIAPI\r
73ConOpen(\r
74 IN EFI_FILE_PROTOCOL *This,\r
75 OUT EFI_FILE_PROTOCOL **NewHandle,\r
76 IN CHAR16 *FileName,\r
77 IN UINT64 OpenMode,\r
78 IN UINT64 Attributes\r
79);\r
80\r
81#endif /* _LIBRARY_UEFI_CONSOLE_H */\r