TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmGenericTimerPhyCounterLib.c
Go to the documentation of this file.
1
11#include <Library/ArmLib.h>
12
13VOID
14EFIAPI
15ArmGenericTimerEnableTimer (
16 VOID
17 )
18{
19 UINTN TimerCtrlReg;
20
21 TimerCtrlReg = ArmReadCntpCtl ();
22 TimerCtrlReg |= ARM_ARCH_TIMER_ENABLE;
23 ArmWriteCntpCtl (TimerCtrlReg);
24}
25
26VOID
27EFIAPI
28ArmGenericTimerReenableTimer (
29 VOID
30 )
31{
32}
33
34VOID
35EFIAPI
36ArmGenericTimerDisableTimer (
37 VOID
38 )
39{
40 UINTN TimerCtrlReg;
41
42 TimerCtrlReg = ArmReadCntpCtl ();
43 TimerCtrlReg &= ~ARM_ARCH_TIMER_ENABLE;
44 ArmWriteCntpCtl (TimerCtrlReg);
45}
46
47VOID
48EFIAPI
49ArmGenericTimerSetTimerFreq (
50 IN UINTN FreqInHz
51 )
52{
53 ArmWriteCntFrq (FreqInHz);
54}
55
57EFIAPI
58ArmGenericTimerGetTimerFreq (
59 VOID
60 )
61{
62 return ArmReadCntFrq ();
63}
64
66EFIAPI
67ArmGenericTimerGetTimerVal (
68 VOID
69 )
70{
71 return ArmReadCntpTval ();
72}
73
74VOID
75EFIAPI
76ArmGenericTimerSetTimerVal (
77 IN UINTN Value
78 )
79{
80 ArmWriteCntpTval (Value);
81}
82
83UINT64
84EFIAPI
85ArmGenericTimerGetSystemCount (
86 VOID
87 )
88{
89 return ArmReadCntPct ();
90}
91
93EFIAPI
94ArmGenericTimerGetTimerCtrlReg (
95 VOID
96 )
97{
98 return ArmReadCntpCtl ();
99}
100
101VOID
102EFIAPI
103ArmGenericTimerSetTimerCtrlReg (
104 UINTN Value
105 )
106{
107 ArmWriteCntpCtl (Value);
108}
109
110UINT64
111EFIAPI
112ArmGenericTimerGetCompareVal (
113 VOID
114 )
115{
116 return ArmReadCntpCval ();
117}
118
119VOID
120EFIAPI
121ArmGenericTimerSetCompareVal (
122 IN UINT64 Value
123 )
124{
125 ArmWriteCntpCval (Value);
126}
UINT64 UINTN
#define IN
Definition: Base.h:279