From e5c1acc536ef394d4edca82093f1373889891a9f Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Tue, 12 Jun 2012 04:46:33 +0000 Subject: To be consistent with PeiReportStatusCodeLib and DxeReportStatusCode, use MAX_EXTENDED_DATA_SIZE (0x200) as the local max buffer size in RuntimeDxeReportStatusCodeLib. Signed-off-by: Star Zeng Reviewed-by: Liming Gao git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13444 6f19259b-4bc3-4df7-8a09-765794883524 --- .../RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c index f6b7ee756b..e533af3d33 100644 --- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -1,7 +1,7 @@ /** @file API implementation for instance of Report Status Code Library. - Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2012, Intel Corporation. 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 @@ -27,6 +27,12 @@ #include #include + +// +// Define the maximum extended data size that is supported when a status code is reported. +// +#define MAX_EXTENDED_DATA_SIZE 0x200 + EFI_STATUS_CODE_PROTOCOL *mReportStatusCodeLibStatusCodeProtocol = NULL; EFI_EVENT mReportStatusCodeLibVirtualAddressChangeEvent; EFI_EVENT mReportStatusCodeLibExitBootServicesEvent; @@ -621,13 +627,13 @@ ReportStatusCodeEx ( { EFI_STATUS Status; EFI_STATUS_CODE_DATA *StatusCodeData; - UINT8 StatusCodeBuffer[EFI_STATUS_CODE_DATA_MAX_SIZE]; + UINT64 StatusCodeBuffer[(MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)) + 1]; ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0))); ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0))); if (mHaveExitedBootServices) { - if (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize > EFI_STATUS_CODE_DATA_MAX_SIZE) { + if (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize > MAX_EXTENDED_DATA_SIZE) { return EFI_OUT_OF_RESOURCES; } StatusCodeData = (EFI_STATUS_CODE_DATA *) StatusCodeBuffer; -- cgit v1.2.3