Fix EDKT497. In the patch:

1) Check TPL<=TPL_CALLBACK prior to invoking SerialIO protocol.
2) Check TPL <= TPL_NOTIFY prior to allocate memory in datahub status code driver.
3) Add lock to prevent the critical data.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2225 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
yshang1
2007-01-12 02:41:42 +00:00
parent affa5a128c
commit 35d4cd92bd
3 changed files with 61 additions and 19 deletions

View File

@ -90,10 +90,19 @@ SerialStatusCodeReportWorker (
UINTN CharCount;
VA_LIST Marker;
EFI_DEBUG_INFO *DebugInfo;
EFI_TPL CurrentTpl;
if (FeaturePcdGet (PcdStatusCodeUseEfiSerial) && EfiAtRuntime ()) {
return EFI_DEVICE_ERROR;
if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {
if (EfiAtRuntime ()) {
return EFI_DEVICE_ERROR;
}
CurrentTpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);
gBS->RestoreTPL (CurrentTpl);
if (CurrentTpl > EFI_TPL_CALLBACK ) {
return EFI_DEVICE_ERROR;
}
}
Buffer[0] = '\0';