ExReportStatusCodeRouterPei.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /** @file
  2. Internal include file for Report Status Code Router PEIM.
  3. @copyright
  4. Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef __PEI_REPORT_STATUS_CODE_ROUTER_H__
  8. #define __PEI_REPORT_STATUS_CODE_ROUTER_H__
  9. #include <Ppi/ReportStatusCodeHandler.h>
  10. #include <Ppi/StatusCode.h>
  11. #include <Guid/StatusCodeCallbackGuid.h>
  12. #include <Library/DebugLib.h>
  13. #include <Library/HobLib.h>
  14. #include <Library/PeiServicesLib.h>
  15. #include <Library/PeimEntryPoint.h>
  16. /**
  17. Register the callback function for ReportStatusCode() notification.
  18. When this function is called the function pointer is added to an internal list and any future calls to
  19. ReportStatusCode() will be forwarded to the Callback function.
  20. @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called
  21. when a call to ReportStatusCode() occurs.
  22. @retval EFI_SUCCESS Function was successfully registered.
  23. @retval EFI_INVALID_PARAMETER The callback function was NULL.
  24. @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
  25. registered.
  26. @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
  27. **/
  28. EFI_STATUS
  29. EFIAPI
  30. Register (
  31. IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
  32. );
  33. /**
  34. Remove a previously registered callback function from the notification list.
  35. ReportStatusCode() messages will no longer be forwarded to the Callback function.
  36. @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be
  37. unregistered.
  38. @retval EFI_SUCCESS The function was successfully unregistered.
  39. @retval EFI_INVALID_PARAMETER The callback function was NULL.
  40. @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
  41. **/
  42. EFI_STATUS
  43. EFIAPI
  44. Unregister (
  45. IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
  46. );
  47. /**
  48. Publishes an interface that allows PEIMs to report status codes.
  49. This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().
  50. It publishes an interface that allows PEIMs to report status codes.
  51. @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
  52. @param CodeType Indicates the type of status code being reported.
  53. @param Value Describes the current status of a hardware or
  54. software entity. This includes information about the class and
  55. subclass that is used to classify the entity as well as an operation.
  56. For progress codes, the operation is the current activity.
  57. For error codes, it is the exception.For debug codes,it is not defined at this time.
  58. @param Instance The enumeration of a hardware or software entity within
  59. the system. A system may contain multiple entities that match a class/subclass
  60. pairing. The instance differentiates between them. An instance of 0 indicates
  61. that instance information is unavailable, not meaningful, or not relevant.
  62. Valid instance numbers start with 1.
  63. @param CallerId This optional parameter may be used to identify the caller.
  64. This parameter allows the status code driver to apply different rules to
  65. different callers.
  66. @param Data This optional parameter may be used to pass additional data.
  67. @retval EFI_SUCCESS The function completed successfully.
  68. **/
  69. EFI_STATUS
  70. EFIAPI
  71. ReportDispatcher (
  72. IN CONST EFI_PEI_SERVICES **PeiServices,
  73. IN EFI_STATUS_CODE_TYPE CodeType,
  74. IN EFI_STATUS_CODE_VALUE Value,
  75. IN UINT32 Instance,
  76. IN CONST EFI_GUID *CallerId OPTIONAL,
  77. IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
  78. );
  79. #endif