Dpc.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /** @file
  2. Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. Module Name:
  5. Dpc.h
  6. Abstract:
  7. **/
  8. #ifndef _DPC_H_
  9. #define _DPC_H_
  10. #include <Uefi.h>
  11. #include <Library/BaseLib.h>
  12. #include <Library/DebugLib.h>
  13. #include <Library/UefiDriverEntryPoint.h>
  14. #include <Library/UefiBootServicesTableLib.h>
  15. #include <Library/MemoryAllocationLib.h>
  16. #include <Protocol/Dpc.h>
  17. //
  18. // Internal data structure for managing DPCs. A DPC entry is either on the free
  19. // list or on a DPC queue at a specific EFI_TPL.
  20. //
  21. typedef struct {
  22. LIST_ENTRY ListEntry;
  23. EFI_DPC_PROCEDURE DpcProcedure;
  24. VOID *DpcContext;
  25. } DPC_ENTRY;
  26. /**
  27. Add a Deferred Procedure Call to the end of the DPC queue.
  28. @param This Protocol instance pointer.
  29. @param DpcTpl The EFI_TPL that the DPC should be invoked.
  30. @param DpcProcedure Pointer to the DPC's function.
  31. @param DpcContext Pointer to the DPC's context. Passed to DpcProcedure
  32. when DpcProcedure is invoked.
  33. @retval EFI_SUCCESS The DPC was queued.
  34. @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
  35. @retval EFI_INVALID_PARAMETER DpcProcedure is NULL.
  36. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
  37. add the DPC to the queue.
  38. **/
  39. EFI_STATUS
  40. EFIAPI
  41. DpcQueueDpc (
  42. IN EFI_DPC_PROTOCOL *This,
  43. IN EFI_TPL DpcTpl,
  44. IN EFI_DPC_PROCEDURE DpcProcedure,
  45. IN VOID *DpcContext OPTIONAL
  46. );
  47. /**
  48. Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl
  49. value greater than or equal to the current TPL are invoked in the order that
  50. they were queued. DPCs with higher DpcTpl values are invoked before DPCs with
  51. lower DpcTpl values.
  52. @param This Protocol instance pointer.
  53. @retval EFI_SUCCESS One or more DPCs were invoked.
  54. @retval EFI_NOT_FOUND No DPCs were invoked.
  55. **/
  56. EFI_STATUS
  57. EFIAPI
  58. DpcDispatchDpc (
  59. IN EFI_DPC_PROTOCOL *This
  60. );
  61. #endif