Waitforevent() – Intel Extensible Firmware Interface User Manual

Page 109

Advertising
background image

Services — Boot Services

Version 1.10

12/01/02

5-11

WaitForEvent()

Summary

Stops execution until an event is signaled.

Prototype

EFI_STATUS
WaitForEvent (

IN UINTN

NumberOfEvents,

IN EFI_EVENT

*Event,

OUT UINTN

*Index

);

Parameters

NumberOfEvents

The number of events in the

Event

array.

Event

An array of

EFI_EVENT

. Type

EFI_EVENT

is defined in the

CreateEvent()

function description.

Index

Pointer to the index of the event which satisfied the wait condition.

Description

The

WaitForEvent()

function waits for any event in the

Event

array to be signaled. On

success, the signaled state of the event is cleared and execution is returned with

Index

indicating

which event caused the return. It is possible for an event to be signaled before being waited on. In
this case, the next wait operation for that event would immediately return with the signaled event.

Waiting on an event of type

EVT_NOTIFY_SIGNAL

is not permitted. If any event in

Event

is of

type

EVT_NOTIFY_SIGNAL

,

WaitForEvent()

returns

EFI_INVALID_PARAMETER

and

sets

Index

to indicate which event caused the failure. This function must be called at priority

level

TPL_APPLICATION

. If an attempt is made to call it at any other priority level,

EFI_UNSUPPORTED

is returned.

To wait for a specified time, a timer event must be included in the

Event

array.

WaitForEvent()

will always check for signaled events in order, with the first event in the array

being checked first. To check if an event is signaled without waiting, an already signaled event can
be used as the last event in the list being checked, or the

CheckEvent()

interface may be used.

Status Codes Returned

EFI_SUCCESS

The event indicated by

Index

was signaled.

EFI_INVALID_PARAMETER

The event indicated by

Index

has a notification function or

Event

was not a valid type.

EFI_UNSUPPORTED

The current TPL is not

TPL_APPLICATION

.

Advertising