TianoCore EDK2 master
Loading...
Searching...
No Matches
ConsoleWrappers.c File Reference
#include "Shell.h"

Go to the source code of this file.

Data Structures

struct  SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL
 
struct  SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
 

Functions

VOID EFIAPI ConInWaitForKey (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI FileBasedSimpleTextInReset (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS EFIAPI FileBasedSimpleTextInReadKeyStroke (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN OUT EFI_INPUT_KEY *Key)
 
EFI_SIMPLE_TEXT_INPUT_PROTOCOLCreateSimpleTextInOnFile (IN SHELL_FILE_HANDLE FileHandleToUse, IN EFI_HANDLE *HandleLocation)
 
EFI_STATUS CloseSimpleTextInOnFile (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleTextIn)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutReset (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutTestString (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *WString)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutQueryMode (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutSetMode (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutSetAttribute (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Attribute)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutClearScreen (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutSetCursorPosition (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Column, IN UINTN Row)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutEnableCursor (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN Visible)
 
EFI_STATUS EFIAPI FileBasedSimpleTextOutOutputString (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *WString)
 
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOLCreateSimpleTextOutOnFile (IN SHELL_FILE_HANDLE FileHandleToUse, IN EFI_HANDLE *HandleLocation, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *OriginalProtocol)
 
EFI_STATUS CloseSimpleTextOutOnFile (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut)
 

Variables

BOOLEAN AsciiRedirection
 

Detailed Description

Function definitions for shell simple text in and out on top of file handles.

(C) Copyright 2013 Hewlett-Packard Development Company, L.P.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ConsoleWrappers.c.

Function Documentation

◆ CloseSimpleTextInOnFile()

EFI_STATUS CloseSimpleTextInOnFile ( IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn)

Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file.

Parameters
[in]SimpleTextInThe pointer to the SimpleTextIn to close.
Return values
EFI_SUCCESSThe object was closed.

Definition at line 202 of file ConsoleWrappers.c.

◆ CloseSimpleTextOutOnFile()

EFI_STATUS CloseSimpleTextOutOnFile ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut)

Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting output from a file.

Parameters
[in]SimpleTextOutThe pointer to the SimpleTextOUT to close.
Return values
EFI_SUCCESSThe object was closed.

Definition at line 506 of file ConsoleWrappers.c.

◆ ConInWaitForKey()

VOID EFIAPI ConInWaitForKey ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event Signal the event if there is key available

Parameters
EventIndicates the event that invoke this function.
ContextIndicates the calling context.

Definition at line 38 of file ConsoleWrappers.c.

◆ CreateSimpleTextInOnFile()

EFI_SIMPLE_TEXT_INPUT_PROTOCOL * CreateSimpleTextInOnFile ( IN SHELL_FILE_HANDLE  FileHandleToUse,
IN EFI_HANDLE HandleLocation 
)

Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting input from a file.

Parameters
[in]FileHandleToUseThe pointer to the SHELL_FILE_HANDLE to use.
[in]HandleLocationThe pointer of a location to copy handle with protocol to.
Return values
NULLThere was insufficient memory available.
Returns
A pointer to the allocated protocol structure;
Todo:
possibly also install SimpleTextInputEx on the handle at this point.

Definition at line 134 of file ConsoleWrappers.c.

◆ CreateSimpleTextOutOnFile()

EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * CreateSimpleTextOutOnFile ( IN SHELL_FILE_HANDLE  FileHandleToUse,
IN EFI_HANDLE HandleLocation,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL OriginalProtocol 
)

Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a SHELL_FILE_HANDLE to support redirecting output from a file.

Parameters
[in]FileHandleToUseThe pointer to the SHELL_FILE_HANDLE to use.
[in]HandleLocationThe pointer of a location to copy handle with protocol to.
[in]OriginalProtocolThe pointer to the original output protocol for pass thru of functions.
Return values
NULLThere was insufficient memory available.
Returns
A pointer to the allocated protocol structure;

Definition at line 439 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextInReadKeyStroke()

EFI_STATUS EFIAPI FileBasedSimpleTextInReadKeyStroke ( IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL This,
IN OUT EFI_INPUT_KEY Key 
)

ReadKeyStroke function for the fake simple text input.

Parameters
[in]ThisA pointer to the SimpleTextIn structure.
[in,out]KeyA pointer to the Key structure to fill.
Return values
EFI_SUCCESSThe read was successful.
EFI_UNSUPPORTEDThe device does not support the ability to read keystroke data.

Definition at line 76 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextInReset()

EFI_STATUS EFIAPI FileBasedSimpleTextInReset ( IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL This,
IN BOOLEAN  ExtendedVerification 
)

Reset function for the fake simple text input.

Parameters
[in]ThisA pointer to the SimpleTextIn structure.
[in]ExtendedVerificationTRUE for extra validation, FALSE otherwise.
Return values
EFI_SUCCESSThe reset was successful.

Definition at line 56 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutClearScreen()

EFI_STATUS EFIAPI FileBasedSimpleTextOutClearScreen ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This)

Clears the output device(s) display to the currently selected background color.

Parameters
[in]ThisProtocol instance pointer.
Return values
EFI_UNSUPPORTEDThe output device is not in a valid text mode.

Definition at line 348 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutEnableCursor()

EFI_STATUS EFIAPI FileBasedSimpleTextOutEnableCursor ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN BOOLEAN  Visible 
)

Makes the cursor visible or invisible

Parameters
[in]ThisProtocol instance pointer.
[in]VisibleIf TRUE, the cursor is set to be visible. If FALSE, the cursor is set to be invisible.
Return values
EFI_SUCCESSThe operation completed successfully.

Definition at line 386 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutOutputString()

EFI_STATUS EFIAPI FileBasedSimpleTextOutOutputString ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN CHAR16 *  WString 
)

Write a Unicode string to the output device.

Parameters
[in]ThisProtocol instance pointer.
[in]WStringThe NULL-terminated Unicode string to be displayed on the output device(s). All output devices must also support the Unicode drawing defined in this file.
Return values
EFI_SUCCESSThe string was output to the device.
EFI_DEVICE_ERRORThe device reported an error while attempting to output the text.
EFI_UNSUPPORTEDThe output device's mode is not currently in a defined text mode.
EFI_WARN_UNKNOWN_GLYPHThis warning code indicates that some of the characters in the Unicode string could not be rendered and were skipped.

Definition at line 412 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutQueryMode()

EFI_STATUS EFIAPI FileBasedSimpleTextOutQueryMode ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN UINTN  ModeNumber,
OUT UINTN Columns,
OUT UINTN Rows 
)

Returns information for an available text mode that the output device(s) supports.

Parameters
[in]ThisProtocol instance pointer.
[in]ModeNumberThe mode number to return information on.
[out]ColumnsUpon return, the number of columns in the selected geometry
[out]RowsUpon return, the number of rows in the selected geometry
Return values
EFI_UNSUPPORTEDThe mode number was not valid.

Definition at line 279 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutReset()

EFI_STATUS EFIAPI FileBasedSimpleTextOutReset ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN BOOLEAN  ExtendedVerification 
)

