[PATCH 5/6] libnetworking: Use rtems_clock_get_uptime_timeval

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Nov 16 15:31:10 UTC 2012


---
 cpukit/libnetworking/rtems/rtems_bsdnet_internal.h |    6 +++++-
 cpukit/libnetworking/rtems/rtems_glue.c            |   13 -------------
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
index 6bd2682..c5ca26b 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -61,7 +61,11 @@ void *memset(void *s, int c, size_t n);
 #define panic	rtems_panic
 #define suser(a,b)	0
 
-void	microtime (struct timeval *tv);
+static inline void microtime(struct timeval *tv)
+{
+  rtems_clock_get_uptime_timeval(tv);
+}
+
 #define hz rtems_bsdnet_ticks_per_second
 #define tick rtems_bsdnet_microseconds_per_tick
 
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c
index ab7f7c9..1f208ae 100644
--- a/cpukit/libnetworking/rtems/rtems_glue.c
+++ b/cpukit/libnetworking/rtems/rtems_glue.c
@@ -714,19 +714,6 @@ rtems_status_code rtems_bsdnet_event_receive (
 	return sc;
 }
 
-/*
- * Return time since startup
- */
-void
-microtime (struct timeval *t)
-{
-	rtems_interval now;
-
-	now = rtems_clock_get_ticks_since_boot();
-	t->tv_sec = now / rtems_bsdnet_ticks_per_second;
-	t->tv_usec = (now % rtems_bsdnet_ticks_per_second) * rtems_bsdnet_microseconds_per_tick;
-}
-
 unsigned long
 rtems_bsdnet_seconds_since_boot (void)
 {
-- 
1.7.7




More information about the devel mailing list