+
+/*
+ * Wake up every second and if an interrupt is pending
+ * but nothing has happened increment a counter.
+ * If nothing happens for 20 seconds, reset the controller
+ * and begin anew.
+ */
+upwatch()
+{
+ int i;
+
+ timeout((caddr_t)upwatch, 0, HZ);
+ if (uptab.b_active == 0) {
+ for (i = 0; i < NUP; i++)
+ if (uputab[i].b_active)
+ goto active;
+ up_wticks = 0; /* idling */
+ return;
+ }
+active:
+ up_wticks++;
+ if (up_wticks >= 20) {
+ up_wticks = 0;
+ printf("LOST INTERRUPT RESET");
+ upreset();
+ printf("\n");
+ }
+}