Reset the text output device hardware and optionally run diagnostics.

Parameters
Thispointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
ExtendedVerificationIndicates that a more extensive test may be performed
Return values
EFI_SUCCESSThe text output device was reset.

Definition at line 239 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutSetAttribute()

EFI_STATUS EFIAPI FileBasedSimpleTextOutSetAttribute ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN UINTN  Attribute 
)

Sets the background and foreground colors for the OutputString () and ClearScreen () functions.

Parameters
[in]ThisProtocol instance pointer.
[in]AttributeThe attribute to set. Bits 0..3 are the foreground color, and bits 4..6 are the background color. All other bits are undefined and must be zero. The valid Attributes are defined in this file.
Return values
EFI_SUCCESSThe attribute was set.

Definition at line 330 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutSetCursorPosition()

EFI_STATUS EFIAPI FileBasedSimpleTextOutSetCursorPosition ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN UINTN  Column,
IN UINTN  Row 
)

Sets the current coordinates of the cursor position

Parameters
[in]ThisProtocol instance pointer.
[in]ColumnColumn to put the cursor in. Must be between zero and Column returned from QueryMode
[in]RowRow to put the cursor in. Must be between zero and Row returned from QueryMode
Return values
EFI_SUCCESSThe operation completed successfully.

Definition at line 366 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutSetMode()

EFI_STATUS EFIAPI FileBasedSimpleTextOutSetMode ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN UINTN  ModeNumber 
)

Sets the output device(s) to a specified mode.

Parameters
[in]ThisProtocol instance pointer.
[in]ModeNumberThe mode number to set.
Return values
EFI_UNSUPPORTEDThe mode number was not valid.

Definition at line 309 of file ConsoleWrappers.c.

◆ FileBasedSimpleTextOutTestString()

EFI_STATUS EFIAPI FileBasedSimpleTextOutTestString ( IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL This,
IN CHAR16 *  WString 
)

Verifies that all characters in a Unicode string can be output to the target device.

Parameters
[in]ThisProtocol instance pointer.
[in]WStringThe NULL-terminated Unicode string to be examined.
Return values
EFI_SUCCESSThe device(s) are capable of rendering the output string.

Definition at line 258 of file ConsoleWrappers.c.

Variable Documentation

◆ AsciiRedirection

BOOLEAN AsciiRedirection
extern

Definition at line 15 of file ShellParametersProtocol.c.