Add support for boottimebin and getbinuptime()

This commit is contained in:
Sebastian Huber 2013-12-12 16:52:24 +01:00
parent 1d42ceb11e
commit 1fea8c46c1
2 changed files with 11 additions and 0 deletions

View File

@ -293,6 +293,7 @@ rtems_bsd_time_uptime(void)
#define time_second rtems_bsd_time_second()
#define time_uptime rtems_bsd_time_uptime()
#endif /* __rtems__ */
extern struct bintime boottimebin;
extern struct timeval boottime;
/*
@ -355,7 +356,15 @@ microtime(struct timeval *tvp)
}
#endif /* __rtems__ */
#ifndef __rtems__
void getbinuptime(struct bintime *bt);
#else /* __rtems__ */
static inline void
getbinuptime(struct bintime *bt)
{
binuptime(bt);
}
#endif /* __rtems__ */
void getnanouptime(struct timespec *tsp);
#ifndef __rtems__
void getmicrouptime(struct timeval *tvp);

View File

@ -69,6 +69,7 @@ int hz;
int tick;
int maxusers; /* base tunable */
struct bintime boottimebin;
struct timeval boottime;
rtems_status_code
@ -81,6 +82,7 @@ rtems_bsd_initialize(void)
maxusers = 1;
gettimeofday(&boottime, NULL);
timeval2bintime(&boottime, &boottimebin);
sc = rtems_timer_initiate_server(
BSD_TASK_PRIORITY_TIMER,