source: rtems/cpukit/rtems/src/clockgetuptime.c @ ebe61382

4.104.114.95
Last change on this file since ebe61382 was 812da54, checked in by Joel Sherrill <joel.sherrill@…>, on 04/02/07 at 18:23:59

2007-04-02 Joel Sherrill <joel@…>

  • itron/src/itrontime.c, libcsupport/src/gettod.c, posix/include/rtems/posix/time.h, posix/include/rtems/posix/timer.h, posix/src/clockgettime.c, posix/src/clocksettime.c, posix/src/nanosleep.c, posix/src/posixtimespecsubtract.c, posix/src/posixtimespectointerval.c, posix/src/ptimer1.c, posix/src/sleep.c, rtems/Makefile.am, rtems/include/rtems/rtems/clock.h, rtems/include/rtems/rtems/timer.h, rtems/include/rtems/rtems/types.h, rtems/src/clockget.c, rtems/src/clockset.c, rtems/src/clocktodtoseconds.c, rtems/src/clocktodvalidate.c, rtems/src/taskwakewhen.c, score/Makefile.am, score/include/rtems/score/tod.h, score/inline/rtems/score/tod.inl, score/src/coretod.c, score/src/coretodset.c: Convert from Classic API style TOD_Control as fundamental time structure to POSIX struct timespec. Add clock_get_uptime().
  • rtems/src/clockgetuptime.c, score/src/coretodget.c, score/src/coretodgetuptime.c: New files.
  • score/src/coretodtickle.c, score/src/coretodtoseconds.c, score/src/coretodvalidate.c: Removed.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  Clock Manager - get uptime
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/rtems/status.h>
20#include <rtems/rtems/clock.h>
21#include <rtems/score/isr.h>
22#include <rtems/score/thread.h>
23#include <rtems/score/tod.h>
24#include <rtems/score/watchdog.h>
25
26/*PAGE
27 *
28 *  rtems_clock_get_uptime
29 *
30 *  This directive obtains the system uptime.  A timestamp is the seconds
31 *  and nanoseconds since boot.
32 *
33 *  Input parameters:
34 *    timestamp - pointer to the timestamp
35 *
36 *  Output parameters:
37 *    *uptime           - filled in
38 *    RTEMS_SUCCESSFUL - if successful
39 *    error code       - if unsuccessful
40 */
41rtems_status_code rtems_clock_get_uptime(
42  struct timespec *uptime
43)
44{
45  if ( !uptime )
46    return RTEMS_INVALID_ADDRESS;
47 
48  _TOD_Get_uptime( uptime );
49  return RTEMS_SUCCESSFUL;
50}
Note: See TracBrowser for help on using the repository browser.