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

Go to the source code of this file.

Functions

EFI_STATUS ConsoleLoggerInstall (IN CONST UINTN ScreensToSave, OUT CONSOLE_LOGGER_PRIVATE_DATA **ConsoleInfo)
 
EFI_STATUS ConsoleLoggerUninstall (IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 
EFI_STATUS ConsoleLoggerDisplayHistory (IN CONST BOOLEAN Forward, IN CONST UINTN Rows, IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 
EFI_STATUS ConsoleLoggerStopHistory (IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 
EFI_STATUS UpdateDisplayFromHistory (IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 
EFI_STATUS EFIAPI ConsoleLoggerReset (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS AppendStringToHistory (IN CONST CHAR16 *String, IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 
EFI_STATUS ConsoleLoggerOutputStringSplit (IN CONST CHAR16 *String, IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 
EFI_STATUS ConsoleLoggerDoPageBreak (VOID)
 
EFI_STATUS ConsoleLoggerPrintWithPageBreak (IN CONST CHAR16 *String, IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 
EFI_STATUS EFIAPI ConsoleLoggerOutputString (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *WString)
 
EFI_STATUS EFIAPI ConsoleLoggerTestString (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN CHAR16 *WString)
 
EFI_STATUS EFIAPI ConsoleLoggerQueryMode (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows)
 
EFI_STATUS EFIAPI ConsoleLoggerSetMode (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber)
 
EFI_STATUS EFIAPI ConsoleLoggerSetAttribute (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Attribute)
 
EFI_STATUS EFIAPI ConsoleLoggerClearScreen (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This)
 
EFI_STATUS EFIAPI ConsoleLoggerSetCursorPosition (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN Column, IN UINTN Row)
 
EFI_STATUS EFIAPI ConsoleLoggerEnableCursor (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN BOOLEAN Visible)
 
EFI_STATUS ConsoleLoggerResetBuffers (IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
 

Detailed Description

Provides interface to shell console logger.

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

Definition in file ConsoleLogger.c.

Function Documentation

◆ AppendStringToHistory()

EFI_STATUS AppendStringToHistory ( IN CONST CHAR16 *  String,
IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo 
)

Appends a string to the history buffer. If the buffer is full then the oldest information in the buffer will be dropped. Information is added in a line by line manner such that an empty line takes up just as much space as a full line.

Parameters
[in]StringString pointer to add.
[in]ConsoleInfoThe pointer to the instance of the console logger information.

Definition at line 460 of file ConsoleLogger.c.

◆ ConsoleLoggerClearScreen()

EFI_STATUS EFIAPI ConsoleLoggerClearScreen ( 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_SUCCESSThe operation completed successfully.
EFI_DEVICE_ERRORThe device had an error and could not complete the request.
EFI_UNSUPPORTEDThe output device is not in a valid text mode.

Definition at line 1081 of file ConsoleLogger.c.

◆ ConsoleLoggerDisplayHistory()

EFI_STATUS ConsoleLoggerDisplayHistory ( IN CONST BOOLEAN  Forward,
IN CONST UINTN  Rows,
IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo 
)

Displays previously logged output back to the screen.

This will scroll the screen forwards and backwards through the log of previous output. If Rows is 0 then the size of 1/2 the screen will be scrolled. If Rows is (UINTN)(-1) then the size of the screen will be scrolled.

Parameters
[in]ForwardIf TRUE then the log will be displayed forwards (scroll to newer). If FALSE then the log will be displayed backwards (scroll to older).
[in]RowsDetermines how many rows the log should scroll.
[in]ConsoleInfoThe pointer to the instance of the console logger information.

Definition at line 167 of file ConsoleLogger.c.

◆ ConsoleLoggerDoPageBreak()

EFI_STATUS ConsoleLoggerDoPageBreak ( VOID  )

Function to handle page break mode.

This function will prompt for continue or break.

Return values
EFI_SUCCESSContinue was choosen
Returns
other Break was choosen

Definition at line 650 of file ConsoleLogger.c.

◆ ConsoleLoggerEnableCursor()

EFI_STATUS EFIAPI ConsoleLoggerEnableCursor ( 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.
EFI_DEVICE_ERRORThe device had an error and could not complete the request, or the device does not support changing the cursor mode.
EFI_UNSUPPORTEDThe output device is not in a valid text mode.

Definition at line 1202 of file ConsoleLogger.c.

◆ ConsoleLoggerInstall()

EFI_STATUS ConsoleLoggerInstall ( IN CONST UINTN  ScreensToSave,
OUT CONSOLE_LOGGER_PRIVATE_DATA **  ConsoleInfo 
)

Install our intermediate ConOut into the system table to keep a log of all the info that is displayed to the user.

Parameters
[in]ScreensToSaveSets how many screen-worths of data to save.
[out]ConsoleInfoThe object to pass into later functions.
Return values
EFI_SUCCESSThe operation was successful.
Returns
other The operation failed.
See also
ConsoleLoggerResetBuffers
InstallProtocolInterface

Definition at line 26 of file ConsoleLogger.c.

◆ ConsoleLoggerOutputString()

EFI_STATUS EFIAPI ConsoleLoggerOutputString ( 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 862 of file ConsoleLogger.c.

◆ ConsoleLoggerOutputStringSplit()

EFI_STATUS ConsoleLoggerOutputStringSplit ( IN CONST CHAR16 *  String,
IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo 
)

Worker function to handle printing the output to the screen and the history buffer

Parameters
[in]StringThe string to output
[in]ConsoleInfoThe pointer to the instance of the console logger information.
Return values
EFI_SUCCESSThe string was printed
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 622 of file ConsoleLogger.c.

◆ ConsoleLoggerPrintWithPageBreak()

EFI_STATUS ConsoleLoggerPrintWithPageBreak ( IN CONST CHAR16 *  String,
IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo 
)

Worker function to handle printing the output with page breaks.

Parameters
[in]StringThe string to output
[in]ConsoleInfoThe pointer to the instance of the console logger information.
Return values
EFI_SUCCESSThe string was printed
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 713 of file ConsoleLogger.c.

◆ ConsoleLoggerQueryMode()

EFI_STATUS EFIAPI ConsoleLoggerQueryMode ( 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_SUCCESSThe requested mode information was returned.
EFI_DEVICE_ERRORThe device had an error and could not complete the request.
EFI_UNSUPPORTEDThe mode number was not valid.

Definition at line 960 of file ConsoleLogger.c.

◆ ConsoleLoggerReset()

EFI_STATUS EFIAPI ConsoleLoggerReset ( 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.
EFI_DEVICE_ERRORThe text output device is not functioning correctly and could not be reset.

Definition at line 422 of file ConsoleLogger.c.

◆ ConsoleLoggerResetBuffers()

EFI_STATUS ConsoleLoggerResetBuffers ( IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo)

Function to update and verify that the current buffers are correct.

Parameters
[in]ConsoleInfoThe pointer to the instance of the console logger information.

This will be used when a mode has changed or a reset occurred to verify all history buffers.

Definition at line 1236 of file ConsoleLogger.c.

◆ ConsoleLoggerSetAttribute()

EFI_STATUS EFIAPI ConsoleLoggerSetAttribute ( 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.
EFI_DEVICE_ERRORThe device had an error and could not complete the request.
EFI_UNSUPPORTEDThe attribute requested is not defined.

Definition at line 1042 of file ConsoleLogger.c.

◆ ConsoleLoggerSetCursorPosition()

EFI_STATUS EFIAPI ConsoleLoggerSetCursorPosition ( 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.
EFI_DEVICE_ERRORThe device had an error and could not complete the request.
EFI_UNSUPPORTEDThe output device is not in a valid text mode, or the cursor position is invalid for the current mode.

Definition at line 1153 of file ConsoleLogger.c.

◆ ConsoleLoggerSetMode()

EFI_STATUS EFIAPI ConsoleLoggerSetMode ( 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_SUCCESSThe requested text mode was set.
EFI_DEVICE_ERRORThe device had an error and could not complete the request.
EFI_UNSUPPORTEDThe mode number was not valid.

Definition at line 995 of file ConsoleLogger.c.

◆ ConsoleLoggerStopHistory()

EFI_STATUS ConsoleLoggerStopHistory ( IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo)

Function to return to normal output whent he scrolling is complete.

Parameters
[in]ConsoleInfoThe pointer to the instance of the console logger information.
Return values
EFI_SUCCESSThe operation was successful.
Returns
other The operation failed. See UpdateDisplayFromHistory.
See also
UpdateDisplayFromHistory

Definition at line 242 of file ConsoleLogger.c.

◆ ConsoleLoggerTestString()

EFI_STATUS EFIAPI ConsoleLoggerTestString ( 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 for the output device(s).
Return values
EFI_SUCCESSThe device(s) are capable of rendering the output string.
EFI_UNSUPPORTEDSome of the characters in the Unicode string cannot be rendered by one or more of the output devices mapped by the EFI handle.

Definition at line 930 of file ConsoleLogger.c.

◆ ConsoleLoggerUninstall()

EFI_STATUS ConsoleLoggerUninstall ( IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo)

Return the system to the state it was before InstallConsoleLogger was installed.

Parameters
[in]ConsoleInfoThe object from the install function.
Return values
EFI_SUCCESSThe operation was successful
Returns
other The operation failed. This was from UninstallProtocolInterface.

Definition at line 111 of file ConsoleLogger.c.

◆ UpdateDisplayFromHistory()

EFI_STATUS UpdateDisplayFromHistory ( IN CONSOLE_LOGGER_PRIVATE_DATA ConsoleInfo)

Updates the hidden ConOut to be displaying the correct stuff.

Parameters
[in]ConsoleInfoThe pointer to the instance of the console logger information.
Return values
EFI_SUCCESSThe operation was successful.
Returns
other The operation failed.

Definition at line 268 of file ConsoleLogger.c.