diff options
author | Laszlo Ersek <lersek@redhat.com> | 2015-02-02 12:01:29 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-02-02 12:01:29 +0000 |
commit | 074a67fc808cbd7b0259b71304a2d5b45ecb9a75 (patch) | |
tree | d400deae480f8311be3f232f3aebcd41c033f950 /ArmPkg/Library | |
parent | 93626a53773246d3999446235dc826b92a249228 (diff) | |
download | edk2-074a67fc808cbd7b0259b71304a2d5b45ecb9a75.zip edk2-074a67fc808cbd7b0259b71304a2d5b45ecb9a75.tar.gz edk2-074a67fc808cbd7b0259b71304a2d5b45ecb9a75.tar.bz2 |
ArmPkg: ArmArchTimerLib: clean up comments
In the next patch we'll slightly reorganize TimerConstructor(). Let's
improve the comments first.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Olivier Martin <Olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16689 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r-- | ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c index c0ab4a4..fb010a8 100644 --- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c +++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c @@ -30,32 +30,43 @@ TimerConstructor ( VOID
)
{
- // Check if the ARM Generic Timer Extension is implemented
+ //
+ // Check if the ARM Generic Timer Extension is implemented.
+ //
if (ArmIsArchTimerImplemented ()) {
-
UINTN TimerFreq;
- // Check if Architectural Timer frequency is valid number (should not be 0)
+ //
+ // Check if Architectural Timer frequency is valid (should not be 0).
+ //
ASSERT (PcdGet32 (PcdArmArchTimerFreqInHz));
+ //
// Check if ticks/uS is not 0. The Architectural timer runs at constant
- // frequency irrespective of CPU frequency. According to General Timer Ref
- // manual lower bound of the frequency is in the range of 1-10MHz
+ // frequency, irrespective of CPU frequency. According to General Timer
+ // Ref manual, lower bound of the frequency is in the range of 1-10MHz.
+ //
ASSERT (TICKS_PER_MICRO_SEC);
#ifdef MDE_CPU_ARM
- // Only set the frequency for ARMv7. We expect the secure firmware to have already do it
- // If the security extensions are not implemented set Timer Frequency
+ //
+ // Only set the frequency for ARMv7. We expect the secure firmware to
+ // have already done it.
+ // If the security extension is not implemented, set Timer Frequency
+ // here.
+ //
if ((ArmReadIdPfr1 () & ARM_PFR1_SEC) == 0x0) {
ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
}
#endif
- // Architectural Timer Frequency must be set in the Secure privileged(if secure extensions are supported) mode.
- // If the reset value (0) is returned just ASSERT.
+ //
+ // Architectural Timer Frequency must be set in the Secure privileged
+ // mode (if secure extension is supported).
+ // If the reset value (0) is returned, just ASSERT.
+ //
TimerFreq = ArmGenericTimerGetTimerFreq ();
ASSERT (TimerFreq != 0);
-
} else {
DEBUG ((EFI_D_ERROR, "ARM Architectural Timer is not available in the CPU, hence this library can not be used.\n"));
ASSERT (0);
|