OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [posixintervaltotimespec.c] - Blame information for rev 619

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: posixintervaltotimespec.c,v 1.2 2001-09-27 11:59:17 chris Exp $
3
 */
4
 
5
#include <assert.h>
6
#include <time.h>
7
#include <errno.h>
8
 
9
#include <rtems/system.h>
10
#include <rtems/score/isr.h>
11
#include <rtems/score/thread.h>
12
#include <rtems/score/tod.h>
13
 
14
#include <rtems/posix/seterr.h>
15
#include <rtems/posix/time.h>
16
 
17
/*PAGE
18
 *
19
 *  _POSIX_Interval_to_timespec
20
 */
21
 
22
void _POSIX_Interval_to_timespec(
23
  Watchdog_Interval  ticks,
24
  struct timespec   *time
25
)
26
{
27
  unsigned32  usecs;
28
 
29
  usecs = ticks * _TOD_Microseconds_per_tick;
30
 
31
  time->tv_sec  = usecs / TOD_MICROSECONDS_PER_SECOND;
32
  time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) *
33
                    TOD_NANOSECONDS_PER_MICROSECOND;
34
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.