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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [posix/] [src/] [posixintervaltotimespec.c] - Blame information for rev 1026

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

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

powered by: WebSVN 2.1.0

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