2019-12-02 15:45:02 -08:00
|
|
|
/** @file
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
|
#include <Library/ShellExtensionLib.h>
|
|
|
|
|
#include "ShellCmds.h"
|
|
|
|
|
#include "Shell.h"
|
|
|
|
|
|
2019-12-17 18:48:02 -08:00
|
|
|
/**
|
|
|
|
|
Load shell commands.
|
|
|
|
|
|
|
|
|
|
@param[in] Shell shell instance
|
|
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Shell command loaded successfully
|
|
|
|
|
|
|
|
|
|
**/
|
2019-12-02 15:45:02 -08:00
|
|
|
EFI_STATUS
|
|
|
|
|
LoadShellCommands (
|
2019-12-17 18:48:02 -08:00
|
|
|
IN SHELL *Shell
|
2019-12-02 15:45:02 -08:00
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
CONST SHELL_COMMAND **ShellExtensionCmds;
|
|
|
|
|
CONST SHELL_COMMAND **Iter;
|
|
|
|
|
|
2019-12-17 15:55:19 -08:00
|
|
|
// Basic Shell commands
|
2019-12-17 18:48:02 -08:00
|
|
|
ShellCommandRegister (Shell, &ShellCommandExit);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandHelp);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandMm);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandCpuid);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandMsr);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandMtrr);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandUcode);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandCls);
|
2019-12-02 15:45:02 -08:00
|
|
|
|
2019-12-17 15:55:19 -08:00
|
|
|
if (!FeaturePcdGet (PcdMiniShellEnabled)) {
|
|
|
|
|
// More Shell commands
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandPci);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandHob);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandMmap);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandPerf);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandBoot);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandMmcDll);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandCdata);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandDmesg);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandReset);
|
|
|
|
|
ShellCommandRegister (Shell, &ShellCommandFs);
|
|
|
|
|
|
|
|
|
|
// Load Platform specific shell commands
|
|
|
|
|
ShellExtensionCmds = GetShellExtensionCmds ();
|
|
|
|
|
for (Iter = ShellExtensionCmds; *Iter != NULL; Iter++) {
|
|
|
|
|
ShellCommandRegister (Shell, *Iter);
|
|
|
|
|
}
|
2019-12-02 15:45:02 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return EFI_SUCCESS;
|
|
|
|
|
}
|