3 Copyright (c) 1998 Intel Corporation
22 LibCreateProtocolNotifyEvent (
23 IN EFI_GUID *ProtocolGuid,
25 IN EFI_EVENT_NOTIFY NotifyFunction,
26 IN VOID *NotifyContext,
27 OUT VOID *Registration
37 Status = uefi_call_wrapper(
46 ASSERT (!EFI_ERROR(Status));
49 // Register for protocol notifactions on this event
52 Status = uefi_call_wrapper(
53 BS->RegisterProtocolNotify,
60 ASSERT (!EFI_ERROR(Status));
63 // Kick the event so we will perform an initial pass of
64 // current installed drivers
67 uefi_call_wrapper(BS->SignalEvent, 1, Event);
75 IN UINT64 Timeout OPTIONAL
81 EFI_EVENT WaitList[2];
85 // Create a timer event
88 Status = uefi_call_wrapper(BS->CreateEvent, 5, EVT_TIMER, 0, NULL, NULL, &TimerEvent);
89 if (!EFI_ERROR(Status)) {
92 // Set the timer event
95 uefi_call_wrapper(BS->SetTimer, 3, TimerEvent, TimerRelative, Timeout);
98 // Wait for the original event or the timer
102 WaitList[1] = TimerEvent;
103 Status = uefi_call_wrapper(BS->WaitForEvent, 3, 2, WaitList, &Index);
104 uefi_call_wrapper(BS->CloseEvent, 1, TimerEvent);
107 // If the timer expired, change the return to timed out
110 if (!EFI_ERROR(Status) && Index == 1) {
111 Status = EFI_TIMEOUT;
118 // No timeout... just wait on the event
121 Status = uefi_call_wrapper(BS->WaitForEvent, 3, 1, &Event, &Index);
122 ASSERT (!EFI_ERROR(Status));
130 WaitForEventWithTimeout (
136 IN EFI_INPUT_KEY TimeoutKey,
137 OUT EFI_INPUT_KEY *Key
143 PrintAt (Column, Row, String, Timeout);
144 Status = WaitForSingleEvent (Event, 10000000);
145 if (Status == EFI_SUCCESS) {
146 if (!EFI_ERROR(uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, Key))) {
150 } while (Timeout > 0);