forked from Imagelibrary/rtems
rtems: Avoid <rtems/score/timecounter.h> in API
Use a real function for rtems_clock_get_uptime_seconds(). Update #3598.
This commit is contained in:
@@ -675,6 +675,7 @@ librtemscpu_a_SOURCES += rtems/src/clockgettod.c
|
|||||||
librtemscpu_a_SOURCES += rtems/src/clockgettodtimeval.c
|
librtemscpu_a_SOURCES += rtems/src/clockgettodtimeval.c
|
||||||
librtemscpu_a_SOURCES += rtems/src/clockgetuptime.c
|
librtemscpu_a_SOURCES += rtems/src/clockgetuptime.c
|
||||||
librtemscpu_a_SOURCES += rtems/src/clockgetuptimenanoseconds.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/clockgetuptimetimeval.c
|
||||||
librtemscpu_a_SOURCES += rtems/src/clockset.c
|
librtemscpu_a_SOURCES += rtems/src/clockset.c
|
||||||
librtemscpu_a_SOURCES += rtems/src/clocktick.c
|
librtemscpu_a_SOURCES += rtems/src/clocktick.c
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <rtems/libio_.h>
|
#include <rtems/libio_.h>
|
||||||
#include <rtems/pipe.h>
|
#include <rtems/pipe.h>
|
||||||
|
#include <rtems/score/timecounter.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief In-Memory File System Support.
|
* @brief In-Memory File System Support.
|
||||||
|
|||||||
@@ -33,9 +33,6 @@
|
|||||||
#include <rtems/rtems/status.h>
|
#include <rtems/rtems/status.h>
|
||||||
#include <rtems/rtems/types.h>
|
#include <rtems/rtems/types.h>
|
||||||
#include <rtems/config.h>
|
#include <rtems/config.h>
|
||||||
#include <rtems/score/timecounterimpl.h>
|
|
||||||
|
|
||||||
#include <sys/time.h> /* struct timeval */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup ClassicClock Clocks
|
* @defgroup ClassicClock Clocks
|
||||||
@@ -265,10 +262,7 @@ void rtems_clock_get_uptime_timeval( struct timeval *uptime );
|
|||||||
*
|
*
|
||||||
* @retval The system uptime in seconds.
|
* @retval The system uptime in seconds.
|
||||||
*/
|
*/
|
||||||
RTEMS_INLINE_ROUTINE time_t rtems_clock_get_uptime_seconds( void )
|
time_t rtems_clock_get_uptime_seconds( void );
|
||||||
{
|
|
||||||
return _Timecounter_Time_uptime - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the system uptime in nanoseconds.
|
* @brief Returns the system uptime in nanoseconds.
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/_timespec.h>
|
#include <sys/_timespec.h>
|
||||||
|
#include <sys/_timeval.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <rtems/score/heap.h>
|
#include <rtems/score/heap.h>
|
||||||
#include <rtems/score/object.h>
|
#include <rtems/score/object.h>
|
||||||
|
|||||||
31
cpukit/rtems/src/clockgetuptimeseconds.c
Normal file
31
cpukit/rtems/src/clockgetuptimeseconds.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @ingroup ClassicClock
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2018 embedded brains GmbH. All rights reserved.
|
||||||
|
*
|
||||||
|
* embedded brains GmbH
|
||||||
|
* Dornierstr. 4
|
||||||
|
* 82178 Puchheim
|
||||||
|
* Germany
|
||||||
|
* <rtems@embedded-brains.de>
|
||||||
|
*
|
||||||
|
* 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 <rtems/rtems/clock.h>
|
||||||
|
#include <rtems/score/timecounter.h>
|
||||||
|
|
||||||
|
time_t rtems_clock_get_uptime_seconds( void )
|
||||||
|
{
|
||||||
|
return _Timecounter_Time_uptime - 1;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user