summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/cpuuse/cpuusagereset.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libmisc/cpuuse/cpuusagereset.c')
-rw-r--r--cpukit/libmisc/cpuuse/cpuusagereset.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c
index 167fe46868..b6920702e1 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereset.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereset.c
@@ -35,21 +35,26 @@ static void CPU_usage_Per_thread_handler(
#endif
}
+
+/*
+ * External data that is shared by cpu usage code but not declared in .h files.
+ */
+#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
+ extern struct timespec CPU_usage_Uptime_at_last_reset;
+#else
+ extern uint32_t CPU_usage_Ticks_at_last_reset;
+#endif
+
/*
* rtems_cpu_usage_reset
*/
void rtems_cpu_usage_reset( void )
{
#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
- extern struct timespec CPU_usage_Uptime_at_last_reset;
-
_TOD_Get_uptime( &CPU_usage_Uptime_at_last_reset );
_Thread_Time_of_last_context_switch = CPU_usage_Uptime_at_last_reset;
#else
- extern uint32_t CPU_usage_Ticks_at_last_reset;
-
CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
-
#endif
rtems_iterate_over_all_threads(CPU_usage_Per_thread_handler);