Files
slimbootloader/BootloaderCommonPkg/Include/Library/ShellLib.h
T
Aiden Park e99762353a Introduce CONSOLE_PRINT macro (#701)
This will allow necessary messages to be printed to consoles.

These macros will redirect debug message to consoles.
  CONSOLE_PRINT
  CONSOLE_PRINT_UNICODE

These conditional macros will redirect debug message to consoles or
DEBUG(). The PrintLevel is valid only when redirected to DEBUG().
  CONSOLE_PRINT_CONDITION
  CONSOLE_PRINT_UNICODE_CONDITION

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-05-04 14:53:08 -07:00

64 lines
1.4 KiB
C

/** @file
A minimal command-line shell.
Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _SHELLLIB_H_
#define _SHELLLIB_H_
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/ConsoleOutLib.h>
#define ShellPrint ConsolePrintUnicode
typedef struct {
LIST_ENTRY CommandEntryList;
CHAR16 *CommandLineHist;
INTN CommandLineIdx;
UINTN CommandLineMaxLen;
BOOLEAN ShouldExit;
} SHELL;
typedef EFI_STATUS (EFIAPI *SHELL_COMMAND_ENTRY_FUNC) (SHELL *Shell, UINTN Argc, CHAR16 *Argv[]);
typedef struct {
CONST CHAR16 *Name;
CONST CHAR16 *Desc;
SHELL_COMMAND_ENTRY_FUNC Entry;
} SHELL_COMMAND;
/**
Begin a run-time interactive shell.
@param[in] Timeout seconds to wait for input before returning (0 for no timeout)
@retval EFI_SUCCESS
**/
EFI_STATUS
EFIAPI
Shell (
IN UINTN Timeout
);
/**
Register a Shell Command
@param[in] Shell Shell Context
@param[in] ShellCommand A Shell Command to be registered
@retval EFI_SUCCESS
@retval EFI_OUT_OF_RESOURCES
**/
EFI_STATUS
EFIAPI
ShellCommandRegister (
IN SHELL *Shell,
IN CONST SHELL_COMMAND *ShellCommand
);
#endif