2 Help functions to access UDP service.
4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/DebugLib.h>
10 #include <Library/UefiBootServicesTableLib.h>
11 #include <Protocol/Dpc.h>
14 // Pointer to the DPC Protocol
16 EFI_DPC_PROTOCOL
*mDpc
;
19 This constructor function caches the EFI_DPC_PROTOCOL pointer.
21 @param[in] ImageHandle The firmware allocated handle for the EFI image.
22 @param[in] SystemTable A pointer to the EFI System Table.
24 @retval EFI_SUCCESS The constructor always return EFI_SUCCESS.
30 IN EFI_HANDLE ImageHandle
,
31 IN EFI_SYSTEM_TABLE
*SystemTable
37 // Locate the EFI_DPC_PROTOCOL in the handle database
39 Status
= gBS
->LocateProtocol (&gEfiDpcProtocolGuid
, NULL
, (VOID
**)&mDpc
);
40 ASSERT_EFI_ERROR (Status
);
46 Add a Deferred Procedure Call to the end of the DPC queue.
48 @param[in] DpcTpl The EFI_TPL that the DPC should be invoked.
49 @param[in] DpcProcedure Pointer to the DPC's function.
50 @param[in] DpcContext Pointer to the DPC's context. Passed to DpcProcedure
51 when DpcProcedure is invoked.
53 @retval EFI_SUCCESS The DPC was queued.
54 @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
55 @retval EFI_INVALID_PARAMETER DpcProcedure is NULL.
56 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
57 add the DPC to the queue.
64 IN EFI_DPC_PROCEDURE DpcProcedure
,
65 IN VOID
*DpcContext OPTIONAL
69 // Call the EFI_DPC_PROTOCOL to queue the DPC
71 return mDpc
->QueueDpc (mDpc
, DpcTpl
, DpcProcedure
, DpcContext
);
75 Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl
76 value greater than or equal to the current TPL are invoked in the order that
77 they were queued. DPCs with higher DpcTpl values are invoked before DPCs with
80 @retval EFI_SUCCESS One or more DPCs were invoked.
81 @retval EFI_NOT_FOUND No DPCs were invoked.
91 // Call the EFI_DPC_PROTOCOL to dispatch previously queued DPCs
93 return mDpc
->DispatchDpc (mDpc
);