More renames for Tool Packages
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1675 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
57
Tools/CodeTools/Source/GenFvImage/Ebc/PeCoffLoaderEx.c
Normal file
57
Tools/CodeTools/Source/GenFvImage/Ebc/PeCoffLoaderEx.c
Normal file
@ -0,0 +1,57 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
PeCoffLoaderEx.c
|
||||
|
||||
Abstract:
|
||||
|
||||
EBC Specific relocation fixups
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
|
||||
|
||||
RETURN_STATUS
|
||||
PeCoffLoaderRelocateImageEx (
|
||||
IN UINT16 *Reloc,
|
||||
IN OUT CHAR8 *Fixup,
|
||||
IN OUT CHAR8 **FixupData,
|
||||
IN UINT64 Adjust
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Performs an IA-32 specific relocation fixup
|
||||
|
||||
Arguments:
|
||||
|
||||
Reloc - Pointer to the relocation record
|
||||
|
||||
Fixup - Pointer to the address to fix up
|
||||
|
||||
FixupData - Pointer to a buffer to log the fixups
|
||||
|
||||
Adjust - The offset to adjust the fixup
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_UNSUPPORTED - Unsupported now
|
||||
|
||||
--*/
|
||||
{
|
||||
return RETURN_UNSUPPORTED;
|
||||
}
|
299
Tools/CodeTools/Source/GenFvImage/GenFvImageExe.c
Normal file
299
Tools/CodeTools/Source/GenFvImage/GenFvImageExe.c
Normal file
@ -0,0 +1,299 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
GenFvImageExe.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This contains all code necessary to build the GenFvImage.exe utility.
|
||||
This utility relies heavily on the GenFvImage Lib. Definitions for both
|
||||
can be found in the Tiano Firmware Volume Generation Utility
|
||||
Specification, review draft.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// File included in build
|
||||
//
|
||||
#include "GenFvImageExe.h"
|
||||
#include "CommonLib.h"
|
||||
#include "EfiUtilityMsgs.h"
|
||||
|
||||
VOID
|
||||
PrintUtilityInfo (
|
||||
VOID
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Displays the standard utility information to SDTOUT
|
||||
|
||||
Arguments:
|
||||
|
||||
None
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
printf (
|
||||
"%s - Tiano Firmware Volume Generation Utility."" Version %i.%i\n\n",
|
||||
UTILITY_NAME,
|
||||
UTILITY_MAJOR_VERSION,
|
||||
UTILITY_MINOR_VERSION
|
||||
);
|
||||
}
|
||||
|
||||
VOID
|
||||
PrintUsage (
|
||||
VOID
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Displays the utility usage syntax to STDOUT
|
||||
|
||||
Arguments:
|
||||
|
||||
None
|
||||
|
||||
Returns:
|
||||
|
||||
None
|
||||
|
||||
--*/
|
||||
{
|
||||
printf ("Usage: %s -I FvInfFileName\n", UTILITY_NAME);
|
||||
printf (" Where:\n");
|
||||
printf ("\tFvInfFileName is the name of the image description file.\n\n");
|
||||
}
|
||||
|
||||
int
|
||||
main (
|
||||
IN INTN argc,
|
||||
IN CHAR8 **argv
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This utility uses GenFvImage.Lib to build a firmware volume image.
|
||||
|
||||
Arguments:
|
||||
|
||||
FvInfFileName The name of an FV image description file.
|
||||
|
||||
Arguments come in pair in any order.
|
||||
-I FvInfFileName
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS No error conditions detected.
|
||||
EFI_INVALID_PARAMETER One or more of the input parameters is invalid.
|
||||
EFI_OUT_OF_RESOURCES A resource required by the utility was unavailable.
|
||||
Most commonly this will be memory allocation
|
||||
or file creation.
|
||||
EFI_LOAD_ERROR GenFvImage.lib could not be loaded.
|
||||
EFI_ABORTED Error executing the GenFvImage lib.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
CHAR8 InfFileName[_MAX_PATH];
|
||||
CHAR8 *InfFileImage;
|
||||
UINTN InfFileSize;
|
||||
UINT8 *FvImage;
|
||||
UINTN FvImageSize;
|
||||
UINT8 Index;
|
||||
CHAR8 FvFileNameBuffer[_MAX_PATH];
|
||||
CHAR8 *FvFileName;
|
||||
FILE *FvFile;
|
||||
FILE *SymFile;
|
||||
CHAR8 SymFileNameBuffer[_MAX_PATH];
|
||||
CHAR8 *SymFileName;
|
||||
UINT8 *SymImage;
|
||||
UINTN SymImageSize;
|
||||
CHAR8 *CurrentSymString;
|
||||
|
||||
FvFileName = FvFileNameBuffer;
|
||||
SymFileName = SymFileNameBuffer;
|
||||
|
||||
SetUtilityName (UTILITY_NAME);
|
||||
//
|
||||
// Display utility information
|
||||
//
|
||||
PrintUtilityInfo ();
|
||||
|
||||
//
|
||||
// Verify the correct number of arguments
|
||||
//
|
||||
if (argc != MAX_ARGS) {
|
||||
Error (NULL, 0, 0, "invalid number of input parameters specified", NULL);
|
||||
PrintUsage ();
|
||||
return GetUtilityStatus ();
|
||||
}
|
||||
//
|
||||
// Initialize variables
|
||||
//
|
||||
strcpy (InfFileName, "");
|
||||
|
||||
//
|
||||
// Parse the command line arguments
|
||||
//
|
||||
for (Index = 1; Index < MAX_ARGS; Index += 2) {
|
||||
//
|
||||
// Make sure argument pair begin with - or /
|
||||
//
|
||||
if (argv[Index][0] != '-' && argv[Index][0] != '/') {
|
||||
Error (NULL, 0, 0, argv[Index], "argument pair must begin with \"-\" or \"/\"");
|
||||
PrintUsage ();
|
||||
return GetUtilityStatus ();
|
||||
}
|
||||
//
|
||||
// Make sure argument specifier is only one letter
|
||||
//
|
||||
if (argv[Index][2] != 0) {
|
||||
Error (NULL, 0, 0, argv[Index], "unrecognized argument");
|
||||
PrintUsage ();
|
||||
return GetUtilityStatus ();
|
||||
}
|
||||
//
|
||||
// Determine argument to read
|
||||
//
|
||||
switch (argv[Index][1]) {
|
||||
|
||||
case 'I':
|
||||
case 'i':
|
||||
if (strlen (InfFileName) == 0) {
|
||||
strcpy (InfFileName, argv[Index + 1]);
|
||||
} else {
|
||||
Error (NULL, 0, 0, argv[Index + 1], "FvInfFileName may only be specified once");
|
||||
PrintUsage ();
|
||||
return GetUtilityStatus ();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Error (NULL, 0, 0, argv[Index], "unrecognized argument");
|
||||
PrintUsage ();
|
||||
return GetUtilityStatus ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Read the INF file image
|
||||
//
|
||||
Status = GetFileImage (InfFileName, &InfFileImage, &InfFileSize);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
//
|
||||
// Call the GenFvImage lib
|
||||
//
|
||||
Status = GenerateFvImage (
|
||||
InfFileImage,
|
||||
InfFileSize,
|
||||
&FvImage,
|
||||
&FvImageSize,
|
||||
&FvFileName,
|
||||
&SymImage,
|
||||
&SymImageSize,
|
||||
&SymFileName
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
switch (Status) {
|
||||
|
||||
case EFI_INVALID_PARAMETER:
|
||||
Error (NULL, 0, 0, "invalid parameter passed to GenFvImage Lib", NULL);
|
||||
return GetUtilityStatus ();
|
||||
break;
|
||||
|
||||
case EFI_ABORTED:
|
||||
Error (NULL, 0, 0, "error detected while creating the file image", NULL);
|
||||
return GetUtilityStatus ();
|
||||
break;
|
||||
|
||||
case EFI_OUT_OF_RESOURCES:
|
||||
Error (NULL, 0, 0, "GenFvImage Lib could not allocate required resources", NULL);
|
||||
return GetUtilityStatus ();
|
||||
break;
|
||||
|
||||
case EFI_VOLUME_CORRUPTED:
|
||||
Error (NULL, 0, 0, "no base address was specified, but the FV.INF included a PEI or BSF file", NULL);
|
||||
return GetUtilityStatus ();
|
||||
break;
|
||||
|
||||
case EFI_LOAD_ERROR:
|
||||
Error (NULL, 0, 0, "could not load FV image generation library", NULL);
|
||||
return GetUtilityStatus ();
|
||||
break;
|
||||
|
||||
default:
|
||||
Error (NULL, 0, 0, "GenFvImage Lib returned unknown status", "status returned = 0x%X", Status);
|
||||
return GetUtilityStatus ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Write file
|
||||
//
|
||||
FvFile = fopen (FvFileName, "wb");
|
||||
if (FvFile == NULL) {
|
||||
Error (NULL, 0, 0, FvFileName, "could not open output file");
|
||||
free (FvImage);
|
||||
free (SymImage);
|
||||
return GetUtilityStatus ();
|
||||
}
|
||||
|
||||
if (fwrite (FvImage, 1, FvImageSize, FvFile) != FvImageSize) {
|
||||
Error (NULL, 0, 0, FvFileName, "failed to write to output file");
|
||||
free (FvImage);
|
||||
free (SymImage);
|
||||
fclose (FvFile);
|
||||
return GetUtilityStatus ();
|
||||
}
|
||||
|
||||
fclose (FvFile);
|
||||
free (FvImage);
|
||||
|
||||
//
|
||||
// Write symbol file
|
||||
//
|
||||
if (strcmp (SymFileName, "")) {
|
||||
SymFile = fopen (SymFileName, "wt");
|
||||
if (SymFile == NULL) {
|
||||
Error (NULL, 0, 0, SymFileName, "could not open output symbol file");
|
||||
free (SymImage);
|
||||
return GetUtilityStatus ();
|
||||
}
|
||||
|
||||
fprintf (SymFile, "TEXTSYM format | V1.0\n");
|
||||
|
||||
CurrentSymString = SymImage;
|
||||
while (((UINTN) CurrentSymString - (UINTN) SymImage) < SymImageSize) {
|
||||
fprintf (SymFile, "%s", CurrentSymString);
|
||||
CurrentSymString = (CHAR8 *) (((UINTN) CurrentSymString) + strlen (CurrentSymString) + 1);
|
||||
}
|
||||
|
||||
fclose (SymFile);
|
||||
}
|
||||
|
||||
free (SymImage);
|
||||
|
||||
return GetUtilityStatus ();
|
||||
}
|
98
Tools/CodeTools/Source/GenFvImage/GenFvImageExe.h
Normal file
98
Tools/CodeTools/Source/GenFvImage/GenFvImageExe.h
Normal file
@ -0,0 +1,98 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
GenFvImageExe.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Definitions for the PeimFixup exe utility.
|
||||
|
||||
--*/
|
||||
|
||||
//
|
||||
// Coded to Tiano Coding Standards
|
||||
//
|
||||
#ifndef _EFI_GEN_FV_IMAGE_EXE_H
|
||||
#define _EFI_GEN_FV_IMAGE_EXE_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "GenFvImageLib.h"
|
||||
|
||||
//
|
||||
// Utility Name
|
||||
//
|
||||
#define UTILITY_NAME "GenFvImage"
|
||||
|
||||
//
|
||||
// Utility version information
|
||||
//
|
||||
#define UTILITY_MAJOR_VERSION 0
|
||||
#define UTILITY_MINOR_VERSION 1
|
||||
#define UTILITY_DATE __DATE__
|
||||
|
||||
//
|
||||
// The maximum number of arguments accepted from the command line.
|
||||
//
|
||||
#define MAX_ARGS 3
|
||||
|
||||
//
|
||||
// The function that displays general utility information
|
||||
//
|
||||
VOID
|
||||
PrintUtilityInfo (
|
||||
VOID
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
None
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
//
|
||||
// The function that displays the utility usage message.
|
||||
//
|
||||
VOID
|
||||
PrintUsage (
|
||||
VOID
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
TODO: Add function description
|
||||
|
||||
Arguments:
|
||||
|
||||
None
|
||||
|
||||
Returns:
|
||||
|
||||
TODO: add return values
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
#endif
|
2727
Tools/CodeTools/Source/GenFvImage/GenFvImageLib.c
Normal file
2727
Tools/CodeTools/Source/GenFvImage/GenFvImageLib.c
Normal file
File diff suppressed because it is too large
Load Diff
142
Tools/CodeTools/Source/GenFvImage/GenFvImageLib.h
Normal file
142
Tools/CodeTools/Source/GenFvImage/GenFvImageLib.h
Normal file
@ -0,0 +1,142 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
GenFvImageLib.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This file contains describes the public interfaces to the GenFvImage Library.
|
||||
The basic purpose of the library is to create Firmware Volume images.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_GEN_FV_IMAGE_LIB_H
|
||||
#define _EFI_GEN_FV_IMAGE_LIB_H
|
||||
|
||||
//
|
||||
// Include files
|
||||
//
|
||||
#include <Common/UefiBaseTypes.h>
|
||||
#include <Common/MultiPhase.h>
|
||||
|
||||
#include "ParseInf.h"
|
||||
|
||||
//
|
||||
// Following definition is used for FIT in IPF
|
||||
//
|
||||
#define COMP_TYPE_FIT_PEICORE 0x10
|
||||
#define COMP_TYPE_FIT_UNUSED 0x7F
|
||||
|
||||
#define FIT_TYPE_MASK 0x7F
|
||||
#define CHECKSUM_BIT_MASK 0x80
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
UINT64 CompAddress;
|
||||
UINT32 CompSize;
|
||||
UINT16 CompVersion;
|
||||
UINT8 CvAndType;
|
||||
UINT8 CheckSum;
|
||||
} FIT_TABLE;
|
||||
|
||||
#pragma pack()
|
||||
//
|
||||
// Exported function prototypes
|
||||
//
|
||||
EFI_STATUS
|
||||
GenerateFvImage (
|
||||
IN CHAR8 *InfFileImage,
|
||||
IN UINTN InfFileSize,
|
||||
OUT UINT8 **FvImage,
|
||||
OUT UINTN *FvImageSize,
|
||||
OUT CHAR8 **FvFileName,
|
||||
OUT UINT8 **SymImage,
|
||||
OUT UINTN *SymImageSize,
|
||||
OUT CHAR8 **SymFileName
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This is the main function which will be called from application.
|
||||
|
||||
Arguments:
|
||||
|
||||
InfFileImage Buffer containing the INF file contents.
|
||||
InfFileSize Size of the contents of the InfFileImage buffer.
|
||||
FvImage Pointer to the FV image created.
|
||||
FvImageSize Size of the FV image created and pointed to by FvImage.
|
||||
FvFileName Requested name for the FV file.
|
||||
SymImage Pointer to the Sym image created.
|
||||
SymImageSize Size of the Sym image created and pointed to by SymImage.
|
||||
SymFileName Requested name for the Sym file.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS Function completed successfully.
|
||||
EFI_OUT_OF_RESOURCES Could not allocate required resources.
|
||||
EFI_ABORTED Error encountered.
|
||||
EFI_INVALID_PARAMETER A required parameter was NULL.
|
||||
|
||||
--*/
|
||||
EFI_STATUS
|
||||
UpdatePeiCoreEntryInFit (
|
||||
IN FIT_TABLE *FitTablePtr,
|
||||
IN UINT64 PeiCorePhysicalAddress
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to update the Pei Core address in FIT, this can be used by Sec core to pass control from
|
||||
Sec to Pei Core
|
||||
|
||||
Arguments:
|
||||
|
||||
FitTablePtr - The pointer of FIT_TABLE.
|
||||
PeiCorePhysicalAddress - The address of Pei Core entry.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The PEI_CORE FIT entry was updated successfully.
|
||||
EFI_NOT_FOUND - Not found the PEI_CORE FIT entry.
|
||||
|
||||
--*/
|
||||
VOID
|
||||
UpdateFitCheckSum (
|
||||
IN FIT_TABLE *FitTablePtr
|
||||
)
|
||||
;
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function is used to update the checksum for FIT.
|
||||
|
||||
|
||||
Arguments:
|
||||
|
||||
FitTablePtr - The pointer of FIT_TABLE.
|
||||
|
||||
Returns:
|
||||
|
||||
None.
|
||||
|
||||
--*/
|
||||
#endif
|
172
Tools/CodeTools/Source/GenFvImage/GenFvImageLibInternal.h
Normal file
172
Tools/CodeTools/Source/GenFvImage/GenFvImageLibInternal.h
Normal file
@ -0,0 +1,172 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
GenFvImageLibInternal.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This file contains describes the private declarations for the GenFvImage Library.
|
||||
The basic purpose of the library is to create Firmware Volume images.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H
|
||||
#define _EFI_GEN_FV_IMAGE_LIB_INTERNAL_H
|
||||
|
||||
//
|
||||
// Include files
|
||||
//
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Common/FirmwareVolumeHeader.h>
|
||||
|
||||
#include "CommonLib.h"
|
||||
#include "GenFvImageLib.h"
|
||||
|
||||
//
|
||||
// Private data declarations
|
||||
//
|
||||
//
|
||||
// The maximum number of block map entries supported by the library
|
||||
//
|
||||
#define MAX_NUMBER_OF_FV_BLOCKS 100
|
||||
|
||||
//
|
||||
// The maximum number of files in the FV supported by the library
|
||||
//
|
||||
#define MAX_NUMBER_OF_FILES_IN_FV 1000
|
||||
#define MAX_NUMBER_OF_COMPONENTS_IN_FV 10
|
||||
|
||||
//
|
||||
// INF file strings
|
||||
//
|
||||
#define OPTIONS_SECTION_STRING "[options]"
|
||||
#define ATTRIBUTES_SECTION_STRING "[attributes]"
|
||||
#define FILES_SECTION_STRING "[files]"
|
||||
#define COMPONENT_SECTION_STRING "[components]"
|
||||
|
||||
#define EFI_FV_BASE_ADDRESS_STRING "EFI_BASE_ADDRESS"
|
||||
#define EFI_FV_FILE_NAME_STRING "EFI_FILE_NAME"
|
||||
#define EFI_SYM_FILE_NAME_STRING "EFI_SYM_FILE_NAME"
|
||||
#define EFI_NUM_BLOCKS_STRING "EFI_NUM_BLOCKS"
|
||||
#define EFI_BLOCK_SIZE_STRING "EFI_BLOCK_SIZE"
|
||||
#define EFI_FV_GUID_STRING "EFI_FV_GUID"
|
||||
|
||||
#define EFI_FVB_READ_DISABLED_CAP_STRING "EFI_READ_DISABLED_CAP"
|
||||
#define EFI_FVB_READ_ENABLED_CAP_STRING "EFI_READ_ENABLED_CAP"
|
||||
#define EFI_FVB_READ_STATUS_STRING "EFI_READ_STATUS"
|
||||
|
||||
#define EFI_FVB_WRITE_DISABLED_CAP_STRING "EFI_WRITE_DISABLED_CAP"
|
||||
#define EFI_FVB_WRITE_ENABLED_CAP_STRING "EFI_WRITE_ENABLED_CAP"
|
||||
#define EFI_FVB_WRITE_STATUS_STRING "EFI_WRITE_STATUS"
|
||||
|
||||
#define EFI_FVB_LOCK_CAP_STRING "EFI_LOCK_CAP"
|
||||
#define EFI_FVB_LOCK_STATUS_STRING "EFI_LOCK_STATUS"
|
||||
|
||||
#define EFI_FVB_STICKY_WRITE_STRING "EFI_STICKY_WRITE"
|
||||
#define EFI_FVB_MEMORY_MAPPED_STRING "EFI_MEMORY_MAPPED"
|
||||
#define EFI_FVB_ERASE_POLARITY_STRING "EFI_ERASE_POLARITY"
|
||||
|
||||
#define EFI_FVB_ALIGNMENT_CAP_STRING "EFI_ALIGNMENT_CAP"
|
||||
#define EFI_FVB_ALIGNMENT_2_STRING "EFI_ALIGNMENT_2"
|
||||
#define EFI_FVB_ALIGNMENT_4_STRING "EFI_ALIGNMENT_4"
|
||||
#define EFI_FVB_ALIGNMENT_8_STRING "EFI_ALIGNMENT_8"
|
||||
#define EFI_FVB_ALIGNMENT_16_STRING "EFI_ALIGNMENT_16"
|
||||
#define EFI_FVB_ALIGNMENT_32_STRING "EFI_ALIGNMENT_32"
|
||||
#define EFI_FVB_ALIGNMENT_64_STRING "EFI_ALIGNMENT_64"
|
||||
#define EFI_FVB_ALIGNMENT_128_STRING "EFI_ALIGNMENT_128"
|
||||
#define EFI_FVB_ALIGNMENT_256_STRING "EFI_ALIGNMENT_256"
|
||||
#define EFI_FVB_ALIGNMENT_512_STRING "EFI_ALIGNMENT_512"
|
||||
#define EFI_FVB_ALIGNMENT_1K_STRING "EFI_ALIGNMENT_1K"
|
||||
#define EFI_FVB_ALIGNMENT_2K_STRING "EFI_ALIGNMENT_2K"
|
||||
#define EFI_FVB_ALIGNMENT_4K_STRING "EFI_ALIGNMENT_4K"
|
||||
#define EFI_FVB_ALIGNMENT_8K_STRING "EFI_ALIGNMENT_8K"
|
||||
#define EFI_FVB_ALIGNMENT_16K_STRING "EFI_ALIGNMENT_16K"
|
||||
#define EFI_FVB_ALIGNMENT_32K_STRING "EFI_ALIGNMENT_32K"
|
||||
#define EFI_FVB_ALIGNMENT_64K_STRING "EFI_ALIGNMENT_64K"
|
||||
|
||||
//
|
||||
// Component sections
|
||||
//
|
||||
#define EFI_NV_VARIABLE_STRING "EFI_NV_VARIABLE"
|
||||
#define EFI_NV_EVENT_LOG_STRING "EFI_NV_EVENT_LOG"
|
||||
#define EFI_NV_FTW_WORKING_STRING "EFI_NV_FTW_WORKING"
|
||||
#define EFI_NV_FTW_SPARE_STRING "EFI_NV_FTW_SPARE"
|
||||
|
||||
#define EFI_FILE_NAME_STRING "EFI_FILE_NAME"
|
||||
|
||||
#define ONE_STRING "1"
|
||||
#define ZERO_STRING "0"
|
||||
#define TRUE_STRING "TRUE"
|
||||
#define FALSE_STRING "FALSE"
|
||||
#define NULL_STRING "NULL"
|
||||
|
||||
//
|
||||
// Defines to calculate the offset for PEI CORE entry points
|
||||
//
|
||||
#define IA32_PEI_CORE_ENTRY_OFFSET 0x20
|
||||
|
||||
//
|
||||
// Defines to calculate the FIT table
|
||||
//
|
||||
#define IPF_FIT_ADDRESS_OFFSET 0x20
|
||||
|
||||
//
|
||||
// Defines to calculate the offset for SALE_ENTRY
|
||||
//
|
||||
#define IPF_SALE_ENTRY_ADDRESS_OFFSET 0x18
|
||||
|
||||
//
|
||||
// Symbol file definitions, current max size if 512K
|
||||
//
|
||||
#define SYMBOL_FILE_SIZE 0x80000
|
||||
|
||||
#define FV_IMAGES_TOP_ADDRESS 0x100000000ULL
|
||||
|
||||
//
|
||||
// Private data types
|
||||
//
|
||||
//
|
||||
// Component information
|
||||
//
|
||||
typedef struct {
|
||||
UINTN Size;
|
||||
CHAR8 ComponentName[_MAX_PATH];
|
||||
} COMPONENT_INFO;
|
||||
|
||||
//
|
||||
// FV information holder
|
||||
//
|
||||
typedef struct {
|
||||
EFI_PHYSICAL_ADDRESS BaseAddress;
|
||||
EFI_GUID FvGuid;
|
||||
UINTN Size;
|
||||
CHAR8 FvName[_MAX_PATH];
|
||||
CHAR8 SymName[_MAX_PATH];
|
||||
EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];
|
||||
EFI_FVB_ATTRIBUTES FvAttributes;
|
||||
CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
|
||||
COMPONENT_INFO FvComponents[MAX_NUMBER_OF_COMPONENTS_IN_FV];
|
||||
} FV_INFO;
|
||||
|
||||
//
|
||||
// Private function prototypes
|
||||
//
|
||||
EFI_STATUS
|
||||
ParseFvInf (
|
||||
IN MEMORY_FILE *InfFile,
|
||||
IN FV_INFO *FvInfo
|
||||
)
|
||||
;
|
||||
|
||||
#endif
|
124
Tools/CodeTools/Source/GenFvImage/build.xml
Normal file
124
Tools/CodeTools/Source/GenFvImage/build.xml
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
-->
|
||||
<project default="GenTool" basedir=".">
|
||||
<!--
|
||||
EDK GenFvImage Tool
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
-->
|
||||
<property name="ToolName" value="GenFvImage"/>
|
||||
<property name="FileSet" value="GenFvImageLib.c GenFvImageExe.c"/>
|
||||
|
||||
<taskdef resource="cpptasks.tasks"/>
|
||||
<typedef resource="cpptasks.types"/>
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
|
||||
|
||||
<property name="LINK_OUTPUT_TYPE" value="static"/>
|
||||
<property name="BUILD_DIR" value="${PACKAGE_DIR}/${ToolName}/tmp"/>
|
||||
|
||||
<target name="GenTool" depends="init, Tool">
|
||||
<echo message="The EDK Tool: ${ToolName} build has completed"/>
|
||||
</target>
|
||||
|
||||
<target name="init">
|
||||
<echo message="Building the EDK Tool: ${ToolName}"/>
|
||||
<mkdir dir="${BUILD_DIR}"/>
|
||||
<if>
|
||||
<istrue value="${OSX}"/>
|
||||
<then>
|
||||
<property name="syslibdirs" value=""/>
|
||||
<property name="syslibs" value=""/>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<istrue value="${cygwin}"/>
|
||||
<then>
|
||||
<property name="syslibdirs" value="${env.CYGWIN_HOME}/lib/e2fsprogs"/>
|
||||
<property name="syslibs" value="uuid"/>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<istrue value="${msft}"/>
|
||||
<then>
|
||||
<property name="syslibdirs" value=""/>
|
||||
<property name="syslibs" value="uuid"/>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<istrue value="${linux}"/>
|
||||
<then>
|
||||
<if>
|
||||
<istrue value="${x86_64_linux}"/>
|
||||
<then>
|
||||
<property name="syslibdirs" value="/lib64"/>
|
||||
</then>
|
||||
<else>
|
||||
<property name="syslibdirs" value="/usr/lib"/>
|
||||
</else>
|
||||
</if>
|
||||
<property name="syslibs" value="uuid"/>
|
||||
</then>
|
||||
</if>
|
||||
<echo message="syslibdirs set to: ${syslibdirs}"/>
|
||||
</target>
|
||||
|
||||
<target name="Tool" depends="init, GenFvImage"/>
|
||||
|
||||
<target name="GenFvImage" >
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR}"
|
||||
outfile="${BIN_DIR}/${ToolName}"
|
||||
outtype="executable"
|
||||
debug="true"
|
||||
optimize="speed">
|
||||
<compilerarg value="${ExtraArgus}" if="ExtraArgus" />
|
||||
|
||||
<defineset>
|
||||
<define name="BUILDING_TOOLS"/>
|
||||
<define name="TOOL_BUILD_IA32_TARGET"/>
|
||||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet}"/>
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${ToolName}"/>
|
||||
<includepath path="${PACKAGE_DIR}/Include"/>
|
||||
<includepath path="${PACKAGE_DIR}/Include/${HostArch}"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools"/>
|
||||
|
||||
<linkerarg value="/nodefaultlib:libc.lib" if="msft"/>
|
||||
<syslibset dir="${syslibdirs}" libs="${syslibs}" if="cyglinux"/>
|
||||
<syslibset libs="RpcRT4" if="msft"/>
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<echo message="Removing Intermediate Files Only"/>
|
||||
<delete>
|
||||
<fileset dir="${BUILD_DIR}" includes="*.obj"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="cleanall">
|
||||
<echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>
|
||||
<delete failonerror="false" quiet="true" includeEmptyDirs="true">
|
||||
<fileset dir="${BUILD_DIR}"/>
|
||||
<fileset file="${BIN_DIR}/${ToolName}_Ia32${ext_exe}"/>
|
||||
<fileset file="${BIN_DIR}/${ToolName}_X64${ext_exe}"/>
|
||||
<fileset file="${BIN_DIR}/${ToolName}${ext_exe}"/>
|
||||
<fileset file="${BIN_DIR}/${ToolName}_Ipf${ext_exe}"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
</project>
|
Reference in New Issue
Block a user