efi_loader: implement queueing of the notification function

For the correct implementation of the task priority level (TPL)
calling the notification function must be queued.

Add a status field 'queued' to events.

In function efi_signal_event set status queued if a notification
function exists and reset it after we have called the function.
A later patch will add a check of the TPL here.

In efi_create_event and efi_close_event unset the queued status.

In function efi_wait_for_event and efi_check_event
queue the notification function.

In efi_timer_check call the efi_notify_event
if the status queued is set.
For all timer events set status signaled.

In efi_console_timer_notify set the signaled state of the
WaitForKey event.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Heinrich Schuchardt
2017-09-15 10:06:13 +02:00
committed by Alexander Graf
parent 38b1b79021
commit ca62a4f53e
3 changed files with 36 additions and 12 deletions

View File

@@ -131,7 +131,8 @@ struct efi_object {
* @nofify_function: Function to call when the event is triggered
* @notify_context: Data to be passed to the notify function
* @trigger_type: Type of timer, see efi_set_timer
* @signaled: The notify function was already called
* @queued: The notification functionis queued
* @signaled: The event occured
*/
struct efi_event {
uint32_t type;
@@ -141,6 +142,7 @@ struct efi_event {
u64 trigger_next;
u64 trigger_time;
enum efi_timer_delay trigger_type;
int queued;
int signaled;
};