]> git.proxmox.com Git - mirror_edk2.git/blob - PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootServicesTableLibUnitTestEventTimer.c
16bd3f4c547db4852cc07aa4bf0138a46e7963b7
[mirror_edk2.git] / PrmPkg / Test / UnitTest / Library / UefiBootServicesTableLibUnitTest / UefiBootServicesTableLibUnitTestEventTimer.c
1 /** @file
2 Implementation of event and timer related services in the UEFI Boot Services table for use in unit tests.
3
4 Copyright (c) Microsoft Corporation
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "UefiBootServicesTableLibUnitTest.h"
10
11 /**
12 Creates an event.
13
14 @param Type The type of event to create and its mode and
15 attributes
16 @param NotifyTpl The task priority level of event notifications
17 @param NotifyFunction Pointer to the events notification function
18 @param NotifyContext Pointer to the notification functions context
19 corresponds to parameter "Context" in the
20 notification function
21 @param Event Pointer to the newly created event if the call
22 succeeds undefined otherwise
23
24 @retval EFI_SUCCESS The event structure was created
25 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
26 @retval EFI_OUT_OF_RESOURCES The event could not be allocated
27
28 **/
29 EFI_STATUS
30 EFIAPI
31 UnitTestCreateEvent (
32 IN UINT32 Type,
33 IN EFI_TPL NotifyTpl,
34 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
35 IN VOID *NotifyContext, OPTIONAL
36 OUT EFI_EVENT *Event
37 )
38 {
39 return EFI_NOT_AVAILABLE_YET;
40 }
41
42 /**
43 Sets the type of timer and the trigger time for a timer event.
44
45 @param UserEvent The timer event that is to be signaled at the
46 specified time
47 @param Type The type of time that is specified in
48 TriggerTime
49 @param TriggerTime The number of 100ns units until the timer
50 expires
51
52 @retval EFI_SUCCESS The event has been set to be signaled at the
53 requested time
54 @retval EFI_INVALID_PARAMETER Event or Type is not valid
55
56 **/
57 EFI_STATUS
58 EFIAPI
59 UnitTestSetTimer (
60 IN EFI_EVENT UserEvent,
61 IN EFI_TIMER_DELAY Type,
62 IN UINT64 TriggerTime
63 )
64 {
65 return EFI_NOT_AVAILABLE_YET;
66 }
67
68 /**
69 Stops execution until an event is signaled.
70
71 @param NumberOfEvents The number of events in the UserEvents array
72 @param UserEvents An array of EFI_EVENT
73 @param UserIndex Pointer to the index of the event which
74 satisfied the wait condition
75
76 @retval EFI_SUCCESS The event indicated by Index was signaled.
77 @retval EFI_INVALID_PARAMETER The event indicated by Index has a notification
78 function or Event was not a valid type
79 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION
80
81 **/
82 EFI_STATUS
83 EFIAPI
84 UnitTestWaitForEvent (
85 IN UINTN NumberOfEvents,
86 IN EFI_EVENT *UserEvents,
87 OUT UINTN *UserIndex
88 )
89 {
90 return EFI_NOT_AVAILABLE_YET;
91 }
92
93 /**
94 Signals the event. Queues the event to be notified if needed.
95
96 @param UserEvent The event to signal .
97
98 @retval EFI_INVALID_PARAMETER Parameters are not valid.
99 @retval EFI_SUCCESS The event was signaled.
100
101 **/
102 EFI_STATUS
103 EFIAPI
104 UnitTestSignalEvent (
105 IN EFI_EVENT UserEvent
106 )
107 {
108 return EFI_NOT_AVAILABLE_YET;
109 }
110
111 /**
112 Closes an event and frees the event structure.
113
114 @param UserEvent Event to close
115
116 @retval EFI_INVALID_PARAMETER Parameters are not valid.
117 @retval EFI_SUCCESS The event has been closed
118
119 **/
120 EFI_STATUS
121 EFIAPI
122 UnitTestCloseEvent (
123 IN EFI_EVENT UserEvent
124 )
125 {
126 return EFI_NOT_AVAILABLE_YET;
127 }
128
129 /**
130 Check the status of an event.
131
132 @param UserEvent The event to check
133
134 @retval EFI_SUCCESS The event is in the signaled state
135 @retval EFI_NOT_READY The event is not in the signaled state
136 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL
137
138 **/
139 EFI_STATUS
140 EFIAPI
141 UnitTestCheckEvent (
142 IN EFI_EVENT UserEvent
143 )
144 {
145 return EFI_NOT_AVAILABLE_YET;
146 }
147
148 /**
149 Creates an event in a group.
150
151 @param Type The type of event to create and its mode and
152 attributes
153 @param NotifyTpl The task priority level of event notifications
154 @param NotifyFunction Pointer to the events notification function
155 @param NotifyContext Pointer to the notification functions context
156 corresponds to parameter "Context" in the
157 notification function
158 @param EventGroup GUID for EventGroup if NULL act the same as
159 gBS->CreateEvent().
160 @param Event Pointer to the newly created event if the call
161 succeeds undefined otherwise
162
163 @retval EFI_SUCCESS The event structure was created
164 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
165 @retval EFI_OUT_OF_RESOURCES The event could not be allocated
166
167 **/
168 EFI_STATUS
169 EFIAPI
170 UnitTestCreateEventEx (
171 IN UINT32 Type,
172 IN EFI_TPL NotifyTpl,
173 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
174 IN CONST VOID *NotifyContext, OPTIONAL
175 IN CONST EFI_GUID *EventGroup, OPTIONAL
176 OUT EFI_EVENT *Event
177 )
178 {
179 return EFI_NOT_AVAILABLE_YET;
180 }