UefiBootServicesTableLibUnitTestEventTimer.c 5.4 KB

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