Dpc.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /** @file
  2. EFI Deferred Procedure Call Protocol.
  3. Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __DPC_H__
  7. #define __DPC_H__
  8. //
  9. // DPC Protocol GUID value
  10. //
  11. #define EFI_DPC_PROTOCOL_GUID \
  12. { \
  13. 0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 } \
  14. }
  15. //
  16. // Forward reference for pure ANSI compatibility
  17. //
  18. typedef struct _EFI_DPC_PROTOCOL EFI_DPC_PROTOCOL;
  19. /**
  20. Invoke a Deferred Procedure Call.
  21. @param DpcContext The pointer to the Deferred Procedure Call's context,
  22. which is implementation dependent.
  23. **/
  24. typedef
  25. VOID
  26. (EFIAPI *EFI_DPC_PROCEDURE)(
  27. IN VOID *DpcContext
  28. );
  29. /**
  30. Add a Deferred Procedure Call to the end of the DPC queue.
  31. @param This The protocol instance pointer.
  32. @param DpcTpl The EFI_TPL that the DPC should invoke.
  33. @param DpcProcedure The pointer to the DPC's function.
  34. @param DpcContext The pointer to the DPC's context. Passed to DpcProcedure
  35. when DpcProcedure is invoked.
  36. @retval EFI_SUCCESS The DPC was queued.
  37. @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
  38. @retval EFI_INVALID_PARAMETER DpcProcedure is NULL.
  39. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
  40. add the DPC to the queue.
  41. **/
  42. typedef
  43. EFI_STATUS
  44. (EFIAPI *EFI_DPC_QUEUE_DPC)(
  45. IN EFI_DPC_PROTOCOL *This,
  46. IN EFI_TPL DpcTpl,
  47. IN EFI_DPC_PROCEDURE DpcProcedure,
  48. IN VOID *DpcContext OPTIONAL
  49. );
  50. /**
  51. Dispatch the queue of DPCs.
  52. DPCs with DpcTpl value greater than the current TPL value are queued, and then DPCs
  53. with DpcTpl value lower than the current TPL value are queued. All DPCs in the first
  54. group (higher DpcTpl values) are invoked before DPCs in the second group (lower DpcTpl values).
  55. @param This Protocol instance pointer.
  56. @retval EFI_SUCCESS One or more DPCs were invoked.
  57. @retval EFI_NOT_FOUND No DPCs were invoked.
  58. **/
  59. typedef
  60. EFI_STATUS
  61. (EFIAPI *EFI_DPC_DISPATCH_DPC)(
  62. IN EFI_DPC_PROTOCOL *This
  63. );
  64. ///
  65. /// DPC Protocol structure.
  66. ///
  67. struct _EFI_DPC_PROTOCOL {
  68. EFI_DPC_QUEUE_DPC QueueDpc;
  69. EFI_DPC_DISPATCH_DPC DispatchDpc;
  70. };
  71. ///
  72. /// DPC Protocol GUID variable.
  73. ///
  74. extern EFI_GUID gEfiDpcProtocolGuid;
  75. #endif