From d0dc913e4195d22f49ab548ff850e60e4860a0c1 Mon Sep 17 00:00:00 2001 From: AJFISH Date: Fri, 27 Jul 2007 16:55:19 +0000 Subject: [PATCH] Removed IntelFrameworkPkg references from SEC git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3489 6f19259b-4bc3-4df7-8a09-765794883524 --- Nt32Pkg/Sec/SecMain.c | 115 ++++++---------------------------------- Nt32Pkg/Sec/SecMain.h | 6 ++- Nt32Pkg/Sec/SecMain.inf | 11 ++-- 3 files changed, 25 insertions(+), 107 deletions(-) diff --git a/Nt32Pkg/Sec/SecMain.c b/Nt32Pkg/Sec/SecMain.c index 3d2d4279e8..be30d2611d 100644 --- a/Nt32Pkg/Sec/SecMain.c +++ b/Nt32Pkg/Sec/SecMain.c @@ -33,7 +33,7 @@ Abstract: --*/ #include "SecMain.h" -#pragma warning(disable : 4996) + // // Globals @@ -420,70 +420,8 @@ Returns: return EFI_SUCCESS; } -#define BYTES_PER_RECORD 512 -/** - Extracts ASSERT() information from a status code structure. - - Converts the status code specified by CodeType, Value, and Data to the ASSERT() - arguments specified by Filename, Description, and LineNumber. If CodeType is - an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and - Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract - Filename, Description, and LineNumber from the optional data area of the - status code buffer specified by Data. The optional data area of Data contains - a Null-terminated ASCII string for the FileName, followed by a Null-terminated - ASCII string for the Description, followed by a 32-bit LineNumber. If the - ASSERT() information could be extracted from Data, then return TRUE. - Otherwise, FALSE is returned. - - If Data is NULL, then ASSERT(). - If Filename is NULL, then ASSERT(). - If Description is NULL, then ASSERT(). - If LineNumber is NULL, then ASSERT(). - - @param CodeType The type of status code being converted. - @param Value The status code value being converted. - @param Data Pointer to status code data buffer. - @param Filename Pointer to the source file name that generated the ASSERT(). - @param Description Pointer to the description of the ASSERT(). - @param LineNumber Pointer to source line number that generated the ASSERT(). - - @retval TRUE The status code specified by CodeType, Value, and Data was - converted ASSERT() arguments specified by Filename, Description, - and LineNumber. - @retval FALSE The status code specified by CodeType, Value, and Data could - not be converted to ASSERT() arguments. - -**/ -STATIC -BOOLEAN -ReportStatusCodeExtractAssertInfo ( - IN EFI_STATUS_CODE_TYPE CodeType, - IN EFI_STATUS_CODE_VALUE Value, - IN CONST EFI_STATUS_CODE_DATA *Data, - OUT CHAR8 **Filename, - OUT CHAR8 **Description, - OUT UINT32 *LineNumber - ) -{ - EFI_DEBUG_ASSERT_DATA *AssertData; - - ASSERT (Data != NULL); - ASSERT (Filename != NULL); - ASSERT (Description != NULL); - ASSERT (LineNumber != NULL); - - if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) && - ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) && - ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) { - AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1); - *Filename = (CHAR8 *)(AssertData + 1); - *Description = *Filename + AsciiStrLen (*Filename) + 1; - *LineNumber = AssertData->LineNumber; - return TRUE; - } - return FALSE; -} +#define BYTES_PER_RECORD 512 EFI_STATUS EFIAPI @@ -492,8 +430,8 @@ SecPeiReportStatusCode ( IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, - IN EFI_GUID * CallerId, - IN EFI_STATUS_CODE_DATA * Data OPTIONAL + IN EFI_GUID *CallerId, + IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) /*++ @@ -520,47 +458,27 @@ Returns: // TODO: Data - add argument and description to function comment { CHAR8 *Format; - EFI_DEBUG_INFO *DebugInfo; VA_LIST Marker; CHAR8 PrintBuffer[BYTES_PER_RECORD * 2]; CHAR8 *Filename; CHAR8 *Description; UINT32 LineNumber; + UINT32 ErrorLevel; - if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) { - // - // This supports DEBUG () marcos - // Data format - // EFI_STATUS_CODE_DATA - // EFI_DEBUG_INFO + + if (Data == NULL) { + } else if (ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) { // - // The first 12 * UINT64 bytes of the string are really an - // arguement stack to support varargs on the Format string. + // Processes ASSERT () // - if (Data != NULL) { - DebugInfo = (EFI_DEBUG_INFO *) (Data + 1); - Marker = (VA_LIST) (DebugInfo + 1); - Format = (CHAR8 *) (((UINT64 *) Marker) + 12); + printf ("ASSERT %s(%d): %s\n", Filename, LineNumber, Description); - AsciiVSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker); - printf (PrintBuffer); - } else { - printf ("DEBUG \n"); - } - } - - if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) && - ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) - ) { - if (Data != NULL && ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) { - // - // Support ASSERT () macro - // - printf ("ASSERT %s(%d): %s\n", Filename, LineNumber, Description); - } else { - printf ("ASSERT \n"); - } - CpuBreakpoint (); + } else if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) { + // + // Process DEBUG () macro + // + AsciiVSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker); + printf (PrintBuffer); } return EFI_SUCCESS; @@ -1233,4 +1151,3 @@ _ModuleEntryPoint ( { } -#pragma warning(default : 4996) diff --git a/Nt32Pkg/Sec/SecMain.h b/Nt32Pkg/Sec/SecMain.h index 7862dcd7eb..e210a719f2 100644 --- a/Nt32Pkg/Sec/SecMain.h +++ b/Nt32Pkg/Sec/SecMain.h @@ -21,7 +21,7 @@ Abstract: #include #include #include -#include +#include #include #include #include @@ -35,6 +35,10 @@ Abstract: #include #include #include +#include + +#include + #define STACK_SIZE 0x20000 diff --git a/Nt32Pkg/Sec/SecMain.inf b/Nt32Pkg/Sec/SecMain.inf index af499a5596..656b2591eb 100644 --- a/Nt32Pkg/Sec/SecMain.inf +++ b/Nt32Pkg/Sec/SecMain.inf @@ -2,8 +2,8 @@ # Entry Point of NT32 Emulator # # Main executable file of NT32 Emulator that loads PEI core after initialization finished. -# Copyright (c) 2007, Intel Corporation # +# Copyright (c) 2007, 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 @@ -11,7 +11,6 @@ # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # -# #**/ [Defines] @@ -36,12 +35,10 @@ FwVol.c SecMain.c - [Packages] - Nt32Pkg/Nt32Pkg.dec - MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec + MdeModulePkg/MdeModulePkg.dec + Nt32Pkg/Nt32Pkg.dec [LibraryClasses] DebugLib @@ -50,7 +47,7 @@ BaseMemoryLib BaseLib PeCoffLib - + ReportStatusCodeLib [Guids] gEfiPeiPeCoffLoaderGuid # ALWAYS_PRODUCED -- 2.39.2