mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-16 00:12:00 +08:00
Add support for boottimebin and getbinuptime()
This commit is contained in:
@@ -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);
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user