Timer.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*++ @file
  2. Emu Emulation Architectural Protocol Driver as defined in UEFI/PI.
  3. This Timer module uses an UNIX Thread to simulate the timer-tick driven
  4. timer service.
  5. Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
  6. Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
  7. SPDX-License-Identifier: BSD-2-Clause-Patent
  8. **/
  9. #ifndef _TIMER_H_
  10. #define _TIMER_H_
  11. //
  12. // Legal timer value range in 100 ns units
  13. //
  14. #define TIMER_MINIMUM_VALUE 0
  15. #define TIMER_MAXIMUM_VALUE (0x100000000ULL - 1)
  16. //
  17. // Default timer value in 100 ns units (50 ms)
  18. //
  19. #define DEFAULT_TIMER_TICK_DURATION 500000
  20. //
  21. // Function Prototypes
  22. //
  23. EFI_STATUS
  24. EFIAPI
  25. EmuTimerDriverInitialize (
  26. IN EFI_HANDLE ImageHandle,
  27. IN EFI_SYSTEM_TABLE *SystemTable
  28. );
  29. EFI_STATUS
  30. EFIAPI
  31. EmuTimerDriverRegisterHandler (
  32. IN EFI_TIMER_ARCH_PROTOCOL *This,
  33. IN EFI_TIMER_NOTIFY NotifyFunction
  34. );
  35. EFI_STATUS
  36. EFIAPI
  37. EmuTimerDriverSetTimerPeriod (
  38. IN EFI_TIMER_ARCH_PROTOCOL *This,
  39. IN UINT64 TimerPeriod
  40. );
  41. EFI_STATUS
  42. EFIAPI
  43. EmuTimerDriverGetTimerPeriod (
  44. IN EFI_TIMER_ARCH_PROTOCOL *This,
  45. OUT UINT64 *TimerPeriod
  46. );
  47. EFI_STATUS
  48. EFIAPI
  49. EmuTimerDriverGenerateSoftInterrupt (
  50. IN EFI_TIMER_ARCH_PROTOCOL *This
  51. );
  52. #endif