[PATCH libbsd] freebsd/sys/dev/e1000: Fix long timeout

dufault at hda.com dufault at hda.com
Thu Feb 1 11:00:45 UTC 2024


From: Peter Dufault <dufault at hda.com>

- safe_pause_us() and safe_pause_ms() depend on the clock tick.  Use DELAY().
---
 freebsd/sys/dev/e1000/e1000_osdep.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/freebsd/sys/dev/e1000/e1000_osdep.h b/freebsd/sys/dev/e1000/e1000_osdep.h
index 70db294..15dfc6f 100644
--- a/freebsd/sys/dev/e1000/e1000_osdep.h
+++ b/freebsd/sys/dev/e1000/e1000_osdep.h
@@ -80,6 +80,7 @@ ms_scale(int x) {
 	}
 }
 
+#if !defined(__rtems__)
 static inline void
 safe_pause_us(int x) {
 	if (cold) {
@@ -97,6 +98,17 @@ safe_pause_ms(int x) {
 		pause("e1000_delay", ms_scale(x));
 	}
 }
+#else
+static inline void
+safe_pause_us(int x) {
+  DELAY(x);
+}
+
+static inline void
+safe_pause_ms(int x) {
+  DELAY(x*1000);
+}
+#endif
 
 #define usec_delay(x) safe_pause_us(x)
 #define usec_delay_irq(x) usec_delay(x)
-- 
1.8.3.1



More information about the devel mailing list