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

4.104.115
Last change on this file since c16bcc0 was c16bcc0, checked in by Joel Sherrill <joel.sherrill@…>, on 12/08/08 at 19:41:31

2008-12-08 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/times.c, libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c, posix/src/clockgettime.c, posix/src/pthread.c, posix/src/timersettime.c, rtems/include/rtems/rtems/ratemon.h, rtems/src/clockgetsecondssinceepoch.c, rtems/src/clockgetuptime.c, rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c, rtems/src/ratemonreportstatistics.c, rtems/src/taskwakewhen.c, rtems/src/timerfirewhen.c, rtems/src/timerserver.c, rtems/src/timerserverfirewhen.c, score/Makefile.am, score/preinstall.am, score/include/rtems/score/thread.h, score/include/rtems/score/tod.h, score/src/coretod.c, score/src/coretodget.c, score/src/coretodgetuptime.c, score/src/coretodset.c, score/src/coretodtickle.c, score/src/threaddispatch.c, score/src/threadinitialize.c: Add SuperCore? handler Timestamp to provide an opaque class for the representation and manipulation of uptime, time of day, and the difference between two timestamps. By using SuperCore? Timestamp, it is clear which methods and APIs really have to be struct timespec and which can be in an optimized native format.
  • score/include/rtems/score/timestamp.h, score/src/coretodgetuptimetimespec.c: New files.
  • 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/timestamp.h>
24#include <rtems/score/tod.h>
25#include <rtems/score/watchdog.h>
26
27/*PAGE
28 *
29 *  rtems_clock_get_uptime
30 *
31 *  This directive obtains the system uptime.  A timestamp is the seconds
32 *  and nanoseconds since boot.
33 *
34 *  Input parameters:
35 *    timestamp - pointer to the timestamp
36 *
37 *  Output parameters:
38 *    *uptime           - filled in
39 *    RTEMS_SUCCESSFUL - if successful
40 *    error code       - if unsuccessful
41 */
42rtems_status_code rtems_clock_get_uptime(
43  struct timespec *uptime
44)
45{
46  if ( !uptime )
47    return RTEMS_INVALID_ADDRESS;
48 
49  _TOD_Get_uptime_as_timespec( uptime );
50  return RTEMS_SUCCESSFUL;
51}
Note: See TracBrowser for help on using the repository browser.