]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Removed IntelFrameworkPkg references from SEC
authorAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 27 Jul 2007 16:55:19 +0000 (16:55 +0000)
committerAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 27 Jul 2007 16:55:19 +0000 (16:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3489 6f19259b-4bc3-4df7-8a09-765794883524

Nt32Pkg/Sec/SecMain.c
Nt32Pkg/Sec/SecMain.h
Nt32Pkg/Sec/SecMain.inf

index 3d2d4279e8c05d5be273fd666955c082291f9ce3..be30d2611d789546ce1abc310da1b96f46ef8266 100644 (file)
@@ -33,7 +33,7 @@ Abstract:
 --*/\r
 \r
 #include "SecMain.h"\r
-#pragma warning(disable : 4996)\r
+\r
 \r
 //\r
 // Globals\r
@@ -420,70 +420,8 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-#define BYTES_PER_RECORD  512\r
 \r
-/**\r
-  Extracts ASSERT() information from a status code structure.\r
-\r
-  Converts the status code specified by CodeType, Value, and Data to the ASSERT()\r
-  arguments specified by Filename, Description, and LineNumber.  If CodeType is \r
-  an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and \r
-  Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract \r
-  Filename, Description, and LineNumber from the optional data area of the \r
-  status code buffer specified by Data.  The optional data area of Data contains \r
-  a Null-terminated ASCII string for the FileName, followed by a Null-terminated \r
-  ASCII string for the Description, followed by a 32-bit LineNumber.  If the \r
-  ASSERT() information could be extracted from Data, then return TRUE.  \r
-  Otherwise, FALSE is returned.  \r
-\r
-  If Data is NULL, then ASSERT().\r
-  If Filename is NULL, then ASSERT().\r
-  If Description is NULL, then ASSERT().\r
-  If LineNumber is NULL, then ASSERT().\r
-\r
-  @param  CodeType     The type of status code being converted.\r
-  @param  Value        The status code value being converted.\r
-  @param  Data         Pointer to status code data buffer. \r
-  @param  Filename     Pointer to the source file name that generated the ASSERT().\r
-  @param  Description  Pointer to the description of the ASSERT().\r
-  @param  LineNumber   Pointer to source line number that generated the ASSERT().\r
-\r
-  @retval  TRUE   The status code specified by CodeType, Value, and Data was \r
-                  converted ASSERT() arguments specified by Filename, Description, \r
-                  and LineNumber.\r
-  @retval  FALSE  The status code specified by CodeType, Value, and Data could \r
-                  not be converted to ASSERT() arguments.\r
-\r
-**/\r
-STATIC\r
-BOOLEAN\r
-ReportStatusCodeExtractAssertInfo (\r
-  IN EFI_STATUS_CODE_TYPE        CodeType,\r
-  IN EFI_STATUS_CODE_VALUE       Value,  \r
-  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
-  OUT CHAR8                      **Filename,\r
-  OUT CHAR8                      **Description,\r
-  OUT UINT32                     *LineNumber\r
-  )\r
-{\r
-  EFI_DEBUG_ASSERT_DATA  *AssertData;\r
-\r
-  ASSERT (Data        != NULL);\r
-  ASSERT (Filename    != NULL);\r
-  ASSERT (Description != NULL);\r
-  ASSERT (LineNumber  != NULL);\r
-\r
-  if (((CodeType & EFI_STATUS_CODE_TYPE_MASK)      == EFI_ERROR_CODE) && \r
-      ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK)  == EFI_ERROR_UNRECOVERED) &&\r
-      ((Value    & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) {\r
-    AssertData   = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);\r
-    *Filename    = (CHAR8 *)(AssertData + 1);\r
-    *Description = *Filename + AsciiStrLen (*Filename) + 1;\r
-    *LineNumber  = AssertData->LineNumber;\r
-    return TRUE;\r
-  }\r
-  return FALSE;\r
-}\r
+#define BYTES_PER_RECORD  512\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -492,8 +430,8 @@ SecPeiReportStatusCode (
   IN EFI_STATUS_CODE_TYPE       CodeType,\r
   IN EFI_STATUS_CODE_VALUE      Value,\r
   IN UINT32                     Instance,\r
