ImageTool: Remove old HII functionality

This commit is contained in:
Marvin Häuser 2023-04-30 19:21:40 +02:00 committed by Mikhail Krichanov
parent fd7f3b94b1
commit e11f00a64c
5 changed files with 1 additions and 43 deletions

View File

@ -355,7 +355,6 @@ GenExecutable (
IN const char *InputFileName, IN const char *InputFileName,
IN const char *FormatName, IN const char *FormatName,
IN const char *TypeName, IN const char *TypeName,
IN const char *HiiFileName,
IN const char *BaseAddress, IN const char *BaseAddress,
IN bool Strip, IN bool Strip,
IN bool FixedAddress IN bool FixedAddress
@ -365,8 +364,6 @@ GenExecutable (
VOID *InputFile; VOID *InputFile;
int8_t Format; int8_t Format;
int32_t Type; int32_t Type;
UINT32 HiiFileSize;
VOID *HiiFile;
RETURN_STATUS Status; RETURN_STATUS Status;
UINT64 NewBaseAddress; UINT64 NewBaseAddress;
void *OutputFile; void *OutputFile;
@ -405,24 +402,12 @@ GenExecutable (
return RETURN_ABORTED; return RETURN_ABORTED;
} }
HiiFile = NULL;
HiiFileSize = 0;
if (HiiFileName != NULL) {
HiiFile = UserReadFile (HiiFileName, &HiiFileSize);
if (HiiFile == NULL) {
fprintf (stderr, "ImageTool: Could not open %s: %s\n", HiiFileName, strerror (errno));
return RETURN_ABORTED;
}
}
OutputFile = ToolImageEmit ( OutputFile = ToolImageEmit (
&OutputFileSize, &OutputFileSize,
InputFile, InputFile,
InputFileSize, InputFileSize,
Format, Format,
Type, Type,
HiiFile,
HiiFileSize,
BaseAddress != NULL, BaseAddress != NULL,
NewBaseAddress, NewBaseAddress,
InputFileName, InputFileName,
@ -431,7 +416,6 @@ GenExecutable (
); );
if (OutputFile == NULL) { if (OutputFile == NULL) {
free (HiiFile);
return RETURN_ABORTED; return RETURN_ABORTED;
} }
@ -450,7 +434,6 @@ int main (int argc, const char *argv[])
const char *InputName; const char *InputName;
const char *FormatName; const char *FormatName;
const char *TypeName; const char *TypeName;
const char *HiiFileName;
const char *BaseAddress; const char *BaseAddress;
bool Strip; bool Strip;
bool FixedAddress; bool FixedAddress;
@ -469,7 +452,7 @@ int main (int argc, const char *argv[])
if (strcmp (argv[1], "GenImage") == 0) { if (strcmp (argv[1], "GenImage") == 0) {
if (argc < 5) { if (argc < 5) {
fprintf (stderr, "ImageTool: Command arguments are missing\n"); fprintf (stderr, "ImageTool: Command arguments are missing\n");
fprintf (stderr, " Usage: ImageTool GenImage [-c Format] [-t ModuleType] [-h HiiRc] [-b BaseAddress] [-s] [-f] -o OutputFile InputFile\n"); fprintf (stderr, " Usage: ImageTool GenImage [-c Format] [-t ModuleType] [-b BaseAddress] [-s] [-f] -o OutputFile InputFile\n");
raise (); raise ();
return -1; return -1;
} }
@ -478,7 +461,6 @@ int main (int argc, const char *argv[])
InputName = NULL; InputName = NULL;
FormatName = NULL; FormatName = NULL;
TypeName = NULL; TypeName = NULL;
HiiFileName = NULL;
BaseAddress = NULL; BaseAddress = NULL;
Strip = false; Strip = false;
FixedAddress = false; FixedAddress = false;
@ -507,14 +489,6 @@ int main (int argc, const char *argv[])
} }
TypeName = argv[ArgIndex]; TypeName = argv[ArgIndex];
} else if (strcmp (argv[ArgIndex], "-h") == 0) {
++ArgIndex;
if (ArgIndex == argc) {
fprintf (stderr, "Must specify an argument to -h\n");
return -1;
}
HiiFileName = argv[ArgIndex];
} else if (strcmp (argv[ArgIndex], "-b") == 0) { } else if (strcmp (argv[ArgIndex], "-b") == 0) {
++ArgIndex; ++ArgIndex;
if (ArgIndex == argc) { if (ArgIndex == argc) {
@ -552,7 +526,6 @@ int main (int argc, const char *argv[])
InputName, InputName,
FormatName, FormatName,
TypeName, TypeName,
HiiFileName,
BaseAddress, BaseAddress,
Strip, Strip,
FixedAddress FixedAddress

View File

@ -91,8 +91,6 @@ ToolImageEmit (
IN uint32_t BufferSize, IN uint32_t BufferSize,
IN int8_t Format, IN int8_t Format,
IN int32_t Type, IN int32_t Type,
IN void *HiiFile,
IN uint32_t HiiFileSize,
IN bool Relocate, IN bool Relocate,
IN uint64_t BaseAddress, IN uint64_t BaseAddress,
IN const char *SymbolsPath OPTIONAL, IN const char *SymbolsPath OPTIONAL,
@ -136,13 +134,6 @@ ToolImageEmit (
ImageInfo.HeaderInfo.Subsystem = (uint16_t)Type; ImageInfo.HeaderInfo.Subsystem = (uint16_t)Type;
} }
if (HiiFile != NULL) {
free (ImageInfo.HiiInfo.Data);
ImageInfo.HiiInfo.Data = HiiFile;
ImageInfo.HiiInfo.DataSize = HiiFileSize;
}
ToolImageSortRelocs (&ImageInfo); ToolImageSortRelocs (&ImageInfo);
Success = CheckToolImage (&ImageInfo); Success = CheckToolImage (&ImageInfo);

View File

@ -17,8 +17,6 @@ ToolImageEmit (
IN uint32_t BufferSize, IN uint32_t BufferSize,
IN int8_t Format, IN int8_t Format,
IN int32_t Type, IN int32_t Type,
IN void *HiiFile,
IN uint32_t HiiFileSize,
IN bool Relocate, IN bool Relocate,
IN uint64_t BaseAddress, IN uint64_t BaseAddress,
IN const char *SymbolsPath OPTIONAL, IN const char *SymbolsPath OPTIONAL,

View File

@ -3851,8 +3851,6 @@ Returns:
UefiImageFileSize, UefiImageFileSize,
ImageFormat, ImageFormat,
-1, -1,
NULL,
0,
true, true,
NewBaseAddress, NewBaseAddress,
NULL, NULL,

View File

@ -1453,8 +1453,6 @@ Returns:
FileBufferSize, FileBufferSize,
-1, -1,
-1, -1,
NULL,
0,
true, true,
NewBaseAddress, NewBaseAddress,
NULL, NULL,