summaryrefslogtreecommitdiff
path: root/lib/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/init.c')
-rw-r--r--lib/init.c77
1 files changed, 36 insertions, 41 deletions
diff --git a/lib/init.c b/lib/init.c
index 4f238c0..726e493 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -46,57 +46,52 @@ Returns:
EFI_STATUS Status;
CHAR8 *LangCode;
- if (!LibInitialized) {
- LibInitialized = TRUE;
- LibFwInstance = FALSE;
- LibImageHandle = ImageHandle;
+ if (LibInitialized)
+ return;
+ LibInitialized = TRUE;
+ LibFwInstance = FALSE;
+ LibImageHandle = ImageHandle;
- //
- // Set up global pointer to the system table, boot services table,
- // and runtime services table
- //
-
- ST = SystemTable;
- BS = SystemTable->BootServices;
- RT = SystemTable->RuntimeServices;
-// ASSERT (CheckCrc(0, &ST->Hdr));
-// ASSERT (CheckCrc(0, &BS->Hdr));
-// ASSERT (CheckCrc(0, &RT->Hdr));
-
-
- //
- // Initialize pool allocation type
- //
-
- if (ImageHandle) {
- Status = uefi_call_wrapper(
- BS->HandleProtocol,
- 3,
- ImageHandle,
- &LoadedImageProtocol,
- (VOID*)&LoadedImage
- );
-
- if (!EFI_ERROR(Status)) {
- PoolAllocationType = LoadedImage->ImageDataType;
- }
- EFIDebugVariable ();
- }
+ //
+ // Set up global pointer to the system table, boot services table,
+ // and runtime services table
+ //
- //
- // Initialize Guid table
- //
+ ST = SystemTable;
+ BS = SystemTable->BootServices;
+ RT = SystemTable->RuntimeServices;
+ // ASSERT (CheckCrc(0, &ST->Hdr));
+ // ASSERT (CheckCrc(0, &BS->Hdr));
+ // ASSERT (CheckCrc(0, &RT->Hdr));
- InitializeGuid();
+ //
+ // Initialize pool allocation type
+ //
- InitializeLibPlatform(ImageHandle,SystemTable);
+ if (ImageHandle) {
+ Status = uefi_call_wrapper(
+ BS->HandleProtocol,
+ 3,
+ ImageHandle,
+ &LoadedImageProtocol,
+ (VOID*)&LoadedImage
+ );
+
+ if (!EFI_ERROR(Status)) {
+ PoolAllocationType = LoadedImage->ImageDataType;
+ }
+ EFIDebugVariable ();
}
//
- //
+ // Initialize Guid table
//
+ InitializeGuid();
+
+ InitializeLibPlatform(ImageHandle,SystemTable);
+
if (ImageHandle && UnicodeInterface == &LibStubUnicodeInterface) {
LangCode = LibGetVariable (VarLanguage, &EfiGlobalVariable);
InitializeUnicodeSupport (LangCode);