/** @file
Main file for LoadPciRom shell Debug1 function.
Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "UefiShellDebug1CommandsLib.h"
#include <IndustryStandard/Pci22.h>
#include <IndustryStandard/Pci23.h>
#include <IndustryStandard/PeImage.h>
#include <Protocol/Decompress.h>
/**
Connects all available drives and controllers.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The abort mechanism was received.
**/
);
/**
Command entry point.
@param[in] RomBar The Rom Base address.
@param[in] RomSize The Rom size.
@param[in] FileName The file name.
@retval EFI_SUCCESS The command completed successfully.
@retval EFI_INVALID_PARAMETER Command usage error.
@retval EFI_UNSUPPORTED Protocols unsupported.
@retval EFI_OUT_OF_RESOURCES Out of memory.
@retval Other value Unknown error.
**/
);
{L"-nc", TypeFlag},
};
/**
Function for 'loadpcirom' command.
@param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
**/
)
{
//
// Local variable initializations
//
File1Buffer = NULL;
//
// verify number of arguments
//
} else {
}
} else {
} else {
} else {
}
//
// get a list with each file specified by parameters
// if parameter is a directory then add all the files below it to the list
//
){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, Param, Status);
break;
}
}
//
// loop through the list and make sure we are not aborting...
//
){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, Node->FullName);
continue;
}
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, Node->FullName);
continue;
}
} else {
);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_PCI_ROM_RES), gShellDebug1HiiHandle, Node->FullName, Status);
}
}
} else if (ShellStatus == SHELL_SUCCESS) {
}
}
if (Connect) {
}
}
}
return (ShellStatus);
}
/**
Command entry point.
@param[in] RomBar The Rom Base address.
@param[in] RomSize The Rom size.
@param[in] FileName The file name.
@retval EFI_SUCCESS The command completed successfully.
@retval EFI_INVALID_PARAMETER Command usage error.
@retval EFI_UNSUPPORTED Protocols unsupported.
@retval EFI_OUT_OF_RESOURCES Out of memory.
@retval Other value Unknown error.
**/
)
{
ImageIndex = 0;
do {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, FileName, ImageIndex);
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex);
return ReturnStatus;
}
//
// If the pointer to the PCI Data Structure is invalid, no further images can be located.
// The PCI Data Structure must be DWORD aligned.
//
if (EfiRomHeader->PcirOffset == 0 ||
break;
}
//
// If a valid signature is not present in the PCI Data Structure, no further images can be located.
//
break;
}
break;
}
//
// decompress here if needed
//
}
} else {
);
if (ImageBuffer != NULL) {
);
}
}
}
}
}
}
if (!SkipImage) {
//
// load image and start image
//
TRUE,
);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, FileName, ImageIndex, Status);
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status);
} else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, FileName, ImageIndex, Status);
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status);
} else {
}
}
}
if (DecompressedImageBuffer != NULL) {
}
}
}
ImageIndex++;
return ReturnStatus;
}
/**
Connects all available drives and controllers.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The abort mechanism was received.
**/
)
{
NULL,
NULL,
);
return Status;
}
if (ShellGetExecutionBreakFlag ()) {
goto Done;
}
//
// Scan the handle database
//
NULL,
);
/*
Status = LibScanHandleDatabase (
NULL,
NULL,
AllHandleBuffer[Index],
NULL,
&HandleCount,
&HandleBuffer,
&HandleType
);
*/
goto Done;
}
}
}
if (Device) {
}
}
if (!Parent) {
NULL,
NULL,
);
}
}
}
}
Done:
return Status;
}