[rtems-libbsd commit] Add support for boottimebin and getbinuptime()

Sebastian Huber sebh at rtems.org
Mon Dec 16 14:29:34 UTC 2013


Module:    rtems-libbsd
Branch:    master
Commit:    1fea8c46c1af220d5397763c11ee20c44cc15b87
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=1fea8c46c1af220d5397763c11ee20c44cc15b87

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Dec 12 16:52:24 2013 +0100

Add support for boottimebin and getbinuptime()

---

 rtemsbsd/include/rtems/bsd/sys/time.h |    9 +++++++++
 rtemsbsd/rtems/rtems-bsd-init.c       |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/rtemsbsd/include/rtems/bsd/sys/time.h b/rtemsbsd/include/rtems/bsd/sys/time.h
index 4eeff86..b6f45ba 100644
--- a/rtemsbsd/include/rtems/bsd/sys/time.h
+++ b/rtemsbsd/include/rtems/bsd/sys/time.h
@@ -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);
diff --git a/rtemsbsd/rtems/rtems-bsd-init.c b/rtemsbsd/rtems/rtems-bsd-init.c
index ed46265..c622e53 100644
--- a/rtemsbsd/rtems/rtems-bsd-init.c
+++ b/rtemsbsd/rtems/rtems-bsd-init.c
@@ -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,




More information about the vc mailing list