gta.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*++
  2. Copyright (c) 2016 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. gta.S
  5. Abstract:
  6. This module implements support for accessing ARM Generic Timer registers.
  7. Author:
  8. Chris Stevens 9-Jun-2016
  9. Environment:
  10. Firmware
  11. --*/
  12. ##
  13. ## ------------------------------------------------------------------ Includes
  14. ##
  15. #include <minoca/kernel/arm.inc>
  16. ##
  17. ## --------------------------------------------------------------- Definitions
  18. ##
  19. ##
  20. ## ---------------------------------------------------------------------- Code
  21. ##
  22. ASSEMBLY_FILE_HEADER
  23. ##
  24. ## VOID
  25. ## EfipGtSetVirtualTimerControl (
  26. ## UINT32 Control
  27. ## )
  28. ##
  29. /*++
  30. Routine Description:
  31. This routine sets the CNTV_CTL register.
  32. Arguments:
  33. Control - Supplies the control value to set in the CNTV_CTL.
  34. Return Value:
  35. None.
  36. --*/
  37. FUNCTION EfipGtSetVirtualTimerControl
  38. mcr p15, 0, %r0, %c14, %c3, 1 @ Set the CNTV_CTL
  39. bx %lr @
  40. END_FUNCTION EfipGtSetVirtualTimerControl
  41. ##
  42. ## UINT64
  43. ## EfipGtGetVirtualCount (
  44. ## VOID
  45. ## )
  46. ##
  47. /*++
  48. Routine Description:
  49. This routine retrieves the CNTVCT register.
  50. Arguments:
  51. None.
  52. Return Value:
  53. Returns the value of the CNTVCT.
  54. --*/
  55. FUNCTION EfipGtGetVirtualCount
  56. mrrc p15, 1, %r0, %r1, %c14 @ Get the CNTVCT
  57. bx %lr @
  58. END_FUNCTION EfipGtGetVirtualCount
  59. ##
  60. ## VOID
  61. ## EfipGtSetVirtualTimerCompare (
  62. ## UINT64 CompareValue
  63. ## )
  64. ##
  65. /*++
  66. Routine Description:
  67. This routine retrieves the CNTV_CVAL register.
  68. Arguments:
  69. CompareValue - Supplies the compare value to set in the CNTV_CVAL register.
  70. Return Value:
  71. None.
  72. --*/
  73. FUNCTION EfipGtSetVirtualTimerCompare
  74. mcrr p15, 3, %r0, %r1, %c14 @ Set the CNTV_CVAL
  75. bx %lr @
  76. END_FUNCTION EfipGtSetVirtualTimerCompare
  77. ##
  78. ## --------------------------------------------------------- Internal Functions
  79. ##