]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/StatusCode/StatusCode.c
Add PeiCore module for enabling NT32Pkg, please attention this PeiCore does follows...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / StatusCode / StatusCode.c
diff --git a/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c b/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c
new file mode 100644 (file)
index 0000000..9112c45
--- /dev/null
@@ -0,0 +1,100 @@
+/*++\r
+\r
+Copyright (c) 2006, 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
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+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
+Module Name:\r
+\r
+  StatusCode.c\r
+\r
+Abstract:\r
+\r
+  Pei Core Status Code Support\r
+\r
+Revision History\r
+\r
+--*/\r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "CommonHeader.h"\r
+\r
+#include <PeiMain.h>\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+PeiReportStatusCode (\r
+  IN EFI_PEI_SERVICES         **PeiServices,\r
+  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
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Core version of the Status Code reporter\r
+\r
+Arguments:\r
+\r
+  PeiServices - The PEI core services table.\r
+  \r
+  CodeType    - Type of Status Code.\r
+  \r
+  Value       - Value to output for Status Code.\r
+  \r
+  Instance    - Instance Number of this status code.\r
+  \r
+  CallerId    - ID of the caller of this status code.\r
+  \r
+  Data        - Optional data associated with this status code.\r
+\r
+Returns:\r
+\r
+  Status  - EFI_SUCCESS             if status code is successfully reported\r
+          - EFI_NOT_AVAILABLE_YET   if StatusCodePpi has not been installed\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                Status;\r
+  EFI_PEI_PROGRESS_CODE_PPI *StatusCodePpi;\r
+  \r
+\r
+  //\r
+  //Locate StatusCode Ppi.\r
+  //\r
+  Status = PeiServicesLocatePpi (\r
+             &gEfiPeiStatusCodePpiGuid,         \r
+             0,                         \r
+             NULL,                      \r
+             (VOID **)&StatusCodePpi                  \r
+             );\r
+\r
+  if (!EFI_ERROR (Status)) {\r
+    Status = StatusCodePpi->ReportStatusCode (\r
+                            PeiServices,\r
+                            CodeType,\r
+                            Value,\r
+                            Instance,\r
+                            CallerId,\r
+                            Data\r
+                            );\r
\r
+   return Status;   \r
+  } \r
+  \r
+  \r
+  return  EFI_NOT_AVAILABLE_YET; \r
+}\r
+\r
+\r
+\r