Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/linux Add mdelay to <...



details:   https://anonhg.NetBSD.org/src/rev/e983908532c8
branches:  riastradh-drm2
changeset: 788395:e983908532c8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 03:36:10 2013 +0000

description:
Add mdelay to <linux/delay.h>.

diffstat:

 sys/external/bsd/drm2/include/linux/delay.h |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 32567a1e6af3 -r e983908532c8 sys/external/bsd/drm2/include/linux/delay.h
--- a/sys/external/bsd/drm2/include/linux/delay.h       Wed Jul 24 03:35:50 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/delay.h       Wed Jul 24 03:36:10 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: delay.h,v 1.1.2.3 2013/07/24 03:31:29 riastradh Exp $  */
+/*     $NetBSD: delay.h,v 1.1.2.4 2013/07/24 03:36:10 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,10 +40,23 @@
 
 #define        udelay  DELAY
 
+#define        MAX_UDELAY_MS   5
+
 static inline void
 msleep(unsigned int msec)
 {
        (void)kpause("lnxmslep", false, mstohz(msec), NULL);
 }
 
+static inline void
+mdelay(unsigned int msec)
+{
+
+       if (msec < MAX_UDELAY_MS)
+               udelay(msec * 1000);
+       else
+               while (msec--)
+                       udelay(1000);
+}
+
 #endif  /* _LINUX_DELAY_H_ */



Home | Main Index | Thread Index | Old Index