source: rtems/cpukit/rtems/src/clockgetuptime.c @ 66cb142

Last change on this file since 66cb142 was 7cd2484, checked in by Alexander Krutwig <alexander.krutwig@…>, on May 12, 2015 at 12:32:47 PM

timecounter: Use in RTEMS

Replace timestamp implementation with FreeBSD bintime and timecounters.

New test sptests/sptimecounter02.

Update #2271.

  • Property mode set to 100644
File size: 1009 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Obtain the System Uptime
5 * @ingroup ClassicClock Clocks
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/clock.h>
22#include <rtems/score/todimpl.h>
23
24/*
25 *  rtems_clock_get_uptime
26 *
27 *  This directive obtains the system uptime.  A timestamp is the seconds
28 *  and nanoseconds since boot.
29 *
30 *  Input parameters:
31 *    timestamp - pointer to the timestamp
32 *
33 *  Output parameters:
34 *    *uptime           - filled in
35 *    RTEMS_SUCCESSFUL - if successful
36 *    error code       - if unsuccessful
37 */
38rtems_status_code rtems_clock_get_uptime(
39  struct timespec *uptime
40)
41{
42  if ( !uptime )
43    return RTEMS_INVALID_ADDRESS;
44
45  _TOD_Get_zero_based_uptime_as_timespec( uptime );
46  return RTEMS_SUCCESSFUL;
47}
Note: See TracBrowser for help on using the repository browser.