-  IN EFI_GUID                   * CallerId,\r
-  IN EFI_STATUS_CODE_DATA       * Data OPTIONAL\r
+  IN EFI_GUID                   *CallerId,\r
+  IN EFI_STATUS_CODE_DATA       *Data OPTIONAL\r
   )\r
 /*++\r
 \r
@@ -520,47 +458,27 @@ Returns:
 // TODO:    Data - add argument and description to function comment\r
 {\r
   CHAR8           *Format;\r
-  EFI_DEBUG_INFO  *DebugInfo;\r
   VA_LIST         Marker;\r
   CHAR8           PrintBuffer[BYTES_PER_RECORD * 2];\r
   CHAR8           *Filename;\r
   CHAR8           *Description;\r
   UINT32          LineNumber;\r
+  UINT32          ErrorLevel;\r
 \r
-  if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
-    //\r
-    // This supports DEBUG () marcos\r
-    // Data format\r
-    //  EFI_STATUS_CODE_DATA\r
-    //  EFI_DEBUG_INFO\r
+\r
+  if (Data == NULL) {\r
+  } else if (ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
     //\r
-    // The first 12 * UINT64 bytes of the string are really an\r
-    // arguement stack to support varargs on the Format string.\r
+    // Processes ASSERT ()\r
     //\r
-    if (Data != NULL) {\r
-      DebugInfo = (EFI_DEBUG_INFO *) (Data + 1);\r
-      Marker    = (VA_LIST) (DebugInfo + 1);\r
-      Format    = (CHAR8 *) (((UINT64 *) Marker) + 12);\r
+    printf ("ASSERT %s(%d): %s\n", Filename, LineNumber, Description);\r
 \r
-      AsciiVSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker);\r
-      printf (PrintBuffer);\r
-    } else {\r
-      printf ("DEBUG <null>\n");\r
-    }\r
-  }\r
-\r
-  if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&\r
-      ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED)\r
-      ) {\r
-    if (Data != NULL && ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
-      //\r
-      // Support ASSERT () macro\r
-      //\r
-      printf ("ASSERT %s(%d): %s\n", Filename, LineNumber, Description);\r
-    } else {\r
-      printf ("ASSERT <null>\n");\r
-    }\r
-    CpuBreakpoint ();\r
+  } else if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
+    //\r
+    // Process DEBUG () macro \r
+    //\r
+    AsciiVSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker);\r
+    printf (PrintBuffer);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -1233,4 +1151,3 @@ _ModuleEntryPoint (
 {\r
 }\r
 \r
-#pragma warning(default : 4996)\r
index 7862dcd7eb2834feca85ac24eafdb9fe0883990f..e210a719f2642d1a93b8236385b25dc7e8d705e5 100644 (file)
@@ -21,7 +21,7 @@ Abstract:
 #include <stdio.h>\r
 #include <Base.h>\r
 #include <PiPei.h>\r
-#include <FrameworkPei.h>\r
+#include <PiDxe.h>\r
 #include <WinNtPeim.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PeCoffLib.h>\r
@@ -35,6 +35,10 @@ Abstract:
 #include <Library/DebugLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+\r
+#include <IndustryStandard/PeImage.h>\r
+\r
 \r
 #define STACK_SIZE                0x20000      \r
 \r
index af499a559610c9994b1b8392a94bc608c07b1b6d..656b2591eb1e0ac32fb03150819c245548e11beb 100644 (file)
@@ -2,8 +2,8 @@
 # Entry Point of NT32 Emulator\r
 #\r
 # Main executable file of NT32 Emulator that loads PEI core after initialization finished.\r
-# Copyright (c) 2007, Intel Corporation\r
 #\r
+#  Copyright (c) 2007, Intel Corporation\r
 #  All rights reserved. This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution. The full text of the license may be found at\r
@@ -11,7 +11,6 @@
 #  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
-#\r
 #**/\r
 \r
 [Defines]\r
   FwVol.c\r
   SecMain.c\r
 \r
-\r
 [Packages]\r
-  Nt32Pkg/Nt32Pkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
   MdePkg/MdePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  Nt32Pkg/Nt32Pkg.dec\r
 \r
 [LibraryClasses]\r
   DebugLib\r
@@ -50,7 +47,7 @@
   BaseMemoryLib\r
   BaseLib\r
   PeCoffLib\r
-\r
+  ReportStatusCodeLib\r
 \r
 [Guids]\r
   gEfiPeiPeCoffLoaderGuid                       # ALWAYS_PRODUCED\r