summaryrefslogtreecommitdiff
path: root/BeagleBoardPkg/Sec
diff options
context:
space:
mode:
Diffstat (limited to 'BeagleBoardPkg/Sec')
-rwxr-xr-xBeagleBoardPkg/Sec/Sec.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/BeagleBoardPkg/Sec/Sec.c b/BeagleBoardPkg/Sec/Sec.c
index e3d299b82d..cc134317b1 100755
--- a/BeagleBoardPkg/Sec/Sec.c
+++ b/BeagleBoardPkg/Sec/Sec.c
@@ -184,15 +184,16 @@ CEntryPoint (
{
VOID *HobBase;
+ // Build a basic HOB list
+ HobBase = (VOID *)(UINTN)(FixedPcdGet32(PcdEmbeddedFdBaseAddress) + FixedPcdGet32(PcdEmbeddedFdSize));
+ CreateHobList (MemoryBase, MemorySize, HobBase, StackBase);
+
//Set up Pin muxing.
PadConfiguration ();
// Set up system clocking
ClockInit ();
- // Build a basic HOB list
- HobBase = (VOID *)(UINTN)(FixedPcdGet32(PcdEmbeddedFdBaseAddress) + FixedPcdGet32(PcdEmbeddedFdSize));
- CreateHobList (MemoryBase, MemorySize, HobBase, StackBase);
// Enable program flow prediction, if supported.
ArmEnableBranchPrediction ();
@@ -222,35 +223,34 @@ CEntryPoint (
VOID *PeCoffImage;
UINT32 Offset;
CHAR8 *FilePath;
-
- FfsAnyFvFindFirstFile (EFI_FV_FILETYPE_SECURITY_CORE, &VolumeHandle, &FileHandle);
- Status = FfsFindSectionData (EFI_SECTION_TE, FileHandle, &PeCoffImage);
- if (EFI_ERROR (Status)) {
- // Usually is a TE (PI striped down PE/COFF), but could be a full PE/COFF
- Status = FfsFindSectionData (EFI_SECTION_PE32, FileHandle, &PeCoffImage);
- }
- if (!EFI_ERROR (Status)) {
+ FfsAnyFvFindFirstFile (EFI_FV_FILETYPE_SECURITY_CORE, &VolumeHandle, &FileHandle);
+ Status = FfsFindSectionData (EFI_SECTION_TE, FileHandle, &PeCoffImage);
+ if (EFI_ERROR (Status)) {
+ // Usually is a TE (PI striped down PE/COFF), but could be a full PE/COFF
+ Status = FfsFindSectionData (EFI_SECTION_PE32, FileHandle, &PeCoffImage);
+ }
+ if (!EFI_ERROR (Status)) {
Offset = PeCoffGetSizeOfHeaders (PeCoffImage);
- FilePath = PeCoffLoaderGetPdbPointer (PeCoffImage);
- if (FilePath != NULL) {
-
- //
- // In general you should never have to use #ifdef __CC_ARM in the code. It
- // is hidden in the away in the MdePkg. But here we would like to print differnt things
- // for different toolchains.
- //
-#ifdef __CC_ARM
- // Print out the command for the RVD debugger to load symbols for this image
- DEBUG ((EFI_D_ERROR, "load /a /ni /np %a &0x%08x\n", SecDeCygwinPathIfNeeded (FilePath), (CHAR8 *)PeCoffImage + Offset));
+ FilePath = PeCoffLoaderGetPdbPointer (PeCoffImage);
+ if (FilePath != NULL) {
+
+ //
+ // In general you should never have to use #ifdef __CC_ARM in the code. It
+ // is hidden in the away in the MdePkg. But here we would like to print differnt things
+ // for different toolchains.
+ //
+#ifdef __CC_ARM
+ // Print out the command for the RVD debugger to load symbols for this image
+ DEBUG ((EFI_D_ERROR, "load /a /ni /np %a &0x%08x\n", SecDeCygwinPathIfNeeded (FilePath), (CHAR8 *)PeCoffImage + Offset));
#elif __GNUC__
- // This may not work correctly if you generate PE/COFF directlyas then the Offset would not be required
- DEBUG ((EFI_D_ERROR, "add-symbol-file %a 0x%08x\n", FilePath, PeCoffImage + Offset));
+ // This may not work correctly if you generate PE/COFF directlyas then the Offset would not be required
+ DEBUG ((EFI_D_ERROR, "add-symbol-file %a 0x%08x\n", FilePath, PeCoffImage + Offset));
#else
- DEBUG ((EFI_D_ERROR, "SEC starts at 0x%08x with an entry point at 0x%08x %a\n", PeCoffImage, _ModuleEntryPoint, FilePath));
+ DEBUG ((EFI_D_ERROR, "SEC starts at 0x%08x with an entry point at 0x%08x %a\n", PeCoffImage, _ModuleEntryPoint, FilePath));
#endif
}
- }
-
+ }
+
DEBUG_CODE_END ();
@@ -271,6 +271,7 @@ CEntryPoint (
LzmaGuidedSectionExtraction
);
+ // Assume the FV that contains the SEC (our code) also contains a compressed FV.
DecompressFirstFv ();
// Load the DXE Core and transfer control to it