mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 08:00:51 +08:00
Add support for boottimebin and getbinuptime()
This commit is contained in:
parent
1d42ceb11e
commit
1fea8c46c1
@ -293,6 +293,7 @@ rtems_bsd_time_uptime(void)
|
|||||||
#define time_second rtems_bsd_time_second()
|
#define time_second rtems_bsd_time_second()
|
||||||
#define time_uptime rtems_bsd_time_uptime()
|
#define time_uptime rtems_bsd_time_uptime()
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
|
extern struct bintime boottimebin;
|
||||||
extern struct timeval boottime;
|
extern struct timeval boottime;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -355,7 +356,15 @@ microtime(struct timeval *tvp)
|
|||||||
}
|
}
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
void getbinuptime(struct bintime *bt);
|
void getbinuptime(struct bintime *bt);
|
||||||
|
#else /* __rtems__ */
|
||||||
|
static inline void
|
||||||
|
getbinuptime(struct bintime *bt)
|
||||||
|
{
|
||||||
|
binuptime(bt);
|
||||||
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
void getnanouptime(struct timespec *tsp);
|
void getnanouptime(struct timespec *tsp);
|
||||||
#ifndef __rtems__
|
#ifndef __rtems__
|
||||||
void getmicrouptime(struct timeval *tvp);
|
void getmicrouptime(struct timeval *tvp);
|
||||||
|
@ -69,6 +69,7 @@ int hz;
|
|||||||
int tick;
|
int tick;
|
||||||
int maxusers; /* base tunable */
|
int maxusers; /* base tunable */
|
||||||
|
|
||||||
|
struct bintime boottimebin;
|
||||||
struct timeval boottime;
|
struct timeval boottime;
|
||||||
|
|
||||||
rtems_status_code
|
rtems_status_code
|
||||||
@ -81,6 +82,7 @@ rtems_bsd_initialize(void)
|
|||||||
maxusers = 1;
|
maxusers = 1;
|
||||||
|
|
||||||
gettimeofday(&boottime, NULL);
|
gettimeofday(&boottime, NULL);
|
||||||
|
timeval2bintime(&boottime, &boottimebin);
|
||||||
|
|
||||||
sc = rtems_timer_initiate_server(
|
sc = rtems_timer_initiate_server(
|
||||||
BSD_TASK_PRIORITY_TIMER,
|
BSD_TASK_PRIORITY_TIMER,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user