Removed IntelFrameworkPkg references from SEC

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3489 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
AJFISH 2007-07-27 16:55:19 +00:00
parent 501c21756b
commit d0dc913e41
3 changed files with 26 additions and 108 deletions

@ -33,7 +33,7 @@ Abstract:
--*/
#include "SecMain.h"
#pragma warning(disable : 4996)
//
// Globals
@ -420,71 +420,9 @@ 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;
}
EFI_STATUS
EFIAPI
SecPeiReportStatusCode (
@ -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
//
// The first 12 * UINT64 bytes of the string are really an
// arguement stack to support varargs on the Format string.
//
if (Data != NULL) {
DebugInfo = (EFI_DEBUG_INFO *) (Data + 1);
Marker = (VA_LIST) (DebugInfo + 1);
Format = (CHAR8 *) (((UINT64 *) Marker) + 12);
AsciiVSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker);
printf (PrintBuffer);
} else {
printf ("DEBUG <null>\n");
}
}
if (Data == NULL) {
} else if (ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {
//
// Processes ASSERT ()
//
printf ("ASSERT %s(%d): %s\n", Filename, LineNumber, Description);
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 <null>\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)

@ -21,7 +21,7 @@ Abstract:
#include <stdio.h>
#include <Base.h>
#include <PiPei.h>
#include <FrameworkPei.h>
#include <PiDxe.h>
#include <WinNtPeim.h>
#include <Library/BaseLib.h>
#include <Library/PeCoffLib.h>
@ -35,6 +35,10 @@ Abstract:
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <IndustryStandard/PeImage.h>
#define STACK_SIZE 0x20000

@ -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