Use bitmask_snprintf().

This commit is contained in:
thorpej 1996-11-13 06:48:24 +00:00
parent 5bbb546d40
commit 490126b07a
2 changed files with 32 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdfd.c,v 1.1 1996/11/09 22:27:25 leo Exp $ */
/* $NetBSD: hdfd.c,v 1.2 1996/11/13 06:48:24 thorpej Exp $ */
/*-
* Copyright (c) 1996 Leo Weppelman
@ -800,6 +800,7 @@ fdcstatus(dv, n, s)
char *s;
{
struct fdc_softc *fdc = (void *)dv->dv_parent;
char bits[64];
if (n == 0) {
out_fdc(NE7CMD_SENSEI);
@ -814,15 +815,18 @@ fdcstatus(dv, n, s)
printf("\n");
break;
case 2:
printf(" (st0 %b cyl %d)\n",
fdc->sc_status[0], NE7_ST0BITS,
fdc->sc_status[1]);
printf(" (st0 %s cyl %d)\n",
bitmask_snprintf(fdc->sc_status[0], NE7_ST0BITS,
bits, sizeof(bits)), fdc->sc_status[1]);
break;
case 7:
printf(" (st0 %b st1 %b st2 %b cyl %d head %d sec %d)\n",
fdc->sc_status[0], NE7_ST0BITS,
fdc->sc_status[1], NE7_ST1BITS,
fdc->sc_status[2], NE7_ST2BITS,
printf(" (st0 %s", bitmask_snprintf(fdc->sc_status[0],
NE7_ST0BITS, bits, sizeof(bits)));
printf(" st1 %s", bitmask_snprintf(fdc->sc_status[1],
NE7_ST1BITS, bits, sizeof(bits)));
printf(" st2 %s", bitmask_snprintf(fdc->sc_status[2],
NE7_ST2BITS, bits, sizeof(bits)));
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
break;
#ifdef DIAGNOSTIC
@ -1148,6 +1152,7 @@ void
fdcretry(fdc)
struct fdc_softc *fdc;
{
char bits[64];
struct fd_softc *fd;
struct buf *bp;
@ -1173,10 +1178,14 @@ fdcretry(fdc)
default:
diskerr(bp, "fd", "hard error", LOG_PRINTF,
fd->sc_skip / FDC_BSIZE, (struct disklabel *)NULL);
printf(" (st0 %b st1 %b st2 %b cyl %d head %d sec %d)\n",
fdc->sc_status[0], NE7_ST0BITS,
fdc->sc_status[1], NE7_ST1BITS,
fdc->sc_status[2], NE7_ST2BITS,
printf(" (st0 %s", bitmask_snprintf(fdc->sc_status[0],
NE7_ST0BITS, bits, sizeof(bits)));
printf(" st1 %s", bitmask_snprintf(fdc->sc_status[1],
NE7_ST1BITS, bits, sizeof(bits)));
printf(" st2 %s", bitmask_snprintf(fdc->sc_status[2],
NE7_ST2BITS, bits, sizeof(bits)));
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
bp->b_flags |= B_ERROR;

View File

@ -1,4 +1,4 @@
/* $NetBSD: apm.c,v 1.14 1996/11/06 18:09:43 cgd Exp $ */
/* $NetBSD: apm.c,v 1.15 1996/11/13 06:53:23 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -646,6 +646,7 @@ apmprobe(parent, match, aux)
struct apmregs regs;
u_int okbases[] = { 0, biosbasemem*1024 };
u_int oklimits[] = { NBPG, IOM_END-1 };
char bits[128];
register u_int i;
if (apminited)
@ -655,9 +656,10 @@ apmprobe(parent, match, aux)
regs.bx = APM_DEV_APM_BIOS;
regs.cx = regs.dx = regs.si = regs.di = regs.flags = 0;
bioscall(APM_SYSTEM_BIOS, &regs);
DPRINTF(("apm: bioscall return: %x %x %x %x %b %x %x\n",
DPRINTF(("apm: bioscall return: %x %x %x %x %s %x %x\n",
regs.ax, regs.bx, regs.cx, regs.dx,
regs.flags, I386_FLAGBITS, regs.si, regs.di));
bitmask_snprintf(regs.flags, I386_FLAGBITS,
bits, sizeof(bits)), regs.si, regs.di));
if (regs.flags & PSL_C) {
DPRINTF(("apm: carry set means no APM bios\n"));
@ -683,9 +685,10 @@ apmprobe(parent, match, aux)
regs.bx = APM_DEV_APM_BIOS;
regs.cx = regs.dx = regs.si = regs.di = regs.flags = 0;
bioscall(APM_SYSTEM_BIOS, &regs);
DPRINTF(("apm: bioscall return: %x %x %x %x %b %x %x\n",
DPRINTF(("apm: bioscall return: %x %x %x %x %s %x %x\n",
regs.ax, regs.bx, regs.cx, regs.dx,
regs.flags, I386_FLAGBITS, regs.si, regs.di));
bitmask_snprintf(regs.flags, I386_FLAGBITS,
bits, sizeof(bits)), regs.si, regs.di));
/*
* And connect to it.
@ -694,9 +697,10 @@ apmprobe(parent, match, aux)
regs.bx = APM_DEV_APM_BIOS;
regs.cx = regs.dx = regs.si = regs.di = regs.flags = 0;
bioscall(APM_SYSTEM_BIOS, &regs);
DPRINTF(("apm: bioscall return: %x %x %x %x %b %x %x\n",
DPRINTF(("apm: bioscall return: %x %x %x %x %s %x %x\n",
regs.ax, regs.bx, regs.cx, regs.dx,
regs.flags, I386_FLAGBITS, regs.si, regs.di));
butmask_snprintf(regs.flags, I386_FLAGBITS,
bits, sizeof(bits)), regs.si, regs.di));
apminfo.apm_code32_seg_base = regs.ax << 4;
apminfo.apm_entrypt = regs.bx;