33UINTN mDpcQueueDepth = 0;
34UINTN mMaxDpcQueueDepth = 0;
73 IN VOID *DpcContext OPTIONAL
84 if ((DpcTpl < TPL_APPLICATION) || (DpcTpl > TPL_HIGH_LEVEL)) {
85 return EFI_INVALID_PARAMETER;
91 if (DpcProcedure ==
NULL) {
92 return EFI_INVALID_PARAMETER;
104 OriginalTpl =
gBS->RaiseTPL (TPL_HIGH_LEVEL);
115 if (OriginalTpl > TPL_NOTIFY) {
116 ReturnStatus = EFI_OUT_OF_RESOURCES;
123 for (Index = 0; Index < 64; Index++) {
127 gBS->RestoreTPL (OriginalTpl);
137 gBS->RaiseTPL (TPL_HIGH_LEVEL);
143 if (DpcEntry ==
NULL) {
145 ReturnStatus = EFI_OUT_OF_RESOURCES;
170 DpcEntry->DpcProcedure = DpcProcedure;
171 DpcEntry->DpcContext = DpcContext;
186 if (mDpcQueueDepth > mMaxDpcQueueDepth) {
187 mMaxDpcQueueDepth = mDpcQueueDepth;
194 gBS->RestoreTPL (OriginalTpl);
225 ReturnStatus = EFI_NOT_FOUND;
231 OriginalTpl =
gBS->RaiseTPL (TPL_HIGH_LEVEL);
236 if (mDpcQueueDepth > 0) {
240 for (Tpl = TPL_HIGH_LEVEL; Tpl >= OriginalTpl; Tpl--) {
263 gBS->RestoreTPL (Tpl);
268 (DpcEntry->DpcProcedure)(DpcEntry->DpcContext);
278 gBS->RaiseTPL (TPL_HIGH_LEVEL);
291 gBS->RestoreTPL (OriginalTpl);
325 for (Index = 0; Index <= TPL_HIGH_LEVEL; Index++) {
332 Status =
gBS->InstallMultipleProtocolInterfaces (
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
EFI_STATUS EFIAPI DpcDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI DpcDispatchDpc(IN EFI_DPC_PROTOCOL *This)
EFI_STATUS EFIAPI DpcQueueDpc(IN EFI_DPC_PROTOCOL *This, IN EFI_TPL DpcTpl, IN EFI_DPC_PROCEDURE DpcProcedure, IN VOID *DpcContext OPTIONAL)
VOID(EFIAPI * EFI_DPC_PROCEDURE)(IN VOID *DpcContext)
EFI_GUID gEfiDpcProtocolGuid
#define ASSERT_EFI_ERROR(StatusParameter)
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)