ExStatusCodeHandlerPei.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /** @file
  2. @copyright
  3. Copyright 2017 - 2021 Intel Corporation. <BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EX_STATUS_CODE_HANDLER_PEI_H__
  7. #define __EX_STATUS_CODE_HANDLER_PEI_H__
  8. #include <Ppi/ReportStatusCodeHandler.h>
  9. #include <Ppi/ExReportStatusCodeHandler.h>
  10. #include <Guid/StatusCodeDataTypeId.h>
  11. #include <Guid/StatusCodeDataTypeDebug.h>
  12. #include <Guid/StatusCodeDataTypeExDebug.h>
  13. #include <Library/DebugLib.h>
  14. #include <Library/DebugPrintErrorLevelLib.h>
  15. #include <Library/PrintLib.h>
  16. #include <Library/ReportStatusCodeLib.h>
  17. #include <Library/SerialPortLib.h>
  18. #include <Library/HobLib.h>
  19. #include <Library/PcdLib.h>
  20. #include <Library/PeiServicesLib.h>
  21. #include <Library/PeimEntryPoint.h>
  22. #include <Library/BaseMemoryLib.h>
  23. #include <Library/SemaphoreLib.h>
  24. /**
  25. Registers ExSerialStatusCodeReportWorker as callback function for ReportStatusCode() notification.
  26. @param[in] PeiServices Pointer to PEI Services Table.
  27. @retval EFI_SUCCESS Function was successfully registered.
  28. @retval EFI_INVALID_PARAMETER The callback function was NULL.
  29. @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
  30. registered.
  31. @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
  32. **/
  33. EFI_STATUS
  34. EFIAPI
  35. RegisterExStatusCodeHandler (
  36. IN CONST EFI_PEI_SERVICES **PeiServices
  37. );
  38. /**
  39. Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
  40. @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
  41. @param CodeType Indicates the type of status code being reported.
  42. @param Value Describes the current status of a hardware or
  43. software entity. This includes information about the class and
  44. subclass that is used to classify the entity as well as an operation.
  45. For progress codes, the operation is the current activity.
  46. For error codes, it is the exception.For debug codes,it is not defined at this time.
  47. @param Instance The enumeration of a hardware or software entity within
  48. the system. A system may contain multiple entities that match a class/subclass
  49. pairing. The instance differentiates between them. An instance of 0 indicates
  50. that instance information is unavailable, not meaningful, or not relevant.
  51. Valid instance numbers start with 1.
  52. @param CallerId This optional parameter may be used to identify the caller.
  53. This parameter allows the status code driver to apply different rules to
  54. different callers.
  55. @param Data This optional parameter may be used to pass additional data.
  56. @retval EFI_SUCCESS Status code reported to serial I/O successfully.
  57. **/
  58. EFI_STATUS
  59. EFIAPI
  60. ExSerialStatusCodeReportWorker (
  61. IN CONST EFI_PEI_SERVICES **PeiServices,
  62. IN EFI_STATUS_CODE_TYPE CodeType,
  63. IN EFI_STATUS_CODE_VALUE Value,
  64. IN UINT32 Instance,
  65. IN CONST EFI_GUID *CallerId,
  66. IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
  67. );
  68. #endif // __EX_STATUS_CODE_HANDLER_PEI_H__