MonoStatusCode.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*++
  2. Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. Module Name:
  5. MonoStatusCode.h
  6. Abstract:
  7. Monolithic single PEIM to provide the status code functionality.
  8. The PEIM is a blend of libraries that correspond to the different status code
  9. listeners that a platform installs.
  10. --*/
  11. #ifndef _MONO_STATUS_CODE_H_
  12. #define _MONO_STATUS_CODE_H_
  13. //
  14. // Statements that include other files.
  15. //
  16. #include <PiPei.h>
  17. #include <Pi/PiBootMode.h>
  18. #include <Ppi/StatusCode.h>
  19. #include <Ppi/MemoryDiscovered.h>
  20. #include <Library/HobLib.h>
  21. #include <Library/DebugLib.h>
  22. #include <Library/IoLib.h>
  23. #include <Library/SerialPortLib.h>
  24. #include <Protocol/StatusCode.h>
  25. //
  26. // Platform specific function Declarations. These must be implemented in a
  27. // subdirectory named PlatformName in a file named PlatformStatusCode.c.
  28. //
  29. //
  30. // This is the platform function to initialize the listeners desired by the
  31. // platform.
  32. //
  33. VOID
  34. PlatformInitializeStatusCode (
  35. IN EFI_FFS_FILE_HEADER *FfsHeader,
  36. IN CONST EFI_PEI_SERVICES **PeiServices
  37. );
  38. //
  39. // This is the platform function that calls all of the listeners desired by the
  40. // platform.
  41. //
  42. EFI_STATUS
  43. EFIAPI
  44. PlatformReportStatusCode (
  45. IN CONST EFI_PEI_SERVICES **PeiServices,
  46. IN EFI_STATUS_CODE_TYPE CodeType,
  47. IN EFI_STATUS_CODE_VALUE Value,
  48. IN UINT32 Instance,
  49. IN CONST EFI_GUID * CallerId,
  50. IN CONST EFI_STATUS_CODE_DATA * Data OPTIONAL
  51. );
  52. //
  53. // Platform independent function Declarations
  54. //
  55. //
  56. // Initialize the status code listeners and publish the status code PPI.
  57. //
  58. VOID
  59. EFIAPI
  60. InitializeMonoStatusCode (
  61. IN EFI_FFS_FILE_HEADER *FfsHeader,
  62. IN const EFI_PEI_SERVICES **PeiServices
  63. );
  64. //
  65. // Convert a DXE status code call into a PEI status code call.
  66. //
  67. EFI_STATUS
  68. EFIAPI
  69. TranslateDxeStatusCodeToPeiStatusCode (
  70. IN EFI_STATUS_CODE_TYPE CodeType,
  71. IN EFI_STATUS_CODE_VALUE Value,
  72. IN UINT32 Instance,
  73. IN EFI_GUID * CallerId,
  74. IN EFI_STATUS_CODE_DATA * Data OPTIONAL
  75. );
  76. //
  77. // Publish a HOB that contains the listener to be used by DXE.
  78. //
  79. EFI_STATUS
  80. EFIAPI
  81. InitializeDxeReportStatusCode (
  82. IN const EFI_PEI_SERVICES **PeiServices
  83. );
  84. #endif