summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/src/rtems-bsd-timesupport.c
blob: 4e6998e4028de20b9a024f3229534eeb7669c9d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
 * @file
 *
 * @ingroup rtems_bsd_rtems
 *
 * @brief TODO.
 */

/*
 *  COPYRIGHT (c) 1989-2012.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 */

/*
 * This violation is specifically for _Timespec_To_ticks
 */
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 
#include <freebsd/machine/rtems-bsd-config.h>

#include <rtems/score/timespec.h>

/*
 * Compute number of ticks in the specified amount of time.
 */
int
tvtohz(struct timeval *tv)
{
  struct timespec ts;

  ts.tv_sec = tv->tv_sec;
  ts.tv_nsec = tv->tv_usec * 1000;

  (int) _Timespec_To_ticks( &ts );
}