3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/DebugLib.h>
18 #include <Library/PrePiLib.h>
19 #include <Library/PcdLib.h>
21 #include <Ppi/GuidedSectionExtraction.h>
38 EFI_PHYSICAL_ADDRESS MemoryBegin
;
43 // Boot strap the C environment so the other library services will work properly.
45 MemoryBegin
= (EFI_PHYSICAL_ADDRESS
)(UINTN
)MemoryBase
;
46 MemoryLength
= (UINT64
)MemorySize
;
47 HobBase
= (VOID
*)(UINTN
)(FixedPcdGet32(PcdEmbeddedFdBaseAddress
) + FixedPcdGet32(PcdEmbeddedFdSize
));
48 CreateHobList (MemoryBase
, MemorySize
, HobBase
, StackBase
);
50 MemoryBegin
= (EFI_PHYSICAL_ADDRESS
)(UINTN
)StackBase
;
51 MemoryLength
= (UINT64
)StackSize
;
52 UpdateStackHob (MemoryBegin
, MemoryLength
);
54 DEBUG ((DEBUG_ERROR
, "CEntryPoint (%x,%x,%x,%x)\n", MemoryBase
, MemorySize
, StackBase
, StackSize
));
57 // Add your C code stuff here....
62 // Load the DXE Core and transfer control to it
65 // Give the DXE Core access to our DEBUG and ASSERT infrastructure so this will work prior
66 // to the DXE version being loaded. Thus we close the debugging gap between phases.
67 AddDxeCoreReportStatusCodeCallback ();
69 //BuildFvHobs (PcdBfvBase, PcdBfvSize, NULL);
71 LoadDxeCoreFromFv (NULL
, 0);
73 // DXE Core should always load and never return