#include <Uefi.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugLib.h>
Go to the source code of this file.
|
| EFI_STATUS EFIAPI | UserCreateEventEx (IN UINT32 Type, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN CONST VOID *NotifyContext OPTIONAL, IN CONST EFI_GUID *EventGroup OPTIONAL, OUT EFI_EVENT *Event) |
| |
| EFI_STATUS EFIAPI | UserCreateEvent (IN UINT32 Type, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *Event) |
| |
| EFI_STATUS EFIAPI | UserCloseEvent (IN EFI_EVENT Event) |
| |
| EFI_STATUS EFIAPI | UserSignalEvent (IN EFI_EVENT Event) |
| |
| EFI_STATUS EFIAPI | UserCheckEvent (IN EFI_EVENT Event) |
| |
| EFI_STATUS EFIAPI | UserWaitForEvent (IN UINTN NumberOfEvents, IN EFI_EVENT *Events, OUT UINTN *Index) |
| |
| EFI_STATUS EFIAPI | UserSetTimer (IN EFI_EVENT Event, IN EFI_TIMER_DELAY Type, IN UINT64 TriggerTime) |
| |
| EFI_TPL EFIAPI | UserRaiseTPL (IN EFI_TPL NewTpl) |
| |
| VOID EFIAPI | UserRestoreTPL (IN EFI_TPL OldTpl) |
| |
| BOOLEAN | UserEventDispatchNow (VOID) |
| |
Copyright (c) 2025, Pavel Naberezhnev. All rights reserved. SPDX-License-Identifier: BSD-3-Clause
Definition in file UserEvent.h.
◆ USER_EVENT_MAXNUM
| #define USER_EVENT_MAXNUM (512) |
◆ USER_EVENT_MAXTPL
| #define USER_EVENT_MAXTPL (32) |
◆ UserCheckEvent()
| EFI_STATUS EFIAPI UserCheckEvent |
( |
IN EFI_EVENT | Event | ) |
|
Checks whether an event is in the signaled state.
- Parameters
-
| [in] | Event | The event to check. |
- Return values
-
| EFI_SUCCESS | The event is in the signaled state. |
| EFI_NOT_READY | The event is not in the signaled state. |
| EFI_INVALID_PARAMETER | Event is of type EVT_NOTIFY_SIGNAL. |
Definition at line 425 of file UserEvent.c.
◆ UserCloseEvent()
| EFI_STATUS EFIAPI UserCloseEvent |
( |
IN EFI_EVENT | Event | ) |
|
Closes an event.
- Parameters
-
| [in] | Event | The event to close. |
- Return values
-
| EFI_SUCCESS | The event has been closed. |
Definition at line 364 of file UserEvent.c.
◆ UserCreateEvent()
| EFI_STATUS EFIAPI UserCreateEvent |
( |
IN UINT32 | Type, |
|
|
IN EFI_TPL | NotifyTpl, |
|
|
IN EFI_EVENT_NOTIFY NotifyFunction | OPTIONAL, |
|
|
IN VOID *NotifyContext | OPTIONAL, |
|
|
OUT EFI_EVENT * | Event ) |
Creates an event.
- Parameters
-
| [in] | Type | The type of event to create and its mode and attributes. |
| [in] | NotifyTpl | The task priority level of event notifications, if needed. |
| [in] | NotifyFunction | Pointer to the event's notification function, if any. |
| [in] | NotifyContext | Pointer to the notification function's context; corresponds to parameter Context in the notification function. |
| [out] | Event | Pointer to the newly created event if the call succeeds. |
- Return values
-
| EFI_SUCCESS | The event structure was created. |
| EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
| EFI_INVALID_PARAMETER | Event is NULL. |
| EFI_INVALID_PARAMETER | Type has an unsupported bit set. |
| EFI_INVALID_PARAMETER | Type has both EVT_NOTIFY_SINGAL and EVT_NOTIFY_WAIT set. |
| EFI_INVALID_PARAMETER | Type has either EVT_NOTIFY_SIGNAL or EVT_NOTIFY_WAIT set and NotifyFunction is NULL. |
| EFI_INVALID_PARAMETER | Type has either EVT_NOTIFY_SIGNAL or EVT_NOTIFY_WAIT set and NotifyTpl is not a supported TPL level. |
| EFI_OUT_OF_RESOURCES | The event could not be allocated. |
Definition at line 337 of file UserEvent.c.
◆ UserCreateEventEx()
| EFI_STATUS EFIAPI UserCreateEventEx |
( |
IN UINT32 | Type, |
|
|
IN EFI_TPL | NotifyTpl, |
|
|
IN EFI_EVENT_NOTIFY NotifyFunction | OPTIONAL, |
|
|
IN CONST VOID *NotifyContext | OPTIONAL, |
|
|
IN CONST EFI_GUID *EventGroup | OPTIONAL, |
|
|
OUT EFI_EVENT * | Event ) |
Creates an event in a group.
- Parameters
-
| [in] | Type | The type of event to create and its mode and attributes. |
| [in] | NotifyTpl | The task priority level of event notifiactions, if needed. |
| [in] | NotifyFunction | Pointer to the event's notification function, if any. |
| [in] | NotifyContext | Pointer to the notification function's context; corresponds to to parameter Context in the notificatuin function. |
| [in] | EventGroup | Pointer to the unique identifier of the group to which this event belongs. Maybe NULL. |
| [out] | Event | Pointer to the newly created event if the call succeeds. |
- Return values
-
| EFI_SUCCESS | The event structure was created. |
| EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
| EFI_INVALID_PARAMETER | Event is NULL. |
| EFI_INVALID_PARAMETER | Type has an unsupported bit set. |
| EFI_INVALID_PARAMETER | Type has both EVT_NOTIFY_SIGNAL and EVT_NOTIFY_WAIT set. |
| EFI_INVALID_PARAMETER | Type has either EVT_NOTIFY_SIGNAL or EVT_NOTIFY_WAIT set and NotifyFunction is NULL. |
| EFI_INVALID_PARAMETER | Type has either EVT_NOTIFY_SIGNAL or EVT_NOTIFY_WAIT set and NotifyTpl is not a supported TPL level. |
| EFI_OUT_OF_RESOURCES | The event could not be allocated. |
Definition at line 248 of file UserEvent.c.
◆ UserEventDispatchNow()
| BOOLEAN UserEventDispatchNow |
( |
VOID | | ) |
|
Immediately triggers event dispatch.
- Returns
- True if at least one event is detected in the signaled state, else false.
Definition at line 657 of file UserEvent.c.
◆ UserRaiseTPL()
| EFI_TPL EFIAPI UserRaiseTPL |
( |
IN EFI_TPL | NewTpl | ) |
|
Raises a task's priority level and returns its previous level.
- Parameters
-
| [in] | NewTpl | The new task priority level. It must be greather than or equal to the current TPL. |
- Returns
- The previous TPL value.
Definition at line 611 of file UserEvent.c.
◆ UserRestoreTPL()
| VOID EFIAPI UserRestoreTPL |
( |
IN EFI_TPL | OldTpl | ) |
|
Restores a task's priority level to its previous value.
- Parameters
-
| [in] | OldTpl | The previous task priority level to restore. |
Definition at line 636 of file UserEvent.c.
◆ UserSetTimer()
| EFI_STATUS EFIAPI UserSetTimer |
( |
IN EFI_EVENT | Event, |
|
|
IN EFI_TIMER_DELAY | Type, |
|
|
IN UINT64 | TriggerTime ) |
Sets the type of timer and the trigger time for a timer event.
- Parameters
-
| [in] | Event | The timer event that is to be signaled at the specified time. |
| [in] | Type | The type of time is specified in TriggerTime. |
| [in] | TriggerTime | The number if 100ns units untill the timer expires. |
- Return values
-
| EFI_SUCCESS | The event has been set to be signaled at the requested time. |
| EFI_INVALID_PARAMETER | Event or Type is not valid. |
Definition at line 556 of file UserEvent.c.
◆ UserSignalEvent()
| EFI_STATUS EFIAPI UserSignalEvent |
( |
IN EFI_EVENT | Event | ) |
|
Signals an event.
- Parameters
-
| [in] | Event | The event to signal. |
- Return values
-
| EFI_SUCCESS | The event was signaled. |
Definition at line 392 of file UserEvent.c.
◆ UserWaitForEvent()
| EFI_STATUS EFIAPI UserWaitForEvent |
( |
IN UINTN | NumberOfEvents, |
|
|
IN EFI_EVENT * | Events, |
|
|
OUT UINTN * | Index ) |
Stops execution untill an event is signaled.
- Parameters
-
| [in] | NumberOfEvents | The number of events in the Events array. |
| [in] | Events | An array of EFI_EVENT. |
| [out] | Index | Pointer to the index of the event which satisfied the wait condition. |
- Return values
-
| EFI_SUCCESS | The event indicated by Index was signaled. |
| EFI_INVALID_PARAMETER | NumberOfEvents is 0. |
| EFI_INVALID_PARAMETER | The event indicated by Index is of type EVT_NOTIFY_SIGNAL. |
| EFI_UNSUPPORTED | The current TPL is not TPL_APPLICATION. |
Definition at line 481 of file UserEvent.c.