diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-12 10:31:38 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-14 10:28:29 +0100 |
commit | 24bf11eca11947d961cc9bb5f7d92dabff169e93 (patch) | |
tree | b28f3aa8a21df91e8feaf324613aa76460559837 /doc | |
parent | bsps/arm: Fix Cortex-A9 MPCore nanoseconds handler (diff) | |
download | rtems-24bf11eca11947d961cc9bb5f7d92dabff169e93.tar.bz2 |
score: Add CPU counter support
Add a CPU counter interface to allow access to a free-running counter.
It is useful to measure short time intervals. This can be used for
example to enable profiling of critical low-level functions.
Add two busy wait functions rtems_counter_delay_ticks() and
rtems_counter_delay_nanoseconds() implemented via the CPU counter.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/cpu_supplement/general.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/cpu_supplement/general.t b/doc/cpu_supplement/general.t index cf28eefd63..deca4de3b3 100644 --- a/doc/cpu_supplement/general.t +++ b/doc/cpu_supplement/general.t @@ -341,6 +341,27 @@ _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; _TLS_Alignment = ALIGNOF (.tdata); @end example +@section CPU counter + +The CPU support must implement the CPU counter interface. A CPU counter is +some free-running counter. It ticks usually with a frequency close to the CPU +or system bus clock. On some architectures the actual implementation is board +support package dependent. The CPU counter is used for profiling of low-level +functions. It is also used to implement two busy wait functions +@code{rtems_counter_delay_ticks()} and @code{rtems_counter_delay_nanoseconds()} +which may be used in device drivers. It may be also used as an entropy source +for random number generators. + +The CPU counter interface uses a CPU port specific unsigned integer type +@code{CPU_Counter_ticks} to represent CPU counter values. The CPU port must +provide the following two functions + +@itemize +@item @code{_CPU_Counter_read()} to read the current CPU counter value, and +@item @code{_CPU_Counter_difference()} to get the difference between two CPU +counter values. +@end itemize + @c @c @c |