hook for ps driver and untimeout stuff for lucas drivers
[unix-history] / usr / src / sys / kern / subr_prf.c
index 9108ff0..c7d1cc9 100644 (file)
@@ -1,4 +1,4 @@
-/*     subr_prf.c      4.12    %G%     */
+/*     subr_prf.c      4.21    82/01/16        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -92,7 +92,7 @@ again:
        case 'o': case 'O':
                b = 8;
 number:
        case 'o': case 'O':
                b = 8;
 number:
-               printn(*adx, b, touser);
+               printn((u_long)*adx, b, touser);
                break;
        case 'c':
                b = *adx;
                break;
        case 'c':
                b = *adx;
@@ -103,7 +103,7 @@ number:
        case 'b':
                b = *adx++;
                s = (char *)*adx;
        case 'b':
                b = *adx++;
                s = (char *)*adx;
-               printn(b, *s++, touser);
+               printn((u_long)b, *s++, touser);
                any = 0;
                if (b) {
                        putchar('<', touser);
                any = 0;
                if (b) {
                        putchar('<', touser);
@@ -118,7 +118,8 @@ number:
                                        for (; *s > 32; s++)
                                                ;
                        }
                                        for (; *s > 32; s++)
                                                ;
                        }
-                       putchar('>', touser);
+                       if (any)
+                               putchar('>', touser);
                }
                break;
 
                }
                break;
 
@@ -127,6 +128,10 @@ number:
                while (c = *s++)
                        putchar(c, touser);
                break;
                while (c = *s++)
                        putchar(c, touser);
                break;
+
+       case '%':
+               putchar('%', touser);
+               break;
        }
        adx++;
        goto loop;
        }
        adx++;
        goto loop;
@@ -137,7 +142,7 @@ number:
  * We don't use recursion to avoid deep kernel stacks.
  */
 printn(n, b, touser)
  * We don't use recursion to avoid deep kernel stacks.
  */
 printn(n, b, touser)
-       unsigned long n;
+       u_long n;
 {
        char prbuf[11];
        register char *cp;
 {
        char prbuf[11];
        register char *cp;
@@ -165,23 +170,36 @@ printn(n, b, touser)
 panic(s)
        char *s;
 {
 panic(s)
        char *s;
 {
-       int bootopt = panicstr ? RB_AUTOBOOT : RB_AUTOBOOT|RB_NOSYNC;
+       int bootopt = RB_AUTOBOOT;
 
 
+       if (panicstr)
+               bootopt |= RB_NOSYNC;
        panicstr = s;
        printf("panic: %s\n", s);
        panicstr = s;
        printf("panic: %s\n", s);
-       (void) spl0();
        boot(RB_PANIC, bootopt);
 }
 
        boot(RB_PANIC, bootopt);
 }
 
+/*
+ * Warn that a system table is full.
+ */
+tablefull(tab)
+       char *tab;
+{
+
+       printf("%s: table is full\n", tab);
+}
+
 /*
  * Hard error is the preface to plaintive error messages
 /*
  * Hard error is the preface to plaintive error messages
- * about failing device transfers.
+ * about failing disk transfers.
  */
  */
-harderr(bp)
+harderr(bp, cp)
        struct buf *bp;
        struct buf *bp;
+       char *cp;
 {
 
 {
 
-       printf("hard err bn%d ", bp->b_blkno);
+       printf("%s%d%c: hard error sn%d ", cp,
+           dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno);
 }
 
 /*
 }
 
 /*
@@ -197,11 +215,11 @@ putchar(c, touser)
        if (touser) {
                register struct tty *tp = u.u_ttyp;
 
        if (touser) {
                register struct tty *tp = u.u_ttyp;
 
-               if (tp && (tp->t_state&CARR_ON)) {
+               if (tp && (tp->t_state&TS_CARR_ON)) {
                        register s = spl6();
                        if (c == '\n')
                        register s = spl6();
                        if (c == '\n')
-                               ttyoutput('\r', tp);
-                       ttyoutput(c, tp);
+                               (void) ttyoutput('\r', tp);
+                       (void) ttyoutput(c, tp);
                        ttstart(tp);
                        splx(s);
                }
                        ttstart(tp);
                        splx(s);
                }