source: rtems/cpukit/score/src/coretodgetuptimetimespec.c @ 5472ad41

4.115
Last change on this file since 5472ad41 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: 905 bytes
Line 
1/*
2 *  Time of Day (TOD) Handler - get uptime
3 */
4
5/*  COPYRIGHT (c) 1989-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/timestamp.h>
22#include <rtems/score/tod.h>
23
24/*
25 *  _TOD_Get_uptime_as_timespec
26 *
27 *  This routine is used to obtain the system uptime
28 *
29 *  Input parameters:
30 *    time  - pointer to the timestamp structure
31 *
32 *  Output parameters: NONE
33 */
34
35void _TOD_Get_uptime_as_timespec(
36  struct timespec *uptime
37)
38{
39  Timestamp_Control uptime_ts;
40
41  /* assume time checked for NULL by caller */
42  _TOD_Get_uptime( &uptime_ts );
43  _Timestamp_To_timespec( &uptime_ts, uptime );
44}
Note: See TracBrowser for help on using the repository browser.