StableTimer.h 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /** @file
  2. Copyright (c) 2022 Loongson Technology Corporation Limited. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. @par Glossary:
  5. - Csr - Cpu Status Register
  6. - Calc - Calculation
  7. - Freq - frequency
  8. **/
  9. #ifndef STABLE_TIMER_H_
  10. #define STABLE_TIMER_H_
  11. #include "Library/Cpu.h"
  12. /**
  13. Gets the timer count value.
  14. @param[] VOID
  15. @retval timer count value.
  16. **/
  17. extern
  18. UINTN
  19. EFIAPI
  20. LoongArchReadTime (
  21. VOID
  22. );
  23. /**
  24. Calculate the timer frequency.
  25. @param[] VOID
  26. @retval Timer frequency.
  27. **/
  28. UINT32
  29. EFIAPI
  30. CalcConstFreq (
  31. VOID
  32. );
  33. /*
  34. Reads data from the specified CPUCFG register.
  35. @param[OUT] Val Pointer to the variable used to store the CPUCFG register value.
  36. @param[IN] reg Specifies the register number of the CPUCFG to read the data.
  37. @retval none
  38. */
  39. extern
  40. VOID
  41. LoongArchReadCpuCfg (
  42. UINT64 *Val,
  43. UINT64 reg
  44. );
  45. #endif // STABLE_TIMER_H_