From 79d9e9cccd84c20dda653bd38559e13b1746e91b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Apr 2014 15:47:55 -0600 Subject: [PATCH] If the CPU load measurements are being driven by an external clock, then the prototype for sched_process_cpuload() must be available in include/nuttx/arch.h --- ChangeLog | 4 ++++ configs/sam4s-xplained-pro/src/sam_tc.c | 1 + include/nuttx/arch.h | 22 ++++++++++++++++++++++ sched/os_internal.h | 2 +- 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f7d4d0c5f7..221bfe7128 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7275,3 +7275,7 @@ * configs/sam4s-xplained-pro/Kconfig, nsh/defconfig, and src/sam_tc.c: The SAM4S Xplained Pro now uses the extended timer/counter features. From Bob Doiron (2014-4-30). + * include/nuttx/arch.h and sched/os_internal.h: If the CPU load + measurements are being driven by an external clock, then the prototype + for sched_process_cpuload() must be available in include/nuttx/arch.h + (2014-4-30). diff --git a/configs/sam4s-xplained-pro/src/sam_tc.c b/configs/sam4s-xplained-pro/src/sam_tc.c index fb0a1990cd..c2ba12e4e4 100755 --- a/configs/sam4s-xplained-pro/src/sam_tc.c +++ b/configs/sam4s-xplained-pro/src/sam_tc.c @@ -48,6 +48,7 @@ #include #include +#include #include #include #include diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index d8bb769928..74dcdc81f3 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -1029,6 +1029,28 @@ void up_cxxinitialize(void); void sched_process_timer(void); +/************************************************************************ + * Name: sched_process_cpuload + * + * Description: + * Collect data that can be used for CPU load measurements. + * + * Inputs: + * None + * + * Return Value: + * None + * + * Assumptions/Limitations: + * This function is called from a timer interrupt handler with all + * interrupts disabled. + * + ************************************************************************/ + +#if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK) +void weak_function sched_process_cpuload(void); +#endif + /**************************************************************************** * Name: irq_dispatch * diff --git a/sched/os_internal.h b/sched/os_internal.h index 662b42e51f..3e292e58bb 100644 --- a/sched/os_internal.h +++ b/sched/os_internal.h @@ -255,7 +255,7 @@ int sched_reprioritize(FAR struct tcb_s *tcb, int sched_priority); #else # define sched_reprioritize(tcb,sched_priority) sched_setpriority(tcb,sched_priority) #endif -#ifdef CONFIG_SCHED_CPULOAD +#if defined(CONFIG_SCHED_CPULOAD) && !defined(CONFIG_SCHED_CPULOAD_EXTCLK) void weak_function sched_process_cpuload(void); #endif bool sched_verifytcb(FAR struct tcb_s *tcb);