mirror of https://github.com/acidanthera/audk.git
1) Initialize gBS, gST, gImageHandle in UefiBootServicesTableLib.c to NULL
2) Add DxeCore infix to the module local variable gBS, gST, gRT, gDS in DxeMain.c. This is to solve the name conflict with UefiBootServicesTableLib which is defined in MDE Library Spec. 3) Add in check for gBS and gST in UefiDebugLibConOut/DebugLib.c and UefiDebugLibStdErr/DebugLib.c and MdePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c. If they are not initialized, the API will just return with a error message. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2546 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
18fda0cec0
commit
abb234751e
|
@ -1,6 +1,6 @@
|
||||||
/*++
|
/*++
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2007, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -116,10 +116,10 @@ typedef struct {
|
||||||
//
|
//
|
||||||
// DXE Core Global Variables
|
// DXE Core Global Variables
|
||||||
//
|
//
|
||||||
extern EFI_SYSTEM_TABLE *gST;
|
extern EFI_SYSTEM_TABLE *gDxeCoreST;
|
||||||
extern EFI_BOOT_SERVICES *gBS;
|
extern EFI_BOOT_SERVICES *gDxeCoreBS;
|
||||||
extern EFI_RUNTIME_SERVICES *gRT;
|
extern EFI_RUNTIME_SERVICES *gDxeCoreRT;
|
||||||
extern EFI_DXE_SERVICES *gDS;
|
extern EFI_DXE_SERVICES *gDxeCoreDS;
|
||||||
extern EFI_HANDLE gDxeCoreImageHandle;
|
extern EFI_HANDLE gDxeCoreImageHandle;
|
||||||
|
|
||||||
extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;
|
extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;
|
||||||
|
|
|
@ -211,16 +211,16 @@ EFI_RUNTIME_ARCH_PROTOCOL *gRuntime = &gRuntimeTemplate;
|
||||||
// DXE Core Global Variables for the EFI System Table, Boot Services Table,
|
// DXE Core Global Variables for the EFI System Table, Boot Services Table,
|
||||||
// DXE Services Table, and Runtime Services Table
|
// DXE Services Table, and Runtime Services Table
|
||||||
//
|
//
|
||||||
EFI_BOOT_SERVICES *gBS = &mBootServices;
|
EFI_BOOT_SERVICES *gDxeCoreBS = &mBootServices;
|
||||||
EFI_DXE_SERVICES *gDS = &mDxeServices;
|
EFI_DXE_SERVICES *gDxeCoreDS = &mDxeServices;
|
||||||
EFI_SYSTEM_TABLE *gST = NULL;
|
EFI_SYSTEM_TABLE *gDxeCoreST = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// For debug initialize gRT to template. gRT must be allocated from RT memory
|
// For debug initialize gDxeCoreRT to template. gDxeCoreRT must be allocated from RT memory
|
||||||
// but gRT is used for ASSERT () and DEBUG () type macros so lets give it
|
// but gDxeCoreRT is used for ASSERT () and DEBUG () type macros so lets give it
|
||||||
// a value that will not cause debug infrastructure to crash early on.
|
// a value that will not cause debug infrastructure to crash early on.
|
||||||
//
|
//
|
||||||
EFI_RUNTIME_SERVICES *gRT = &mEfiRuntimeServicesTableTemplate;
|
EFI_RUNTIME_SERVICES *gDxeCoreRT = &mEfiRuntimeServicesTableTemplate;
|
||||||
EFI_HANDLE gDxeCoreImageHandle = NULL;
|
EFI_HANDLE gDxeCoreImageHandle = NULL;
|
||||||
|
|
||||||
VOID *mHobStart;
|
VOID *mHobStart;
|
||||||
|
@ -288,13 +288,13 @@ Returns:
|
||||||
// Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData
|
// Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData
|
||||||
// Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table
|
// Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table
|
||||||
//
|
//
|
||||||
gST = CoreAllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate);
|
gDxeCoreST = CoreAllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate);
|
||||||
ASSERT (gST != NULL);
|
ASSERT (gDxeCoreST != NULL);
|
||||||
|
|
||||||
gRT = CoreAllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate);
|
gDxeCoreRT = CoreAllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate);
|
||||||
ASSERT (gRT != NULL);
|
ASSERT (gDxeCoreRT != NULL);
|
||||||
|
|
||||||
gST->RuntimeServices = gRT;
|
gDxeCoreST->RuntimeServices = gDxeCoreRT;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start the Image Services.
|
// Start the Image Services.
|
||||||
|
@ -305,7 +305,7 @@ Returns:
|
||||||
//
|
//
|
||||||
// Call constructor for all libraries
|
// Call constructor for all libraries
|
||||||
//
|
//
|
||||||
ProcessLibraryConstructorList (gDxeCoreImageHandle, gST);
|
ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);
|
||||||
PERF_END (0,PEI_TOK, NULL, 0) ;
|
PERF_END (0,PEI_TOK, NULL, 0) ;
|
||||||
PERF_START (0,DXE_TOK, NULL, 0) ;
|
PERF_START (0,DXE_TOK, NULL, 0) ;
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ Returns:
|
||||||
//
|
//
|
||||||
// Install the DXE Services Table into the EFI System Tables's Configuration Table
|
// Install the DXE Services Table into the EFI System Tables's Configuration Table
|
||||||
//
|
//
|
||||||
Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDS);
|
Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDxeCoreDS);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -400,16 +400,16 @@ Returns:
|
||||||
//
|
//
|
||||||
// Produce Firmware Volume Protocols, one for each FV in the HOB list.
|
// Produce Firmware Volume Protocols, one for each FV in the HOB list.
|
||||||
//
|
//
|
||||||
Status = FwVolBlockDriverInit (gDxeCoreImageHandle, gST);
|
Status = FwVolBlockDriverInit (gDxeCoreImageHandle, gDxeCoreST);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
Status = FwVolDriverInit (gDxeCoreImageHandle, gST);
|
Status = FwVolDriverInit (gDxeCoreImageHandle, gDxeCoreST);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Produce the Section Extraction Protocol
|
// Produce the Section Extraction Protocol
|
||||||
//
|
//
|
||||||
Status = InitializeSectionExtraction (gDxeCoreImageHandle, gST);
|
Status = InitializeSectionExtraction (gDxeCoreImageHandle, gDxeCoreST);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -742,11 +742,11 @@ Returns:
|
||||||
Hdr->CRC32 = 0;
|
Hdr->CRC32 = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then
|
// If gDxeCoreBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then
|
||||||
// Crc will come back as zero if we set it to zero here
|
// Crc will come back as zero if we set it to zero here
|
||||||
//
|
//
|
||||||
Crc = 0;
|
Crc = 0;
|
||||||
gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);
|
gDxeCoreBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);
|
||||||
Hdr->CRC32 = Crc;
|
Hdr->CRC32 = Crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -812,24 +812,24 @@ Returns:
|
||||||
//
|
//
|
||||||
// Clear the non-runtime values of the EFI System Table
|
// Clear the non-runtime values of the EFI System Table
|
||||||
//
|
//
|
||||||
gST->BootServices = NULL;
|
gDxeCoreST->BootServices = NULL;
|
||||||
gST->ConIn = NULL;
|
gDxeCoreST->ConIn = NULL;
|
||||||
gST->ConsoleInHandle = NULL;
|
gDxeCoreST->ConsoleInHandle = NULL;
|
||||||
gST->ConOut = NULL;
|
gDxeCoreST->ConOut = NULL;
|
||||||
gST->ConsoleOutHandle = NULL;
|
gDxeCoreST->ConsoleOutHandle = NULL;
|
||||||
gST->StdErr = NULL;
|
gDxeCoreST->StdErr = NULL;
|
||||||
gST->StandardErrorHandle = NULL;
|
gDxeCoreST->StandardErrorHandle = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Recompute the 32-bit CRC of the EFI System Table
|
// Recompute the 32-bit CRC of the EFI System Table
|
||||||
//
|
//
|
||||||
CalculateEfiHdrCrc (&gST->Hdr);
|
CalculateEfiHdrCrc (&gDxeCoreST->Hdr);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Zero out the Boot Service Table
|
// Zero out the Boot Service Table
|
||||||
//
|
//
|
||||||
SetMem (gBS, sizeof (EFI_BOOT_SERVICES), 0);
|
SetMem (gDxeCoreBS, sizeof (EFI_BOOT_SERVICES), 0);
|
||||||
gBS = NULL;
|
gDxeCoreBS = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update the AtRuntime field in Runtiem AP.
|
// Update the AtRuntime field in Runtiem AP.
|
||||||
|
|
|
@ -181,10 +181,10 @@ Returns:
|
||||||
// It's over kill to do them all every time, but it saves a lot of code.
|
// It's over kill to do them all every time, but it saves a lot of code.
|
||||||
//
|
//
|
||||||
if (Found) {
|
if (Found) {
|
||||||
CalculateEfiHdrCrc (&gRT->Hdr);
|
CalculateEfiHdrCrc (&gDxeCoreRT->Hdr);
|
||||||
CalculateEfiHdrCrc (&gBS->Hdr);
|
CalculateEfiHdrCrc (&gDxeCoreBS->Hdr);
|
||||||
CalculateEfiHdrCrc (&gST->Hdr);
|
CalculateEfiHdrCrc (&gDxeCoreST->Hdr);
|
||||||
CalculateEfiHdrCrc (&gDS->Hdr);
|
CalculateEfiHdrCrc (&gDxeCoreDS->Hdr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*++
|
/*++
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2007, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -455,7 +455,7 @@ Returns:
|
||||||
Prot = NULL;
|
Prot = NULL;
|
||||||
Handle = NULL;
|
Handle = NULL;
|
||||||
|
|
||||||
ASSERT (NULL != gBS);
|
ASSERT (NULL != gDxeCoreBS);
|
||||||
|
|
||||||
if (*UserHandle != NULL_HANDLE) {
|
if (*UserHandle != NULL_HANDLE) {
|
||||||
Status = CoreHandleProtocol (*UserHandle, Protocol, (VOID **)&ExistingInterface);
|
Status = CoreHandleProtocol (*UserHandle, Protocol, (VOID **)&ExistingInterface);
|
||||||
|
|
|
@ -132,7 +132,7 @@ Returns:
|
||||||
Image->ImageBasePage = DxeCoreImageBaseAddress;
|
Image->ImageBasePage = DxeCoreImageBaseAddress;
|
||||||
Image->NumberOfPages = (UINTN)(EFI_SIZE_TO_PAGES((UINTN)(DxeCoreImageLength)));
|
Image->NumberOfPages = (UINTN)(EFI_SIZE_TO_PAGES((UINTN)(DxeCoreImageLength)));
|
||||||
Image->Tpl = gEfiCurrentTpl;
|
Image->Tpl = gEfiCurrentTpl;
|
||||||
Image->Info.SystemTable = gST;
|
Image->Info.SystemTable = gDxeCoreST;
|
||||||
Image->Info.ImageBase = (VOID *)(UINTN)DxeCoreImageBaseAddress;
|
Image->Info.ImageBase = (VOID *)(UINTN)DxeCoreImageBaseAddress;
|
||||||
Image->Info.ImageSize = DxeCoreImageLength;
|
Image->Info.ImageSize = DxeCoreImageLength;
|
||||||
|
|
||||||
|
@ -650,7 +650,7 @@ Returns:
|
||||||
// Initialize the fields for an internal driver
|
// Initialize the fields for an internal driver
|
||||||
//
|
//
|
||||||
Image->Signature = LOADED_IMAGE_PRIVATE_DATA_SIGNATURE;
|
Image->Signature = LOADED_IMAGE_PRIVATE_DATA_SIGNATURE;
|
||||||
Image->Info.SystemTable = gST;
|
Image->Info.SystemTable = gDxeCoreST;
|
||||||
Image->Info.DeviceHandle = DeviceHandle;
|
Image->Info.DeviceHandle = DeviceHandle;
|
||||||
Image->Info.Revision = EFI_LOADED_IMAGE_INFORMATION_REVISION;
|
Image->Info.Revision = EFI_LOADED_IMAGE_INFORMATION_REVISION;
|
||||||
Image->Info.FilePath = CoreDuplicateDevicePath (FilePath);
|
Image->Info.FilePath = CoreDuplicateDevicePath (FilePath);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*++
|
/*++
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2007, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -97,7 +97,7 @@ Notes:
|
||||||
//
|
//
|
||||||
mDebugTable = (EFI_SYSTEM_TABLE_POINTER *)(UINTN)Mem;
|
mDebugTable = (EFI_SYSTEM_TABLE_POINTER *)(UINTN)Mem;
|
||||||
mDebugTable->Signature = EFI_SYSTEM_TABLE_SIGNATURE;
|
mDebugTable->Signature = EFI_SYSTEM_TABLE_SIGNATURE;
|
||||||
mDebugTable->EfiSystemTableBase = (EFI_PHYSICAL_ADDRESS) (UINTN) gST;
|
mDebugTable->EfiSystemTableBase = (EFI_PHYSICAL_ADDRESS) (UINTN) gDxeCoreST;
|
||||||
mDebugTable->Crc32 = 0;
|
mDebugTable->Crc32 = 0;
|
||||||
Status = CoreInstallConfigurationTable (&gEfiDebugImageInfoTableGuid, &mDebugInfoTableHeader);
|
Status = CoreInstallConfigurationTable (&gEfiDebugImageInfoTableGuid, &mDebugInfoTableHeader);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
@ -127,7 +127,7 @@ Returns:
|
||||||
{
|
{
|
||||||
ASSERT(mDebugTable != NULL);
|
ASSERT(mDebugTable != NULL);
|
||||||
mDebugTable->Crc32 = 0;
|
mDebugTable->Crc32 = 0;
|
||||||
gBS->CalculateCrc32 ((VOID *)mDebugTable, sizeof (EFI_SYSTEM_TABLE_POINTER), &mDebugTable->Crc32);
|
gDxeCoreBS->CalculateCrc32 ((VOID *)mDebugTable, sizeof (EFI_SYSTEM_TABLE_POINTER), &mDebugTable->Crc32);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*++
|
/*++
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2007, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -54,9 +54,9 @@ Returns:
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
|
||||||
for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
|
for (Index = 0; Index < gDxeCoreST->NumberOfTableEntries; Index++) {
|
||||||
if (CompareGuid (Guid, &(gST->ConfigurationTable[Index].VendorGuid))) {
|
if (CompareGuid (Guid, &(gDxeCoreST->ConfigurationTable[Index].VendorGuid))) {
|
||||||
*Table = gST->ConfigurationTable[Index].VendorTable;
|
*Table = gDxeCoreST->ConfigurationTable[Index].VendorTable;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,18 +104,18 @@ Returns:
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
EfiConfigurationTable = gST->ConfigurationTable;
|
EfiConfigurationTable = gDxeCoreST->ConfigurationTable;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Search all the table for an entry that matches Guid
|
// Search all the table for an entry that matches Guid
|
||||||
//
|
//
|
||||||
for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
|
for (Index = 0; Index < gDxeCoreST->NumberOfTableEntries; Index++) {
|
||||||
if (CompareGuid (Guid, &(gST->ConfigurationTable[Index].VendorGuid))) {
|
if (CompareGuid (Guid, &(gDxeCoreST->ConfigurationTable[Index].VendorGuid))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Index < gST->NumberOfTableEntries) {
|
if (Index < gDxeCoreST->NumberOfTableEntries) {
|
||||||
//
|
//
|
||||||
// A match was found, so this is either a modify or a delete operation
|
// A match was found, so this is either a modify or a delete operation
|
||||||
//
|
//
|
||||||
|
@ -124,22 +124,22 @@ Returns:
|
||||||
// If Table is not NULL, then this is a modify operation.
|
// If Table is not NULL, then this is a modify operation.
|
||||||
// Modify the table enty and return.
|
// Modify the table enty and return.
|
||||||
//
|
//
|
||||||
gST->ConfigurationTable[Index].VendorTable = Table;
|
gDxeCoreST->ConfigurationTable[Index].VendorTable = Table;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// A match was found and Table is NULL, so this is a delete operation.
|
// A match was found and Table is NULL, so this is a delete operation.
|
||||||
//
|
//
|
||||||
gST->NumberOfTableEntries--;
|
gDxeCoreST->NumberOfTableEntries--;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Copy over deleted entry
|
// Copy over deleted entry
|
||||||
//
|
//
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&(EfiConfigurationTable[Index]),
|
&(EfiConfigurationTable[Index]),
|
||||||
&(gST->ConfigurationTable[Index + 1]),
|
&(gDxeCoreST->ConfigurationTable[Index + 1]),
|
||||||
(gST->NumberOfTableEntries - Index) * sizeof (EFI_CONFIGURATION_TABLE)
|
(gDxeCoreST->NumberOfTableEntries - Index) * sizeof (EFI_CONFIGURATION_TABLE)
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -156,7 +156,7 @@ Returns:
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Assume that Index == gST->NumberOfTableEntries
|
// Assume that Index == gDxeCoreST->NumberOfTableEntries
|
||||||
//
|
//
|
||||||
if ((Index * sizeof (EFI_CONFIGURATION_TABLE)) >= mSystemTableAllocateSize) {
|
if ((Index * sizeof (EFI_CONFIGURATION_TABLE)) >= mSystemTableAllocateSize) {
|
||||||
//
|
//
|
||||||
|
@ -171,26 +171,26 @@ Returns:
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gST->ConfigurationTable != NULL) {
|
if (gDxeCoreST->ConfigurationTable != NULL) {
|
||||||
//
|
//
|
||||||
// Copy the old table to the new table.
|
// Copy the old table to the new table.
|
||||||
//
|
//
|
||||||
CopyMem (
|
CopyMem (
|
||||||
EfiConfigurationTable,
|
EfiConfigurationTable,
|
||||||
gST->ConfigurationTable,
|
gDxeCoreST->ConfigurationTable,
|
||||||
Index * sizeof (EFI_CONFIGURATION_TABLE)
|
Index * sizeof (EFI_CONFIGURATION_TABLE)
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Free Old Table
|
// Free Old Table
|
||||||
//
|
//
|
||||||
CoreFreePool (gST->ConfigurationTable);
|
CoreFreePool (gDxeCoreST->ConfigurationTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update System Table
|
// Update System Table
|
||||||
//
|
//
|
||||||
gST->ConfigurationTable = EfiConfigurationTable;
|
gDxeCoreST->ConfigurationTable = EfiConfigurationTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -202,13 +202,13 @@ Returns:
|
||||||
//
|
//
|
||||||
// This is an add operation, so increment the number of table entries
|
// This is an add operation, so increment the number of table entries
|
||||||
//
|
//
|
||||||
gST->NumberOfTableEntries++;
|
gDxeCoreST->NumberOfTableEntries++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fix up the CRC-32 in the EFI System Table
|
// Fix up the CRC-32 in the EFI System Table
|
||||||
//
|
//
|
||||||
CalculateEfiHdrCrc (&gST->Hdr);
|
CalculateEfiHdrCrc (&gDxeCoreST->Hdr);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Report Status Code Library for DXE Phase.
|
Report Status Code Library for DXE Phase.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -57,6 +57,9 @@ InternalReportStatusCode (
|
||||||
// in the handle database.
|
// in the handle database.
|
||||||
//
|
//
|
||||||
if (gStatusCode == NULL) {
|
if (gStatusCode == NULL) {
|
||||||
|
if (gBS == NULL) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
|
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
|
||||||
if (EFI_ERROR (Status) || gStatusCode == NULL) {
|
if (EFI_ERROR (Status) || gStatusCode == NULL) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
|
@ -476,6 +479,10 @@ ReportStatusCodeEx (
|
||||||
ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
|
ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
|
||||||
ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
|
ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
|
||||||
|
|
||||||
|
if (gBS == NULL) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate space for the Status Code Header and its buffer
|
// Allocate space for the Status Code Header and its buffer
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
UEFI Boot Services Table Library.
|
UEFI Boot Services Table Library.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -14,9 +14,9 @@
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
EFI_HANDLE gImageHandle;
|
EFI_HANDLE gImageHandle = NULL;
|
||||||
EFI_SYSTEM_TABLE *gST;
|
EFI_SYSTEM_TABLE *gST = NULL;
|
||||||
EFI_BOOT_SERVICES *gBS;
|
EFI_BOOT_SERVICES *gBS = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The constructor function caches the pointer of Boot Services Table.
|
The constructor function caches the pointer of Boot Services Table.
|
||||||
|
@ -43,6 +43,7 @@ UefiBootServicesTableLibConstructor (
|
||||||
// Cache the Image Handle
|
// Cache the Image Handle
|
||||||
//
|
//
|
||||||
gImageHandle = ImageHandle;
|
gImageHandle = ImageHandle;
|
||||||
|
ASSERT (gImageHandle != NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cache pointer to the EFI System Table
|
// Cache pointer to the EFI System Table
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
UEFI Debug Library that uses PrintLib to send messages to CONOUT.
|
UEFI Debug Library that uses PrintLib to send messages to CONOUT.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -65,7 +65,7 @@ DebugPrint (
|
||||||
//
|
//
|
||||||
// Send the print string to the Console Output device
|
// Send the print string to the Console Output device
|
||||||
//
|
//
|
||||||
if (gST->ConOut != NULL) {
|
if ((gST != NULL) && (gST->ConOut != NULL)) {
|
||||||
gST->ConOut->OutputString (gST->ConOut, Buffer);
|
gST->ConOut->OutputString (gST->ConOut, Buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ DebugAssert (
|
||||||
//
|
//
|
||||||
// Send the print string to the Console Output device
|
// Send the print string to the Console Output device
|
||||||
//
|
//
|
||||||
if (gST->ConOut != NULL) {
|
if ((gST != NULL) && (gST->ConOut != NULL)) {
|
||||||
gST->ConOut->OutputString (gST->ConOut, Buffer);
|
gST->ConOut->OutputString (gST->ConOut, Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
UEFI Debug Library that uses PrintLib to send messages to STDERR.
|
UEFI Debug Library that uses PrintLib to send messages to STDERR.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation<BR>
|
Copyright (c) 2006 - 2007, Intel Corporation<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -65,7 +65,7 @@ DebugPrint (
|
||||||
//
|
//
|
||||||
// Send the print string to the Standard Error device
|
// Send the print string to the Standard Error device
|
||||||
//
|
//
|
||||||
if (gST->StdErr != NULL) {
|
if ((gST != NULL) && (gST->StdErr != NULL)) {
|
||||||
gST->StdErr->OutputString (gST->StdErr, Buffer);
|
gST->StdErr->OutputString (gST->StdErr, Buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ DebugAssert (
|
||||||
//
|
//
|
||||||
// Send the print string to the Standard Error device
|
// Send the print string to the Standard Error device
|
||||||
//
|
//
|
||||||
if (gST->StdErr != NULL) {
|
if ((gST != NULL) && (gST->StdErr != NULL)) {
|
||||||
gST->StdErr->OutputString (gST->StdErr, Buffer);
|
gST->StdErr->OutputString (gST->StdErr, Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue