From 98c01a53c808a33e63d0e52490cc1c10a9dd1038 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 8 Nov 2018 11:32:13 +0100 Subject: rtems: Avoid in API Use a real function for rtems_clock_get_uptime_seconds(). Update #3598. --- cpukit/Makefile.am | 1 + cpukit/include/rtems/imfs.h | 1 + cpukit/include/rtems/rtems/clock.h | 8 +------- cpukit/include/rtems/rtems/types.h | 1 + cpukit/rtems/src/clockgetuptimeseconds.c | 31 +++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 cpukit/rtems/src/clockgetuptimeseconds.c diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am index 7162d51fc5..d148038c14 100644 --- a/cpukit/Makefile.am +++ b/cpukit/Makefile.am @@ -675,6 +675,7 @@ librtemscpu_a_SOURCES += rtems/src/clockgettod.c librtemscpu_a_SOURCES += rtems/src/clockgettodtimeval.c librtemscpu_a_SOURCES += rtems/src/clockgetuptime.c librtemscpu_a_SOURCES += rtems/src/clockgetuptimenanoseconds.c +librtemscpu_a_SOURCES += rtems/src/clockgetuptimeseconds.c librtemscpu_a_SOURCES += rtems/src/clockgetuptimetimeval.c librtemscpu_a_SOURCES += rtems/src/clockset.c librtemscpu_a_SOURCES += rtems/src/clocktick.c diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h index 3d2048afeb..e83209508c 100644 --- a/cpukit/include/rtems/imfs.h +++ b/cpukit/include/rtems/imfs.h @@ -21,6 +21,7 @@ #include #include +#include /** * @brief In-Memory File System Support. diff --git a/cpukit/include/rtems/rtems/clock.h b/cpukit/include/rtems/rtems/clock.h index da833eac48..f3f406d2e6 100644 --- a/cpukit/include/rtems/rtems/clock.h +++ b/cpukit/include/rtems/rtems/clock.h @@ -33,9 +33,6 @@ #include #include #include -#include - -#include /* struct timeval */ /** * @defgroup ClassicClock Clocks @@ -265,10 +262,7 @@ void rtems_clock_get_uptime_timeval( struct timeval *uptime ); * * @retval The system uptime in seconds. */ -RTEMS_INLINE_ROUTINE time_t rtems_clock_get_uptime_seconds( void ) -{ - return _Timecounter_Time_uptime - 1; -} +time_t rtems_clock_get_uptime_seconds( void ); /** * @brief Returns the system uptime in nanoseconds. diff --git a/cpukit/include/rtems/rtems/types.h b/cpukit/include/rtems/rtems/types.h index 2028c427f0..13adf175a6 100644 --- a/cpukit/include/rtems/rtems/types.h +++ b/cpukit/include/rtems/rtems/types.h @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/cpukit/rtems/src/clockgetuptimeseconds.c b/cpukit/rtems/src/clockgetuptimeseconds.c new file mode 100644 index 0000000000..ad412b2234 --- /dev/null +++ b/cpukit/rtems/src/clockgetuptimeseconds.c @@ -0,0 +1,31 @@ +/** + * @file + * + * @ingroup ClassicClock + */ + +/* + * Copyright (c) 2018 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +time_t rtems_clock_get_uptime_seconds( void ) +{ + return _Timecounter_Time_uptime - 1; +} -- cgit v1.2.3