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:
qwang12
2007-04-06 06:36:47 +00:00
parent 18fda0cec0
commit abb234751e
11 changed files with 82 additions and 74 deletions

View File

@ -1,7 +1,7 @@
/** @file
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
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
@ -57,6 +57,9 @@ InternalReportStatusCode (
// in the handle database.
//
if (gStatusCode == NULL) {
if (gBS == NULL) {
return EFI_UNSUPPORTED;
}
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
if (EFI_ERROR (Status) || gStatusCode == NULL) {
return EFI_UNSUPPORTED;
@ -476,6 +479,10 @@ ReportStatusCodeEx (
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
//