summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-09-08 09:41:12 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-09-09 06:57:10 +0200
commit270200e972e6c2a5733a12ee70fcc3b7e2940c6c (patch)
tree284b6a902cc2165c94b6bb78e45f7760d1ed712c /cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
parentlibcrypt: There is no need to clear message digest (diff)
downloadrtems-270200e972e6c2a5733a12ee70fcc3b7e2940c6c.tar.bz2
score: Remove _CPU_Counter_difference()
All CPU ports used the same _CPU_Counter_difference() implementation. Remove this CPU port interface and mandate a monotonically increasing CPU counter. Close #3456.
Diffstat (limited to 'cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h')
-rw-r--r--cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h39
1 files changed, 11 insertions, 28 deletions
diff --git a/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
index 5403cc8a10..63829b5272 100644
--- a/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
@@ -1293,44 +1293,27 @@ static inline uint32_t CPU_swap_u32(
typedef uint32_t CPU_Counter_ticks;
/**
- * @brief Returns the current CPU counter frequency in Hz.
+ * @brief Gets the current CPU counter frequency in Hz.
*
- * @return The current CPU counter frequency in Hz.
+ * @return Returns the current CPU counter frequency in Hz.
*/
uint32_t _CPU_Counter_frequency( void );
/**
- * @brief Returns the current CPU counter value.
+ * @brief Gets the current CPU counter value.
*
- * A CPU counter is some free-running counter. It ticks usually with a
- * frequency close to the CPU or system bus clock. The board support package
- * must ensure that this function works before the RTEMS initialization.
- * Otherwise invalid profiling statistics will be gathered.
+ * A CPU counter should be some monotonically increasing free-running counter.
+ * It ticks usually with a frequency close to the CPU or system bus clock. The
+ * counter should not be affected by power saving states so that it can be used
+ * for timestamps. The CPU counter should be initialized at the
+ * RTEMS_SYSINIT_CPU_COUNTER initialization step if necessary. If
+ * RTEMS_PROFILING is enabled, the CPU counter may have to work very early in
+ * the system initialization to avoid invalid profiling statistics.
*
- * @return The current CPU counter value.
+ * @return Returns the current CPU counter value.
*/
CPU_Counter_ticks _CPU_Counter_read( void );
-/**
- * @brief Returns the difference between the second and first CPU counter
- * value.
- *
- * This operation may be carried out as a modulo operation depending on the
- * range of the CPU counter device.
- *
- * @param[in] second The second CPU counter value.
- * @param[in] first The first CPU counter value.
- *
- * @return Returns second minus first modulo counter period.
- */
-static inline CPU_Counter_ticks _CPU_Counter_difference(
- CPU_Counter_ticks second,
- CPU_Counter_ticks first
-)
-{
- return second - first;
-}
-
#ifdef RTEMS_SMP
/**
* @brief Performs CPU specific SMP initialization in the context of the boot