From ffd8088d1dc2d539b590baaebc9da72ec3b7595c Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Sat, 16 Nov 2013 19:26:02 +0100 Subject: [PATCH] proper inttype runtime, declare to import define runtime long as hwtimer_now() uses long import hwtimer.h instead of declaring hwtimer_now() --- core/include/sched.h | 2 +- core/sched.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/include/sched.h b/core/include/sched.h index 4ca62ff7f7..db3654a634 100644 --- a/core/include/sched.h +++ b/core/include/sched.h @@ -90,7 +90,7 @@ typedef struct { unsigned int laststart; /*< Time stamp of the last time this thread was scheduled to run */ unsigned int schedules; /*< How often the thread was scheduled to run */ - unsigned int runtime; /*< The total runtime of this thread */ + unsigned long runtime; /*< The total runtime of this thread */ } schedstat; /** diff --git a/core/sched.c b/core/sched.c index 85c67a81d6..7c33d81f79 100644 --- a/core/sched.c +++ b/core/sched.c @@ -7,6 +7,8 @@ * Public License. See the file LICENSE in the top level directory for more * details. * + * TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER + * * @ingroup kernel * @{ * @file @@ -21,6 +23,10 @@ #include #include +#if SCHEDSTATISTICS +#include "hwtimer.h" +#endif + #define ENABLE_DEBUG (0) #include @@ -87,10 +93,8 @@ void sched_run() } -#if SCHEDSTATISTICS - /* TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER */ - extern unsigned long hwtimer_now(void); - unsigned int time = hwtimer_now(); +#ifdef SCHEDSTATISTICS + unsigned long time = hwtimer_now(); if (my_active_thread && (pidlist[my_active_thread->pid].laststart)) { pidlist[my_active_thread->pid].runtime += time - pidlist[my_active_thread->pid].laststart;