Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Use #include <sys/kernel.h> instead of a '...



details:   https://anonhg.NetBSD.org/src/rev/bf654d174087
branches:  trunk
changeset: 486883:bf654d174087
user:      oster <oster%NetBSD.org@localhost>
date:      Tue May 30 02:04:29 2000 +0000

description:
Use #include <sys/kernel.h> instead of a 'extern int hz'.
Make this file more readable.

diffstat:

 sys/dev/raidframe/rf_revent.c |  45 +++++++++++++++++++++---------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diffs (108 lines):

diff -r e1d08be416f4 -r bf654d174087 sys/dev/raidframe/rf_revent.c
--- a/sys/dev/raidframe/rf_revent.c     Tue May 30 01:49:19 2000 +0000
+++ b/sys/dev/raidframe/rf_revent.c     Tue May 30 02:04:29 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_revent.c,v 1.6 2000/01/07 03:56:14 oster Exp $      */
+/*     $NetBSD: rf_revent.c,v 1.7 2000/05/30 02:04:29 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -47,10 +47,10 @@
 
 
 #include <sys/proc.h>
+#include <sys/kernel.h>
 
-extern int hz;
-
-#define DO_WAIT(_rc)   tsleep(&(_rc)->eventQueue, PRIBIO, "raidframe eventq", 0)
+#define DO_WAIT(_rc)  \
+       tsleep(&(_rc)->eventQueue, PRIBIO,  "raidframe eventq", 0)
 
 #define DO_SIGNAL(_rc)     wakeup(&(_rc)->eventQueue)
 
@@ -88,11 +88,10 @@
            (RF_ReconEvent_t *));
        return (0);
 }
-/* returns the next reconstruction event, blocking the calling thread until
- * one becomes available
- */
 
-/* will now return null if it is blocked or will return an event if it is not */
+/* returns the next reconstruction event, blocking the calling thread
+ * until one becomes available.  will now return null if it is blocked
+ * or will return an event if it is not */
 
 RF_ReconEvent_t *
 rf_GetNextReconEvent(reconDesc, row, continueFunc, continueArg)
@@ -107,16 +106,16 @@
 
        RF_ASSERT(row >= 0 && row <= raidPtr->numRow);
        RF_LOCK_MUTEX(rctrl->eq_mutex);
-       RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0));       /* q null and count==0
-                                                                                * must be equivalent
-                                                                                * conditions */
-
+       /* q null and count==0 must be equivalent conditions */
+       RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0));
 
        rctrl->continueFunc = continueFunc;
        rctrl->continueArg = continueArg;
 
 
-/* mpsleep timeout value: secs = timo_val/hz.  'ticks' here is defined as cycle-counter ticks, not softclock ticks */
+       /* mpsleep timeout value: secs = timo_val/hz.  'ticks' here is
+          defined as cycle-counter ticks, not softclock ticks */
+
 #define MAX_RECON_EXEC_USECS (100 * 1000)  /* 100 ms */
 #define RECON_DELAY_MS 25
 #define RECON_TIMO     ((RECON_DELAY_MS * hz) / 1000)
@@ -131,16 +130,19 @@
 
                RF_ETIMER_STOP(reconDesc->recon_exec_timer);
                RF_ETIMER_EVAL(reconDesc->recon_exec_timer);
-               reconDesc->reconExecTicks += RF_ETIMER_VAL_US(reconDesc->recon_exec_timer);
+               reconDesc->reconExecTicks += 
+                       RF_ETIMER_VAL_US(reconDesc->recon_exec_timer);
                if (reconDesc->reconExecTicks > reconDesc->maxReconExecTicks)
-                       reconDesc->maxReconExecTicks = reconDesc->reconExecTicks;
+                       reconDesc->maxReconExecTicks = 
+                               reconDesc->reconExecTicks;
                if (reconDesc->reconExecTicks >= MAX_RECON_EXEC_USECS) {
                        /* we've been running too long.  delay for
                         * RECON_DELAY_MS */
 #if RF_RECON_STATS > 0
                        reconDesc->numReconExecDelays++;
 #endif                         /* RF_RECON_STATS > 0 */
-                       status = tsleep(&reconDesc->reconExecTicks, PRIBIO, "recon delay", RECON_TIMO);
+                       status = tsleep(&reconDesc->reconExecTicks, 
+                                       PRIBIO, "recon delay", RECON_TIMO);
                        RF_ASSERT(status == EWOULDBLOCK);
                        reconDesc->reconExecTicks = 0;
                }
@@ -160,9 +162,9 @@
        rctrl->eventQueue = event->next;
        event->next = NULL;
        rctrl->eq_count--;
-       RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0));       /* q null and count==0
-                                                                                * must be equivalent
-                                                                                * conditions */
+
+       /* q null and count==0 must be equivalent conditions */
+       RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0));
        RF_UNLOCK_MUTEX(rctrl->eq_mutex);
        return (event);
 }
@@ -183,9 +185,8 @@
        }
        RF_ASSERT(row >= 0 && row <= raidPtr->numRow && col >= 0 && col <= raidPtr->numCol);
        RF_LOCK_MUTEX(rctrl->eq_mutex);
-       RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0));       /* q null and count==0
-                                                                                * must be equivalent
-                                                                                * conditions */
+       /* q null and count==0 must be equivalent conditions */
+       RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0));
        event->next = rctrl->eventQueue;
        rctrl->eventQueue = event;
        rctrl->eq_count++;



Home | Main Index | Thread Index | Old Index