Re: [edk2-devel] Debug UEFI Event
Andrew Fish <afish@...>
Stanley,toggle quoted messageShow quoted text
There is not much to debug with EFI events and that is why there are not a lot of DEBUG_EVENT DEBUG prints. The only thing that can block your event is for the current TPL level being >= to the TPL level of your event, but that also blocks all forward progress in EFI.
Usually the problem is one of these:
1) The event was no created properly and thus never gets signaled.
2) The more generic issue is people code EFI events like threads, and that is not how it works. EFI has a cooperative event model and there is only one thread and that is the main thread. Events are dispatched when gBS->RestoreTPL()  is called. Higher priority (TPL) events dispatch 1st. So the only way your event can get blocked is for another chunk of code to gBS->RaiseTPL() to the level of your event or higher. If you put a while (TRUE) loop in an event it will deadlock the system.
So hopefully it is 1) and you are not error checking the return codes when you create and hook in the event, or you are missing the call to hook in your event to get called. If it is a more subtle problem it is usually related to 2).