source: rtems/cpukit/score/src/timespecgetasnanoseconds.c @ 25f5730f

4.115
Last change on this file since 25f5730f was 2d1bdc8, checked in by Chris Johns <chrisj@…>, on 12/24/13 at 05:38:42

cpukit/rtems: Add rtems_clock_get_uptime_nanoseconds to the RTEMS API.

Add Timestamp support in the score to return a timestamp in nanoseconds.
Add a test.
Update the RTEMS API documentation.

  • Property mode set to 100644
File size: 603 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief Get As Nanoseconds
5 *  @ingroup Timespec
6 */
7
8/*
9 *  COPYRIGHT (c) 2013 Chris Johns <chrisj@rtems.org>
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <rtems/score/timespec.h>
21#include <rtems/score/todimpl.h>
22
23uint64_t _Timespec_Get_As_nanoseconds(
24  const struct timespec *time,
25  const uint32_t nanoseconds
26)
27{
28  return ( ((uint64_t) time->tv_sec) * 1000000000ULL ) + time->tv_nsec + nanoseconds;
29}
Note: See TracBrowser for help on using the repository browser.