mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-13 20:19:19 +08:00
Add tvtohz() implementation in new file
This commit is contained in:
parent
493efadb8b
commit
dc4c4909f0
1
Makefile
1
Makefile
@ -384,6 +384,7 @@ C_FILES += \
|
||||
rtemsbsd/src/rtems-bsd-sysctlnametomib.c \
|
||||
rtemsbsd/src/rtems-bsd-uma.c \
|
||||
rtemsbsd/src/rtems-bsd-taskqueue.c \
|
||||
rtemsbsd/src/rtems-bsd-timesupport.c \
|
||||
rtemsbsd/src/rtems-bsd-newproc.c \
|
||||
rtemsbsd/src/rtems-bsd-vm_glue.c
|
||||
|
||||
|
@ -532,6 +532,7 @@ rtems_sourceFiles = [
|
||||
'src/rtems-bsd-sysctlnametomib.c',
|
||||
'src/rtems-bsd-uma.c',
|
||||
'src/rtems-bsd-taskqueue.c',
|
||||
'src/rtems-bsd-timesupport.c',
|
||||
'src/rtems-bsd-newproc.c',
|
||||
'src/rtems-bsd-vm_glue.c',
|
||||
]
|
||||
|
38
rtemsbsd/src/rtems-bsd-timesupport.c
Normal file
38
rtemsbsd/src/rtems-bsd-timesupport.c
Normal file
@ -0,0 +1,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 );
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user