2010-09-14 07:18:09 +02:00
|
|
|
/** @file
|
|
|
|
Main file for NULL named library for level 1 shell command functions.
|
|
|
|
|
2013-07-26 05:14:08 +02:00
|
|
|
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
|
2010-09-14 07:18:09 +02:00
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
2011-04-05 22:55:45 +02:00
|
|
|
#ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
|
2011-03-25 21:43:03 +01:00
|
|
|
#define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
|
|
|
|
|
2010-09-14 07:18:09 +02:00
|
|
|
#include <Uefi.h>
|
|
|
|
#include <ShellBase.h>
|
|
|
|
|
2011-09-21 03:56:00 +02:00
|
|
|
#include <Guid/ShellLibHiiGuid.h>
|
|
|
|
|
2010-09-14 07:18:09 +02:00
|
|
|
#include <Protocol/EfiShell.h>
|
|
|
|
#include <Protocol/EfiShellParameters.h>
|
|
|
|
#include <Protocol/DevicePath.h>
|
|
|
|
#include <Protocol/LoadedImage.h>
|
|
|
|
#include <Protocol/UnicodeCollation.h>
|
|
|
|
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
|
|
|
#include <Library/PcdLib.h>
|
|
|
|
#include <Library/ShellCommandLib.h>
|
|
|
|
#include <Library/ShellLib.h>
|
|
|
|
#include <Library/SortLib.h>
|
|
|
|
#include <Library/UefiLib.h>
|
|
|
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
#include <Library/HiiLib.h>
|
|
|
|
#include <Library/FileHandleLib.h>
|
|
|
|
|
|
|
|
extern EFI_HANDLE gShellLevel1HiiHandle;
|
|
|
|
|
2011-03-25 21:43:03 +01:00
|
|
|
/**
|
|
|
|
Function for 'stall' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunStall (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
2010-09-14 07:18:09 +02:00
|
|
|
/**
|
|
|
|
Function for 'exit' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunExit (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function for 'endif' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunEndIf (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function for 'for' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunFor (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function for 'endfor' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunEndFor (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function for 'if' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunIf (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function for 'goto' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunGoto (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function for 'shift' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunShift (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function for 'else' command.
|
|
|
|
|
|
|
|
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
|
|
|
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
|
|
|
**/
|
|
|
|
SHELL_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ShellCommandRunElse (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
);
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Function prototype for BOTH GetNextNode and GetPreviousNode...
|
|
|
|
/// This is used to control the MoveToTag function direction...
|
|
|
|
///
|
|
|
|
typedef
|
|
|
|
LIST_ENTRY *
|
|
|
|
(EFIAPI *LIST_MANIP_FUNC)(
|
|
|
|
IN CONST LIST_ENTRY *List,
|
|
|
|
IN CONST LIST_ENTRY *Node
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2011-03-25 21:43:03 +01:00
|
|
|
Move the script pointer from 1 tag (line) to another.
|
|
|
|
|
|
|
|
It functions so that count starts at 1 and it increases or decreases when it
|
|
|
|
hits the specified tags. when it hits zero the location has been found.
|
|
|
|
|
|
|
|
DecrementerTag and IncrementerTag are used to get around for/endfor and
|
|
|
|
similar paired types where the entire middle should be ignored.
|
|
|
|
|
|
|
|
If label is used it will be used instead of the count.
|
|
|
|
|
2011-09-02 10:05:34 +02:00
|
|
|
@param[in] Function The function to use to enumerate through the
|
|
|
|
list. Normally GetNextNode or GetPreviousNode.
|
|
|
|
@param[in] DecrementerTag The tag to decrement the count at.
|
|
|
|
@param[in] IncrementerTag The tag to increment the count at.
|
|
|
|
@param[in] Label A label to look for.
|
|
|
|
@param[in, out] ScriptFile The pointer to the current script file structure.
|
|
|
|
@param[in] MovePast TRUE makes function return 1 past the found
|
|
|
|
location.
|
|
|
|
@param[in] FindOnly TRUE to not change the ScriptFile.
|
|
|
|
@param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
|
|
|
|
searching.
|
2010-09-14 07:18:09 +02:00
|
|
|
**/
|
|
|
|
BOOLEAN
|
|
|
|
EFIAPI
|
|
|
|
MoveToTag (
|
|
|
|
IN CONST LIST_MANIP_FUNC Function,
|
|
|
|
IN CONST CHAR16 *DecrementerTag,
|
|
|
|
IN CONST CHAR16 *IncrementerTag,
|
|
|
|
IN CONST CHAR16 *Label OPTIONAL,
|
2011-03-25 21:43:03 +01:00
|
|
|
IN OUT SCRIPT_FILE *ScriptFile,
|
2010-09-14 07:18:09 +02:00
|
|
|
IN CONST BOOLEAN MovePast,
|
|
|
|
IN CONST BOOLEAN FindOnly,
|
|
|
|
IN CONST BOOLEAN WrapAroundScript
|
|
|
|
);
|
|
|
|
|
2011-03-25 21:43:03 +01:00
|
|
|
#endif
|
|
|
|
|