From 7e197f834fa2199a59a393007905b6e856c5b02c Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sat, 4 May 1991 23:41:54 -0800 Subject: [PATCH] use standard printf from stand/printf.c; add scankdb stub SCCS-vsn: sys/vax/stand/prf.c 7.8 --- usr/src/sys/vax/stand/prf.c | 102 ++---------------------------------- 1 file changed, 4 insertions(+), 98 deletions(-) diff --git a/usr/src/sys/vax/stand/prf.c b/usr/src/sys/vax/stand/prf.c index d04af4c389..47d141c237 100644 --- a/usr/src/sys/vax/stand/prf.c +++ b/usr/src/sys/vax/stand/prf.c @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)prf.c 7.7 (Berkeley) %G% + * @(#)prf.c 7.8 (Berkeley) %G% */ #include "sys/param.h" @@ -11,103 +11,6 @@ #include "../include/mtpr.h" #include "../vax/cons.h" -/* - * Scaled down version of C Library printf. - * Used to print diagnostic information directly on console tty. - * Since it is not interrupt driven, all system activities are - * suspended. Printf should not be used for chit-chat. - * - * One additional format: %b is supported to decode error registers. - * Usage is: - * printf("reg=%b\n", regval, "*"); - * Where is the output base expressed as a control character, - * e.g. \10 gives octal; \20 gives hex. Each arg is a sequence of - * characters, the first of which gives the bit number to be inspected - * (origin 1), and the next characters (up to a control character, i.e. - * a character <= 32), give the name of the register. Thus - * printf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n"); - * would produce output: - * reg=2 - */ -/*VARARGS1*/ -printf(fmt, x1) - char *fmt; - unsigned x1; -{ - - prf(fmt, &x1); -} - -prf(fmt, adx) - register char *fmt; - register u_int *adx; -{ - register int b, c, i; - char *s; - int any; - -loop: - while ((c = *fmt++) != '%') { - if(c == '\0') - return; - putchar(c); - } -again: - c = *fmt++; - /* THIS CODE IS VAX DEPENDENT IN HANDLING %l? AND %c */ - switch (c) { - - case 'l': - goto again; - case 'x': case 'X': - b = 16; - goto number; - case 'd': case 'D': - case 'u': /* what a joke */ - b = 10; - goto number; - case 'o': case 'O': - b = 8; -number: - printn((u_long)*adx, b); - break; - case 'c': - b = *adx; - for (i = 24; i >= 0; i -= 8) - if (c = (b >> i) & 0x7f) - putchar(c); - break; - case 'b': - b = *adx++; - s = (char *)*adx; - printn((u_long)b, *s++); - any = 0; - if (b) { - while (i = *s++) { - if (b & (1 << (i-1))) { - putchar(any? ',' : '<'); - any = 1; - for (; (c = *s) > 32; s++) - putchar(c); - } else - for (; *s > 32; s++) - ; - } - if (any) - putchar('>'); - } - break; - - case 's': - s = (char *)*adx; - while (c = *s++) - putchar(c); - break; - } - adx++; - goto loop; -} - /* * Print a character on console. */ @@ -144,6 +47,9 @@ putchar(c) mtpr(TXCS, s); } +scankbd() +{} + getchar() { register c; -- 2.20.1