ARMv7 Generic Timers

From OSDev.wiki
Revision as of 02:42, 7 September 2017 by osdev>Gravaera (Initial ARM GT page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page is current with the description of the ARM Generic Timer behaviour specified in the ARMv7 manual. There may have been differences introduced in ARMv8 and AArch64. This page does not take such differences, if they exist, into account.

Overview

The ARM Generic Timers (henceforth, "GT") are architecturally specified in ARMv7 as an OPTIONAL extension to the ARMv7-a and ARMv7-r streams. The feature is specified to provide a timestamp-counter (upcounter) reference which operates independent of the CPU clock's frequency, allowing for TSC measurements which are invariant over time, regardless of processor scaling, power state and throttling.

This upcounter can be read in two forms:

  • Physical upcounter readout ("Physical counter").
  • Virtual upcounter readout ("Virtual counter"). This is the value of the physical timer, minus a 64-bit virtual offset.

The feature also specifies a set of 4 timers per CPU which base their operation on these two upcounters:

  • Secure Thysical timer.
  • Non-secure Physical timer.
  • Hypervisor timer.
  • Virtual timer.

Registers