source: rtems-libbsd/rtemsbsd/src/rtems-bsd-timesupport.c @ 772d929

4.1155-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since 772d929 was dc4c490, checked in by Joel Sherrill <joel.sherrill@…>, on 04/04/12 at 22:38:25

Add tvtohz() implementation in new file

  • Property mode set to 100644
File size: 733 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup rtems_bsd_rtems
5 *
6 * @brief TODO.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2012.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 */
17
18/*
19 * This violation is specifically for _Timespec_To_ticks
20 */
21#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
22#include <freebsd/machine/rtems-bsd-config.h>
23
24#include <rtems/score/timespec.h>
25
26/*
27 * Compute number of ticks in the specified amount of time.
28 */
29int
30tvtohz(struct timeval *tv)
31{
32  struct timespec ts;
33
34  ts.tv_sec = tv->tv_sec;
35  ts.tv_nsec = tv->tv_usec * 1000;
36
37  (int) _Timespec_To_ticks( &ts );
38}
Note: See TracBrowser for help on using the repository browser.