replace bitmask_snprintf(9) with snprintb(3)

This commit is contained in:
christos 2008-12-16 22:35:21 +00:00
parent c057bf8352
commit 9a5d3f2817
104 changed files with 975 additions and 1121 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_eca.c,v 1.8 2007/10/17 19:52:52 garbled Exp $ */
/* $NetBSD: if_eca.c,v 1.9 2008/12/16 22:35:21 christos Exp $ */
/*-
* Copyright (c) 2001 Ben Harris
@ -29,7 +29,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: if_eca.c,v 1.8 2007/10/17 19:52:52 garbled Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_eca.c,v 1.9 2008/12/16 22:35:21 christos Exp $");
#include <sys/device.h>
#include <sys/malloc.h>
@ -272,7 +272,7 @@ eca_tx_downgrade(void)
else {
log(LOG_ERR, "%s: incomplete transmission\n",
sc->sc_dev.dv_xname);
bitmask_snprintf(sr1, MC6854_SR1_BITS, buf, 128);
snprintb(buf, 128, MC6854_SR1_BITS, sr1);
log(LOG_ERR, "%s: SR1 = %s\n",
sc->sc_dev.dv_xname, buf);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.39 2008/06/12 23:22:36 cegger Exp $ */
/* $NetBSD: fd.c,v 1.40 2008/12/16 22:35:21 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.39 2008/06/12 23:22:36 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.40 2008/12/16 22:35:21 christos Exp $");
#include "opt_ddb.h"
@ -841,39 +841,26 @@ fdcstart(fdc)
(void) fdcintr(fdc);
}
void
fdcstatus(dv, n, s)
struct device *dv;
int n;
const char *s;
static void
fdcpstatus(int n, struct fdc_softc *fdc)
{
struct fdc_softc *fdc = (void *) device_parent(dv);
char bits[64];
if (n == 0) {
out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
(void) fdcresult(fdc);
n = 2;
}
printf("%s: %s", dv->dv_xname, s);
switch (n) {
case 0:
printf("\n");
break;
case 2:
printf(" (st0 %s cyl %d)\n",
bitmask_snprintf(fdc->sc_status[0], NE7_ST0BITS,
bits, sizeof(bits)), fdc->sc_status[1]);
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
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)));
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
break;
@ -885,6 +872,24 @@ fdcstatus(dv, n, s)
}
}
void
fdcstatus(dv, n, s)
struct device *dv;
int n;
const char *s;
{
struct fdc_softc *fdc = (void *) device_parent(dv);
if (n == 0) {
out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
(void) fdcresult(fdc);
n = 2;
}
printf("%s: %s", dv->dv_xname, s);
fdcpstatus(n, fdc);
}
void
fdctimeout(arg)
void *arg;
@ -1243,7 +1248,6 @@ void
fdcretry(fdc)
struct fdc_softc *fdc;
{
char bits[64];
struct fd_softc *fd;
struct buf *bp;
@ -1274,23 +1278,7 @@ fdcretry(fdc)
diskerr(bp, "fd", "hard error", LOG_PRINTF,
fd->sc_skip / FDC_BSIZE,
(struct disklabel *)NULL);
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]);
fdcpstatus(7, fdc);
}
bp->b_error = EIO;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.c,v 1.82 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: cpu.c,v 1.83 2008/12/16 22:35:22 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -59,7 +59,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.82 2008/04/28 20:23:10 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.83 2008/12/16 22:35:22 christos Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -378,10 +378,12 @@ cpu_announce_extensions(struct cpu_info *ci)
cpu_amask &= amask;
}
if (amask)
if (amask) {
snprintb(bits, sizeof(bits),
ALPHA_AMASK_BITS, cpu_amask);
printf("%s: Architecture extensions: %s\n",
ci->ci_softc->sc_dev.dv_xname, bitmask_snprintf(cpu_amask,
ALPHA_AMASK_BITS, bits, sizeof(bits)));
ci->ci_softc->sc_dev.dv_xname, bits);
}
}
#if defined(MULTIPROCESSOR)

View File

@ -1,4 +1,4 @@
/* $NetBSD: cia.c,v 1.65 2008/04/28 20:23:11 martin Exp $ */
/* $NetBSD: cia.c,v 1.66 2008/12/16 22:35:22 christos Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.65 2008/04/28 20:23:11 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.66 2008/12/16 22:35:22 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -301,10 +301,10 @@ ciaattach(parent, self, aux)
printf(": DECchip 2117x Core Logic Chipset (%s), pass %d\n",
name, pass);
if (ccp->cc_cnfg)
printf("%s: extended capabilities: %s\n", self->dv_xname,
bitmask_snprintf(ccp->cc_cnfg, CIA_CSR_CNFG_BITS,
bits, sizeof(bits)));
if (ccp->cc_cnfg) {
snprintb(bits, sizeof(bits), CIA_CSR_CNFG_BITS, ccp->cc_cnfg);
printf("%s: extended capabilities: %s\n", self->dv_xname, bits);
}
switch (ccp->cc_flags & (CCF_PCI_USE_BWX|CCF_BUS_USE_BWX)) {
case CCF_PCI_USE_BWX|CCF_BUS_USE_BWX:

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.120 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: trap.c,v 1.121 2008/12/16 22:35:22 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@ -83,7 +83,7 @@
#include "opt_fpu_emulate.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.120 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.121 2008/12/16 22:35:22 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -360,10 +360,9 @@ trapmmufault(type, code, v, fp, l, sticks)
if (machineid & AMIGA_68060) {
if (--donomore == 0 || mmudebug & 1) {
char bits[64];
snprintb(bits, sizeof(bits), FSLW_STRING, code);
printf ("68060 access error: pc %x, code %s,"
" ea %x\n", fp->f_pc,
bitmask_snprintf(code, FSLW_STRING,
bits, sizeof(bits)), v);
" ea %x\n", fp->f_pc, bits, v);
}
if (p == oldp && v == oldv && code == oldcode)
panic("Identical fault backtoback!");

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.37 2008/07/05 08:46:25 tsutsui Exp $ */
/* $NetBSD: fd.c,v 1.38 2008/12/16 22:35:22 christos Exp $ */
/* $OpenBSD: fd.c,v 1.6 1998/10/03 21:18:57 millert Exp $ */
/* NetBSD: fd.c,v 1.78 1995/07/04 07:23:09 mycroft Exp */
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.37 2008/07/05 08:46:25 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.38 2008/12/16 22:35:22 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -669,11 +669,41 @@ fdcstart(struct fdc_softc *fdc)
(void)fdcintr(fdc);
}
static void
fdcpstatus(int n, struct fdc_softc *fdc)
{
char bits[64];
switch (n) {
case 0:
printf("\n");
break;
case 2:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
break;
#ifdef DIAGNOSTIC
default:
printf("\nfdcstatus: weird size");
break;
#endif
}
}
void
fdcstatus(device_t dev, int n, const char *s)
{
struct fdc_softc *fdc = device_private(device_parent(dev));
char bits[64];
if (n == 0) {
out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
@ -682,32 +712,7 @@ fdcstatus(device_t dev, int n, const char *s)
}
printf("%s: %s", device_xname(dev), s);
switch (n) {
case 0:
printf("\n");
break;
case 2:
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 %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
default:
printf("\n%s: weird size", __func__);
break;
#endif
}
fdcpstatus(n, fdc);
}
void
@ -1011,7 +1016,6 @@ fdcretry(struct fdc_softc *fdc)
{
struct fd_softc *fd;
struct buf *bp;
char bits[64];
fd = TAILQ_FIRST(&fdc->sc_drives);
bp = BUFQ_PEEK(fd->sc_q);
@ -1038,15 +1042,7 @@ fdcretry(struct fdc_softc *fdc)
diskerr(bp, "fd", "hard error", LOG_PRINTF,
fd->sc_skip / FDC_BSIZE, (struct disklabel *)NULL);
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]);
fdcpstatus(7, fdc);
bp->b_error = EIO;
fdfinish(fd, bp);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdfd.c,v 1.62 2008/06/13 08:50:12 cegger Exp $ */
/* $NetBSD: hdfd.c,v 1.63 2008/12/16 22:35:22 christos Exp $ */
/*-
* Copyright (c) 1996 Leo Weppelman
@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.62 2008/06/13 08:50:12 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.63 2008/12/16 22:35:22 christos Exp $");
#include "opt_ddb.h"
@ -871,6 +871,21 @@ fdcstart(fdc)
(void) fdcintr(fdc);
}
static void
fdcpstatus(struct fdc_softc *fdc)
{
char bits[64];
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
}
void
fdcstatus(dv, n, s)
struct device *dv;
@ -893,19 +908,11 @@ fdcstatus(dv, n, s)
printf("\n");
break;
case 2:
printf(" (st0 %s cyl %d)\n",
bitmask_snprintf(fdc->sc_status[0], NE7_ST0BITS,
bits, sizeof(bits)), fdc->sc_status[1]);
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
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]);
fscpstatus(fsc);
break;
#ifdef DIAGNOSTIC
default:
@ -1288,23 +1295,7 @@ fdcretry(fdc)
diskerr(bp, "fd", "hard error", LOG_PRINTF,
fd->sc_skip / FDC_BSIZE,
(struct disklabel *)NULL);
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]);
fscpstatus(fsc);
}
bp->b_error = EIO;
fdfinish(fd, bp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.16 2008/06/13 09:41:44 cegger Exp $ */
/* $NetBSD: mem.c,v 1.17 2008/12/16 22:35:22 christos Exp $ */
/* $OpenBSD: mem.c,v 1.5 2001/05/05 20:56:36 art Exp $ */
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.16 2008/06/13 09:41:44 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.17 2008/12/16 22:35:22 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -205,8 +205,7 @@ memattach(struct device *parent, struct device *self, void *aux)
/* XXX other values seem to blow it up */
if (sc->sc_vp->vi_status.hw_rev == 0) {
bitmask_snprintf(VI_CTRL, VIPER_BITS, bits,
sizeof(bits));
snprintb(bits, sizeof(bits), VIPER_BITS, VI_CTRL);
printf (" viper rev %x, ctrl %s",
sc->sc_vp->vi_status.hw_rev,
bits);
@ -220,8 +219,7 @@ memattach(struct device *parent, struct device *self, void *aux)
sc->sc_vp->vi_control = VI_CTRL;
splx(s);
#ifdef DEBUG
bitmask_snprintf(VI_CTRL, VIPER_BITS, bits,
sizeof(bits));
snprintb(bits, sizeof(bits), VIPER_BITS, VI_CTRL);
printf (" >> %s", bits);
#endif
} else
@ -246,8 +244,7 @@ memattach(struct device *parent, struct device *self, void *aux)
HPPA_PA_SPEC_LETTER(hppa_cpu_info->hppa_cpu_info_pa_spec) == 'e') {
sc->sc_l2 = (struct l2_mioc *)ca->ca_hpa;
#ifdef DEBUG
bitmask_snprintf(sc->sc_l2->sltcv, SLTCV_BITS, bits,
sizeof(bits));
snprintb(bits, sizeof(bits), SLTCV_BITS, sc->sc_l2->sltcv);
printf(", sltcv %s", bits);
#endif
/* sc->sc_l2->sltcv |= SLTCV_UP4COUT; */

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.54 2008/11/30 18:21:34 martin Exp $ */
/* $NetBSD: machdep.c,v 1.55 2008/12/16 22:35:23 christos Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.54 2008/11/30 18:21:34 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.55 2008/12/16 22:35:23 christos Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@ -1442,8 +1442,8 @@ hppa_machine_check(int check_type)
int error;
#define PIM_WORD(name, word, bits) \
do { \
bitmask_snprintf(word, bits, bitmask_buffer, \
sizeof(bitmask_buffer)); \
snprintb(bitmask_buffer, sizeof(bitmask_buffer),\
bits, word); \
printf("%s %s", name, bitmask_buffer); \
} while (/* CONSTCOND */ 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: vrc4173bcu.c,v 1.19 2005/12/11 12:17:34 christos Exp $ */
/* $NetBSD: vrc4173bcu.c,v 1.20 2008/12/16 22:35:23 christos Exp $ */
/*-
* Copyright (c) 2001,2002 Enami Tsugutomo.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vrc4173bcu.c,v 1.19 2005/12/11 12:17:34 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: vrc4173bcu.c,v 1.20 2008/12/16 22:35:23 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -339,24 +339,21 @@ vrc4173bcu_attach(struct device *parent, struct device *self, void *aux)
#ifdef DEBUG
reg = bus_space_read_2(sc->sc_iot, sc->sc_icuh, VRC4173ICU_SYSINT1);
bitmask_snprintf(reg,
snprintb(buf, sizeof(buf),
"\20\1USB\2PCMCIA2\3PCMCIA1\4PS2CH2\5PS2CH1\6PIU\7AIU\10KIU"
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15",
buf, sizeof(buf));
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15", reg);
printf("%s: SYSINT1 = 0x%s\n", sc->sc_dev.dv_xname, buf);
reg = bus_space_read_2(sc->sc_iot, sc->sc_icuh, VRC4173ICU_MKIUINT);
bitmask_snprintf(reg,
snprintb(buf, sizeof(buf),
"\20\1SCANINT\2KDATRDY\3KDATLOST\4B3\5B4\6B5\7B6\10B7"
"\11B8\12B9\13B10\14B11\15B12\16B13\17B14\20B15",
buf, sizeof(buf));
"\11B8\12B9\13B10\14B11\15B12\16B13\17B14\20B15", reg);
printf("%s: MKIUINT = 0x%s\n", sc->sc_dev.dv_xname, buf);
reg = bus_space_read_2(sc->sc_iot, sc->sc_icuh, VRC4173ICU_MSYSINT1);
bitmask_snprintf(reg,
snprintb(buf, sizeof(buf),
"\20\1USB\2PCMCIA2\3PCMCIA1\4PS2CH2\5PS2CH1\6PIU\7AIU\10KIU"
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15",
buf, sizeof(buf));
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15", reg);
printf("%s: MSYSINT1 = 0x%s\n", sc->sc_dev.dv_xname, buf);
#if 1
@ -365,10 +362,9 @@ vrc4173bcu_attach(struct device *parent, struct device *self, void *aux)
bus_space_write_2(sc->sc_iot, sc->sc_icuh, VRC4173ICU_MSYSINT1, reg);
reg = bus_space_read_2(sc->sc_iot, sc->sc_icuh, VRC4173ICU_MSYSINT1);
bitmask_snprintf(reg,
snprintb(buf, sizeof(buf)
"\20\1USB\2PCMCIA2\3PCMCIA1\4PS2CH2\5PS2CH1\6PIU\7AIU\10KIU"
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15",
buf, sizeof(buf));
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15", reg);
printf("%s: MSYSINT1 = 0x%s\n", sc->sc_dev.dv_xname, buf);
#endif
#endif
@ -492,10 +488,9 @@ vrc4173bcu_intr(void *arg)
#if 0
{
char buf[80];
bitmask_snprintf(reg,
snprintb(buf, sizeof(buf),
"\20\1USB\2PCMCIA2\3PCMCIA1\4PS2CH2\5PS2CH1\6PIU\7AIU\10KIU"
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15",
buf, sizeof(buf));
"\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15", reg);
printf("%s: %s\n", sc->sc_dev.dv_xname, buf);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.45 2008/12/10 11:10:18 pooka Exp $ */
/* $NetBSD: pmap.c,v 1.46 2008/12/16 22:35:23 christos Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -164,7 +164,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.45 2008/12/10 11:10:18 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.46 2008/12/16 22:35:23 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1392,14 +1392,12 @@ pmap_enter(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, int flags)
/* We are just changing the protection. */
#ifdef PMAPDEBUG
if (pmapdebug & PDB_ENTER) {
char buffer1[64];
char buffer2[64];
bitmask_snprintf(pv->pv_tlbprot, TLB_BITS,
buffer1, sizeof(buffer1));
bitmask_snprintf(tlbprot, TLB_BITS,
buffer2, sizeof(buffer2));
printf("pmap_enter: changing %s->%s\n",
buffer1, buffer2);
char b1[64];
char b2[64];
snprintb(b1, sizeof(b1), TLB_BITS,
pv->pv_tlbprot);
snprintb(b2, sizeof(b2), TLB_BITS, tlbprot);
printf("pmap_enter: changing %s->%s\n", b1, b2);
}
#endif
pmap_pv_update(pv, TLB_AR_MASK|TLB_PID_MASK|TLB_WIRED,
@ -1509,8 +1507,9 @@ pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
#ifdef PMAPDEBUG
if (pmapdebug & PDB_PROTECT) {
char buffer[64];
bitmask_snprintf(pv->pv_tlbprot, TLB_BITS,
buffer, sizeof(buffer));
snprintb(buffer, sizeof(buffer), TLB_BITS,
pv->pv_tlbprot);
printf("pv={%p,%x:%x,%s,%x}->%p\n",
pv->pv_pmap, pv->pv_space, pv->pv_va,
buffer,
@ -1949,16 +1948,16 @@ pmap_hptdump(void)
if (hpt->hpt_valid || hpt->hpt_entry) {
char buf[128];
bitmask_snprintf(hpt->hpt_tlbprot, TLB_BITS, buf,
sizeof(buf));
snprintb(buf, sizeof(buf), TLB_BITS, hpt->hpt_tlbprot);
db_printf("hpt@%p: %x{%sv=%x:%x},%s,%x\n",
hpt, *(int *)hpt, (hpt->hpt_valid?"ok,":""),
hpt->hpt_space, hpt->hpt_vpn << 9,
buf, tlbptob(hpt->hpt_tlbpage));
for (pv = hpt->hpt_entry; pv; pv = pv->pv_hash) {
bitmask_snprintf(hpt->hpt_tlbprot, TLB_BITS, buf,
sizeof(buf));
snprintb(buf, sizeof(buf), TLB_BITS,
hpt->hpt_tlbprot);
db_printf(" pv={%p,%x:%x,%s,%x}->%p\n",
pv->pv_pmap, pv->pv_space, pv->pv_va,
buf, tlbptob(pv->pv_tlbpage), pv->pv_hash);

View File

@ -1,4 +1,4 @@
/* $NetBSD: apmbios.c,v 1.11 2008/04/28 20:23:24 martin Exp $ */
/* $NetBSD: apmbios.c,v 1.12 2008/12/16 22:35:23 christos Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: apmbios.c,v 1.11 2008/04/28 20:23:24 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: apmbios.c,v 1.12 2008/12/16 22:35:23 christos Exp $");
#include "opt_apm.h"
#include "opt_compat_mach.h" /* Needed to get the right segment def */
@ -407,7 +407,7 @@ apm_busprobe(void)
#endif
DPRINTF(APMDEBUG_PROBE, ("apm: bioscall return: %x %x %x %x %s %x %x\n",
regs.AX, regs.BX, regs.CX, regs.DX,
bitmask_snprintf(regs.EFLAGS, I386_FLAGBITS, bits, sizeof(bits)),
snprintb(bits, sizeof(bits), I386_FLAGBITS, regs.EFLAGS),
regs.ESI, regs.EDI));
if (regs.FLAGS & PSL_C) {
@ -452,12 +452,18 @@ apmbiosmatch(struct device *parent, struct cfdata *match,
return 0;
}
#ifdef APMDEBUG
#define DPRINTF_BIOSRETURN(regs, bits) \
DPRINTF(APMDEBUG_ATTACH, \
("bioscall return: %x %x %x %x %s %x %x", \
(regs).EAX, (regs).EBX, (regs).ECX, (regs).EDX, \
bitmask_snprintf((regs).EFLAGS, I386_FLAGBITS, \
(bits), sizeof(bits)), (regs).ESI, (regs).EDI))
do { \
snprintb(bits, sizeof(bits), I386_FLAGBITS, (regs).EFLAGS); \
DPRINTF(APMDEBUG_ATTACH, \
("bioscall return: %x %x %x %x %s %x %x", \
(regs).EAX, (regs).EBX, (regs).ECX, (regs).EDX, \
bits, (regs).ESI, (regs).EDI)); \
while (/*CONSTCOND*/0)
#else
#define DPRINTF_BIOSRETURN(regs, bits)
#endif
static void
apmbiosattach(struct device *parent, struct device *self,

View File

@ -1,4 +1,4 @@
/* $NetBSD: mca_machdep.c,v 1.36 2008/09/08 23:36:54 gmcgarry Exp $ */
/* $NetBSD: mca_machdep.c,v 1.37 2008/12/16 22:35:23 christos Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mca_machdep.c,v 1.36 2008/09/08 23:36:54 gmcgarry Exp $");
__KERNEL_RCSID(0, "$NetBSD: mca_machdep.c,v 1.37 2008/12/16 22:35:23 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -307,7 +307,7 @@ mca_busprobe(void)
paddr = (regs.ES << 4) + regs.BX;
scp = (struct bios_config *)ISA_HOLE_VADDR(paddr);
bitmask_snprintf((scp->feature2 << 8) | scp->feature1,
snprintb(buf, sizeof(buf),
"\20"
"\01MCA+ISA"
"\02MCA"
@ -324,8 +324,7 @@ mca_busprobe(void)
"\015MMF"
"\016GPDF"
"\017KBDF"
"\020DMA32\n",
buf, sizeof(buf));
"\020DMA32\n", (scp->feature2 << 8) | scp->feature1);
aprint_verbose("BIOS CFG: Model-SubM-Rev: %02x-%02x-%02x, 0x%s\n",
scp->model, scp->submodel, scp->bios_rev, buf);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbc_obio.c,v 1.23 2008/04/04 16:00:57 tsutsui Exp $ */
/* $NetBSD: sbc_obio.c,v 1.24 2008/12/16 22:35:23 christos Exp $ */
/*
* Copyright (C) 1996,1997 Scott Reynolds. All rights reserved.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbc_obio.c,v 1.23 2008/04/04 16:00:57 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbc_obio.c,v 1.24 2008/12/16 22:35:23 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -215,9 +215,10 @@ sbc_obio_attach(device_t parent, device_t self, void *aux)
if ((sc->sc_options & SBC_RESELECT) == 0)
ncr_sc->sc_no_disconnect = 0xff;
if (sc->sc_options)
aprint_normal(": options=%s", bitmask_snprintf(sc->sc_options,
SBC_OPTIONS_BITS, bits, sizeof(bits)));
if (sc->sc_options) {
snprintb(bits, sizeof(bits), SBC_OPTIONS_BITS, sc->sc_options);
aprint_normal(": options=%s", bits);
}
aprint_normal("\n");
if (sc->sc_options & (SBC_INTR|SBC_RESELECT)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: esp.c,v 1.25 2008/04/28 20:23:27 martin Exp $ */
/* $NetBSD: esp.c,v 1.26 2008/12/16 22:35:23 christos Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.25 2008/04/28 20:23:27 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.26 2008/12/16 22:35:23 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -403,8 +403,8 @@ espdmaintr(struct esp_softc *sc)
if (csr & D_ERR_PEND) {
DMACSR(sc) &= ~D_EN_DMA; /* Stop DMA */
DMACSR(sc) |= D_INVALIDATE;
printf("%s: error: csr=%s\n", device_xname(nsc->sc_dev),
bitmask_snprintf(csr, DMACSRBITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), DMACSRBITS, csr);
printf("%s: error: csr=%s\n", device_xname(nsc->sc_dev), bits);
return -1;
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesh.c,v 1.26 2007/10/17 19:55:19 garbled Exp $ */
/* $NetBSD: mesh.c,v 1.27 2008/12/16 22:35:24 christos Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesh.c,v 1.26 2007/10/17 19:55:19 garbled Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesh.c,v 1.27 2008/12/16 22:35:24 christos Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -346,8 +346,8 @@ mesh_intr(arg)
{
char buf1[64], buf2[64];
bitmask_snprintf(status0, MESH_STATUS0_BITMASK, buf1, sizeof buf1);
bitmask_snprintf(exception, MESH_EXC_BITMASK, buf2, sizeof buf2);
snprintb(buf1, sizeof buf1, MESH_STATUS0_BITMASK, status0);
snprintb(buf2, sizeof buf2, MESH_EXC_BITMASK, exception);
printf("mesh_intr status0 = 0x%s (%s), exc = 0x%s\n",
buf1, scsi_phase[status0 & 7], buf2);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: snapper.c,v 1.30 2008/09/26 03:38:25 macallan Exp $ */
/* $NetBSD: snapper.c,v 1.31 2008/12/16 22:35:24 christos Exp $ */
/* Id: snapper.c,v 1.11 2002/10/31 17:42:13 tsubai Exp */
/* Id: i2s.c,v 1.12 2005/01/15 14:32:35 tsubai Exp */
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: snapper.c,v 1.30 2008/09/26 03:38:25 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: snapper.c,v 1.31 2008/12/16 22:35:24 christos Exp $");
#include <sys/param.h>
#include <sys/audioio.h>
@ -2022,8 +2022,7 @@ snapper_init(struct snapper_softc *sc, int node)
#ifdef SNAPPER_DEBUG
char fcr[32];
bitmask_snprintf(obio_read_4(KEYLARGO_FCR1), FCR3C_BITMASK,
fcr, sizeof fcr);
snprintb(fcr, sizeof(fcr), FCR3C_BITMASK, obio_read_4(KEYLARGO_FCR1));
printf("FCR(0x3c) 0x%s\n", fcr);
#endif
headphone_detect_intr = -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahci.c,v 1.4 2008/05/27 21:24:15 dyoung Exp $ */
/* $NetBSD: ahci.c,v 1.5 2008/12/16 22:35:24 christos Exp $ */
/*-
* Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.4 2008/05/27 21:24:15 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.5 2008/12/16 22:35:24 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -349,11 +349,12 @@ ahci_intr(void *arg)
}
#ifdef AHCI_DEBUG
bitmask_snprintf(r,
(sl11read(sc, SL11_CTRL) & SL11_CTRL_SUSPEND)
? "\20\x8""D+\7RESUME\6INSERT\5SOF\4res\3""BABBLE\2USBB\1USBA"
: "\20\x8""D+\7RESET\6INSERT\5SOF\4res\3""BABBLE\2USBB\1USBA",
bitbuf, sizeof(bitbuf));
snprintb(bitbuf, sizeof(bitbuf),
((sl11read(sc, SL11_CTRL) & SL11_CTRL_SUSPEND)
? "\20\x8""D+\7RESUME\6INSERT\5SOF\4res\3""BABBLE\2USBB\1USBA"
: "\20\x8""D+\7RESET\6INSERT\5SOF\4res\3""BABBLE\2USBB\1USBA"),
r);
DPRINTF(D_XFER, ("I=%s ", bitbuf));
#endif /* AHCI_DEBUG */
#endif
@ -1632,9 +1633,8 @@ ahci_transaction(struct ahci_softc *sc, usbd_pipe_handle pipe,
DPRINTF(D_XFER, ("t=%d i=%x ", AHCI_TIMEOUT - timeout, isr));
#if AHCI_DEBUG
bitmask_snprintf(result,
"\20\x8STALL\7NAK\6OV\5SETUP\4DATA1\3TIMEOUT\2ERR\1ACK",
str, sizeof(str));
snprintb(str, sizeof(str),
"\20\x8STALL\7NAK\6OV\5SETUP\4DATA1\3TIMEOUT\2ERR\1ACK", result);
DPRINTF(D_XFER, ("STAT=%s ", str));
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_admsw.c,v 1.4 2008/02/07 01:21:52 dyoung Exp $ */
/* $NetBSD: if_admsw.c,v 1.5 2008/12/16 22:35:24 christos Exp $ */
/*-
* Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.4 2008/02/07 01:21:52 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.5 2008/12/16 22:35:24 christos Exp $");
#include "bpfilter.h"
@ -812,8 +812,8 @@ admsw_intr(void *arg)
pending = REG_READ(ADMSW_INT_ST);
if ((pending & ~(ADMSW_INTR_RHD|ADMSW_INTR_RLD|ADMSW_INTR_SHD|ADMSW_INTR_SLD|ADMSW_INTR_W1TE|ADMSW_INTR_W0TE)) != 0) {
printf("%s: pending=%s\n", __func__,
bitmask_snprintf(pending, ADMSW_INT_FMT, buf, sizeof(buf)));
snprintb(buf, sizeof(buf), ADMSW_INT_FMT, pending);
printf("%s: pending=%s\n", __func__, buf);
}
REG_WRITE(ADMSW_INT_ST, pending);

View File

@ -1,4 +1,4 @@
/* $NetBSD: spifi.c,v 1.16 2008/04/09 15:40:30 tsutsui Exp $ */
/* $NetBSD: spifi.c,v 1.17 2008/12/16 22:35:24 christos Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: spifi.c,v 1.16 2008/04/09 15:40:30 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: spifi.c,v 1.17 2008/12/16 22:35:24 christos Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -454,7 +454,7 @@ spifi_intr(void *v)
reg->intr = ~intr;
#ifdef SPIFI_DEBUG
bitmask_snprintf(intr, INTR_BITMASK, bitmask, sizeof bitmask);
snprintb(bitmask, sizeof bitmask, INTR_BITMASK, intr);
printf("spifi_intr intr = 0x%s (%s), ", bitmask,
scsi_phase_name[(reg->prstat >> 3) & 7]);
printf("state = 0x%x, icond = 0x%x\n", state, icond);

View File

@ -1,4 +1,4 @@
/* $NetBSD: esp.c,v 1.56 2008/04/28 20:23:30 martin Exp $ */
/* $NetBSD: esp.c,v 1.57 2008/12/16 22:35:24 christos Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.56 2008/04/28 20:23:30 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.57 2008/12/16 22:35:24 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -505,8 +505,9 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
if (esp_debug) {
char sbuf[256];
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)));
printf("esp_dma_isintr = 0x%s\n", sbuf);
}
#endif
@ -748,12 +749,12 @@ esp_dma_reset(struct ncr53c9x_softc *sc)
if (esp_debug) {
char sbuf[256];
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)));
printf(" *intrstat = 0x%s\n", sbuf);
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRMASK)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(*(volatile u_long *)IIOV(NEXT_P_INTRMASK)));
printf(" *intrmask = 0x%s\n", sbuf);
}
#endif
@ -1918,12 +1919,12 @@ esp_dmacb_shutdown(void *arg)
if (esp_debug) {
char sbuf[256];
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)));
printf(" *intrstat = 0x%s\n", sbuf);
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRMASK)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(*(volatile u_long *)IIOV(NEXT_P_INTRMASK)));
printf(" *intrmask = 0x%s\n", sbuf);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb8795.c,v 1.43 2008/11/07 00:20:02 dyoung Exp $ */
/* $NetBSD: mb8795.c,v 1.44 2008/12/16 22:35:24 christos Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
* All rights reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.43 2008/11/07 00:20:02 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.44 2008/12/16 22:35:24 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -359,20 +359,21 @@ mb8795_rint(struct mb8795_softc *sc)
if (mb8795_debug) {
char sbuf[256];
bitmask_snprintf(rxstat, MB8795_RXSTAT_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), MB8795_RXSTAT_BITS, rxstat);
printf("%s: rx interrupt, rxstat = %s\n",
sc->sc_dev.dv_xname, sbuf);
bitmask_snprintf(MB_READ_REG(sc, MB8795_RXSTAT),
MB8795_RXSTAT_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), MB8795_RXSTAT_BITS,
MB_READ_REG(sc, MB8795_RXSTAT));
printf("rxstat = 0x%s\n", sbuf);
bitmask_snprintf(MB_READ_REG(sc, MB8795_RXMASK),
MB8795_RXMASK_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), MB8795_RXMASK_BITS,
MB_READ_REG(sc, MB8795_RXMASK));
printf("rxmask = 0x%s\n", sbuf);
bitmask_snprintf(MB_READ_REG(sc, MB8795_RXMODE),
MB8795_RXMODE_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), MB8795_RXMODE_BITS,
MB_READ_REG(sc, MB8795_RXMODE));
printf("rxmode = 0x%s\n", sbuf);
}
#endif
@ -431,7 +432,7 @@ mb8795_tint(struct mb8795_softc *sc)
if (txstat & MB8795_TXSTAT_READY) {
char sbuf[256];
bitmask_snprintf(txstat, MB8795_TXSTAT_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), MB8795_TXSTAT_BITS, txstat);
panic("%s: unexpected tx interrupt %s",
sc->sc_dev.dv_xname, sbuf);

View File

@ -1,4 +1,4 @@
/* $NetBSD: nextdma.c,v 1.42 2006/05/14 21:55:39 elad Exp $ */
/* $NetBSD: nextdma.c,v 1.43 2008/12/16 22:35:24 christos Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
* All rights reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nextdma.c,v 1.42 2006/05/14 21:55:39 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: nextdma.c,v 1.43 2008/12/16 22:35:24 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -203,8 +203,8 @@ nextdma_init(struct nextdma_softc *nsc)
if (NEXTDMA_DEBUG) {
char sbuf[256];
bitmask_snprintf(NEXT_I_BIT(nsc->sc_chan->nd_intr), NEXT_INTR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(NEXT_I_BIT(nsc->sc_chan->nd_intr));
printf("DMA init ipl (%ld) intr(0x%s)\n",
NEXT_I_IPL(nsc->sc_chan->nd_intr), sbuf);
}
@ -487,8 +487,8 @@ nextdma_enet_intr(void *arg)
if (NEXTDMA_DEBUG) {
char sbuf[256];
bitmask_snprintf(NEXT_I_BIT(nsc->sc_chan->nd_intr), NEXT_INTR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(NEXT_I_BIT(nsc->sc_chan->nd_intr));
printf("DMA interrupt ipl (%ld) intr(0x%s)\n",
NEXT_I_IPL(nsc->sc_chan->nd_intr), sbuf);
}
@ -511,7 +511,7 @@ nextdma_enet_intr(void *arg)
if (/* (state & DMACSR_READ) || */ !(state & DMACSR_COMPLETE)) {
char sbuf[256];
nextdma_print(nsc);
bitmask_snprintf(state, DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, state);
printf("DMA: state 0x%s\n",sbuf);
panic("DMA complete not set in interrupt");
}
@ -572,7 +572,7 @@ nextdma_enet_intr(void *arg)
{
char sbuf[256];
printf("DMA: please send this output to port-next68k-maintainer@NetBSD.org:\n");
bitmask_snprintf(state, DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, state);
printf("DMA: state 0x%s\n",sbuf);
nextdma_print(nsc);
panic("DMA: condition 0x%02x not yet documented to occur",result);
@ -593,7 +593,7 @@ nextdma_enet_intr(void *arg)
(state & DMACSR_READ) ? "read" : "write"));
if ((slimit < onext) || (slimit > olimit)) {
char sbuf[256];
bitmask_snprintf(state, DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, state);
printf("DMA: state 0x%s\n",sbuf);
nextdma_print(nsc);
panic("DMA: Unexpected limit register (0x%08lx) in finish_xfer",slimit);
@ -604,7 +604,7 @@ nextdma_enet_intr(void *arg)
if ((state & DMACSR_ENABLE) && ((stat->nd_idx+1) != stat->nd_map->dm_nsegs)) {
if (slimit != olimit) {
char sbuf[256];
bitmask_snprintf(state, DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, state);
printf("DMA: state 0x%s\n",sbuf);
nextdma_print(nsc);
panic("DMA: short limit register (0x%08lx) w/o finishing map.",slimit);
@ -635,7 +635,7 @@ nextdma_enet_intr(void *arg)
#if (defined(ND_DEBUG))
if (NEXTDMA_DEBUG) {
char sbuf[256];
bitmask_snprintf(state, DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, state);
printf("CLNDMAP: dd->dd_csr = 0x%s\n", sbuf);
}
#endif
@ -682,8 +682,8 @@ nextdma_enet_intr(void *arg)
if (NEXTDMA_DEBUG) {
char sbuf[256];
bitmask_snprintf(NEXT_I_BIT(nsc->sc_chan->nd_intr), NEXT_INTR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
NEXT_INTR_BITS, NEXT_I_BIT(nsc->sc_chan->nd_intr));
printf("DMA exiting interrupt ipl (%ld) intr(0x%s)\n",
NEXT_I_IPL(nsc->sc_chan->nd_intr), sbuf);
}
@ -719,8 +719,8 @@ nextdma_start(struct nextdma_softc *nsc, u_long dmadir)
if (!nextdma_finished(nsc)) {
char sbuf[256];
bitmask_snprintf(NEXT_I_BIT(nsc->sc_chan->nd_intr), NEXT_INTR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
NEXT_INTR_BITS, NEXT_I_BIT(nsc->sc_chan->nd_intr));
panic("DMA trying to start before previous finished on intr(0x%s)", sbuf);
}
#endif
@ -729,8 +729,8 @@ nextdma_start(struct nextdma_softc *nsc, u_long dmadir)
if (NEXTDMA_DEBUG) {
char sbuf[256];
bitmask_snprintf(NEXT_I_BIT(nsc->sc_chan->nd_intr), NEXT_INTR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
NEXT_INTR_BITS, NEXT_I_BIT(nsc->sc_chan->nd_intr));
printf("DMA start (%ld) intr(0x%s)\n",
NEXT_I_IPL(nsc->sc_chan->nd_intr), sbuf);
}
@ -772,8 +772,8 @@ nextdma_start(struct nextdma_softc *nsc, u_long dmadir)
if (NEXTDMA_DEBUG) {
char sbuf[256];
bitmask_snprintf(NEXT_I_BIT(nsc->sc_chan->nd_intr), NEXT_INTR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
NEXT_INTR_BITS, NEXT_I_BIT(nsc->sc_chan->nd_intr));
printf("DMA initiating DMA %s of %d segments on intr(0x%s)\n",
(dmadir == DMACSR_SETREAD ? "read" : "write"), stat->nd_map->dm_nsegs, sbuf);
}
@ -828,12 +828,12 @@ nextdma_print(struct nextdma_softc *nsc)
dd_saved_start = nd_bsr4 (DD_SAVED_START);
dd_saved_stop = nd_bsr4 (DD_SAVED_STOP);
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
*(volatile u_long *)IIOV(NEXT_P_INTRSTAT));
printf("NDMAP: *intrstat = 0x%s\n", sbuf);
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRMASK)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
*(volatile u_long *)IIOV(NEXT_P_INTRMASK));
printf("NDMAP: *intrmask = 0x%s\n", sbuf);
/* NDMAP is Next DMA Print (really!) */
@ -887,7 +887,7 @@ nextdma_print(struct nextdma_softc *nsc)
printf("NDMAP: nd_map_cont = NULL\n");
}
bitmask_snprintf(dd_csr, DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, dd_csr);
printf("NDMAP: dd->dd_csr = 0x%s\n", sbuf);
printf("NDMAP: dd->dd_saved_next = 0x%08lx\n", dd_saved_next);
@ -900,8 +900,8 @@ nextdma_print(struct nextdma_softc *nsc)
printf("NDMAP: dd->dd_start = 0x%08lx\n", dd_start);
printf("NDMAP: dd->dd_stop = 0x%08lx\n", dd_stop);
bitmask_snprintf(NEXT_I_BIT(nsc->sc_chan->nd_intr), NEXT_INTR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(NEXT_I_BIT(nsc->sc_chan->nd_intr));
printf("NDMAP: interrupt ipl (%ld) intr(0x%s)\n",
NEXT_I_IPL(nsc->sc_chan->nd_intr), sbuf);
}
@ -945,7 +945,7 @@ nextdma_debug_enetr_dumpstate(void)
do {
char sbuf[256];
if (nextdma_debug_enetr_state[i]) {
bitmask_snprintf(nextdma_debug_enetr_state[i], DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, nextdma_debug_enetr_state[i]);
printf("DMA: 0x%02x state 0x%s\n",i,sbuf);
}
i++;
@ -964,7 +964,7 @@ nextdma_debug_scsi_dumpstate(void)
do {
char sbuf[256];
if (nextdma_debug_scsi_state[i]) {
bitmask_snprintf(nextdma_debug_scsi_state[i], DMACSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMACSR_BITS, nextdma_debug_scsi_state[i]);
printf("DMA: 0x%02x state 0x%s\n",i,sbuf);
}
i++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: isr.c,v 1.26 2008/06/26 02:52:03 isaki Exp $ */
/* $NetBSD: isr.c,v 1.27 2008/12/16 22:35:25 christos Exp $ */
/*
* This file was taken from mvme68k/mvme68k/isr.c
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.26 2008/06/26 02:52:03 isaki Exp $");
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.27 2008/12/16 22:35:25 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -329,12 +329,12 @@ isrdispatch_autovec(struct clockframe *frame)
printf("isrdispatch_autovec: stray level %d interrupt\n", ipl);
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(*(volatile u_long *)IIOV(NEXT_P_INTRSTAT)));
printf(" *intrstat = 0x%s\n", sbuf);
bitmask_snprintf((*(volatile u_long *)IIOV(NEXT_P_INTRMASK)),
NEXT_INTR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), NEXT_INTR_BITS,
(*(volatile u_long *)IIOV(NEXT_P_INTRMASK)));
printf(" *intrmask = 0x%s\n", sbuf);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu_subr.c,v 1.50 2008/10/14 22:54:22 macallan Exp $ */
/* $NetBSD: cpu_subr.c,v 1.51 2008/12/16 22:35:25 christos Exp $ */
/*-
* Copyright (c) 2001 Matt Thomas.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.50 2008/10/14 22:54:22 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.51 2008/12/16 22:35:25 christos Exp $");
#include "opt_ppcparam.h"
#include "opt_multiprocessor.h"
@ -569,7 +569,7 @@ cpu_setup(self, ci)
bitmask = HID0_BITMASK;
break;
}
bitmask_snprintf(hid0, bitmask, hidbuf, sizeof hidbuf);
snprintb(hidbuf, sizeof hidbuf, bitmask, hid0);
aprint_normal("%s: HID0 %s, powersave: %d\n", self->dv_xname, hidbuf,
powersave);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pi1ppc.c,v 1.6 2008/04/22 14:02:04 cegger Exp $ */
/* $NetBSD: pi1ppc.c,v 1.7 2008/12/16 22:35:25 christos Exp $ */
/*
* Copyright (c) 2001 Alcove - Nicolas Souchu
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pi1ppc.c,v 1.6 2008/04/22 14:02:04 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: pi1ppc.c,v 1.7 2008/12/16 22:35:25 christos Exp $");
#include "opt_pi1ppc.h"
@ -216,8 +216,8 @@ pi1ppc_sc_attach(struct pi1ppc_softc *lsc)
lsc->sc_has = PI1PPC_HAS_PS2;
/* Print out chipset capabilities */
bitmask_snprintf(lsc->sc_has, "\20\1INTR\2DMA\3FIFO\4PS2\5ECP\6EPP",
buf, sizeof(buf));
snprintb(buf, sizeof(buf), "\20\1INTR\2DMA\3FIFO\4PS2\5ECP\6EPP",
lsc->sc_has);
printf("\n%s: capabilities=%s\n", device_xname(lsc->sc_dev), buf);
/* Initialize device's buffer pointers */

View File

@ -1,4 +1,4 @@
/* $NetBSD: adc.c,v 1.9 2008/03/27 03:16:29 uwe Exp $ */
/* $NetBSD: adc.c,v 1.10 2008/12/16 22:35:25 christos Exp $ */
/*
* Copyright (c) 2003 Valeriy E. Ushakov
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: adc.c,v 1.9 2008/03/27 03:16:29 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: adc.c,v 1.10 2008/12/16 22:35:25 christos Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -131,14 +131,12 @@ adc_sample_channel(int chan)
csr = ADC_(CSR);
if ((csr & SH7709_ADCSR_ADST) != 0) {
/* another conversion is in progress?! */
printf("adc_sample_channel(%d): CSR=%s", chan,
bitmask_snprintf(csr, SH7709_ADCSR_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(buts), SH7709_ADCSR_BITS, csr);
printf("adc_sample_channel(%d): CSR=%s", chan, bits);
cr = ADC_(CR);
cr &= ~0x07; /* three lower bits always read as 1s */
printf(", CR=%s\n",
bitmask_snprintf(cr, SH7709_ADCR_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(buts), SH7709_ADCR_BITS, cr);
printf(", CR=%s\n", bits);
return (-1);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtc.c,v 1.5 2008/04/28 20:23:34 martin Exp $ */
/* $NetBSD: rtc.c,v 1.6 2008/12/16 22:35:25 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.5 2008/04/28 20:23:34 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.6 2008/12/16 22:35:25 christos Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -96,8 +96,8 @@ rtc_attach(device_t parent, device_t self, void *aux)
r = _reg_read_1(SH_(RCR2));
#ifdef RTC_DEBUG
aprint_debug_dev(sc->sc_dev, "RCR2=%s\n",
bitmask_snprintf(r, SH_RCR2_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), SH_RCR2_BITS, r);
aprint_debug_dev(sc->sc_dev, "RCR2=%s\n", bits);
#endif
/* Was the clock running? */

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.141 2008/06/11 21:25:31 drochner Exp $ */
/* $NetBSD: fd.c,v 1.142 2008/12/16 22:35:25 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.141 2008/06/11 21:25:31 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.142 2008/12/16 22:35:25 christos Exp $");
#include "opt_ddb.h"
#include "opt_md.h"
@ -1173,12 +1173,42 @@ fdcstart(struct fdc_softc *fdc)
(void) fdcstate(fdc);
}
static void
fdcpstatus(int n, struct fdc_softc *fdc)
{
char bits[64];
switch (n) {
case 0:
printf("\n");
break;
case 2:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
break;
#ifdef DIAGNOSTIC
default:
printf("\nfdcstatus: weird size");
break;
#endif
}
}
void
fdcstatus(struct fdc_softc *fdc, const char *s)
{
struct fd_softc *fd = fdc->sc_drives.tqh_first;
int n;
char bits[64];
/* Just print last status */
n = fdc->sc_nstat;
@ -1198,31 +1228,7 @@ fdcstatus(struct fdc_softc *fdc, const char *s)
printf("%s: %s: state %d",
fd ? fd->sc_dv.dv_xname : "fdc", s, fdc->sc_state);
switch (n) {
case 0:
printf("\n");
break;
case 2:
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 %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
default:
printf(" fdcstatus: weird size: %d\n", n);
break;
#endif
}
fdcpstatus(n, fdc);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbus.c,v 1.70 2008/06/13 13:10:18 cegger Exp $ */
/* $NetBSD: sbus.c,v 1.71 2008/12/16 22:35:25 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.70 2008/06/13 13:10:18 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.71 2008/12/16 22:35:25 christos Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@ -660,8 +660,8 @@ static int straytime, nstray;
afsr = bus_space_read_4(sc->sc_bustag, bh, SBUS_AFSR_REG);
afva = bus_space_read_4(sc->sc_bustag, bh, SBUS_AFAR_REG);
printf("sbus error:\n\tAFSR %s\n",
bitmask_snprintf(afsr, SBUS_AFSR_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), SBUS_AFSR_BITS, afsr);
printf("sbus error:\n\tAFSR %s\n", bits);
printf("\taddress: 0x%x%x\n", afsr & SBUS_AFSR_PAH, afva);
/* For now, do the same dance as on stray interrupts */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sw.c,v 1.21 2008/04/28 20:23:35 martin Exp $ */
/* $NetBSD: sw.c,v 1.22 2008/12/16 22:35:25 christos Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sw.c,v 1.21 2008/04/28 20:23:35 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: sw.c,v 1.22 2008/12/16 22:35:25 christos Exp $");
#include "opt_ddb.h"
@ -357,9 +357,9 @@ sw_attach(device_t parent, device_t self, void *aux)
}
if (sc->sc_options) {
aprint_normal_dev(self, "options=%s\n",
bitmask_snprintf(sc->sc_options, SW_OPTIONS_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(bits),
SW_OPTIONS_BITS, sc->sc_options);
aprint_normal_dev(self, "options=%s\n", bits);
}
ncr_sc->sc_channel.chan_id = 7;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme_machdep.c,v 1.57 2008/04/28 20:23:35 martin Exp $ */
/* $NetBSD: vme_machdep.c,v 1.58 2008/12/16 22:35:26 christos Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.57 2008/04/28 20:23:35 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.58 2008/12/16 22:35:26 christos Exp $");
#include <sys/param.h>
#include <sys/extent.h>
@ -448,8 +448,8 @@ sparc_vme_error(void)
afsr = sc->sc_reg->vmebus_afsr;
afpa = sc->sc_reg->vmebus_afar;
printf("VME error:\n\tAFSR %s\n",
bitmask_snprintf(afsr, VMEBUS_AFSR_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), VMEBUS_AFSR_BITS, afsr);
printf("VME error:\n\tAFSR %s\n", bits);
printf("\taddress: 0x%x%x\n", afsr, afpa);
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_interface.c,v 1.79 2008/08/08 17:09:28 skrll Exp $ */
/* $NetBSD: db_interface.c,v 1.80 2008/12/16 22:35:26 christos Exp $ */
/*
* Mach Operating System
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.79 2008/08/08 17:09:28 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.80 2008/12/16 22:35:26 christos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -396,10 +396,10 @@ db_dump_pcb(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
else
pcb = curcpu()->curpcb;
snprintb(bits, sizeof(bits), PSR_BITS, pcb->pcb_psr);
db_printf("pcb@%p sp:%p pc:%p psr:%s onfault:%p\nfull windows:\n",
pcb, (void *)(long)pcb->pcb_sp, (void *)(long)pcb->pcb_pc,
bitmask_snprintf(pcb->pcb_psr, PSR_BITS, bits, sizeof(bits)),
(void *)pcb->pcb_onfault);
bits, (void *)pcb->pcb_onfault);
for (i=0; i<pcb->pcb_nsaved; i++) {
db_printf("win %d: at %llx local, in\n", i,

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.100 2008/01/09 13:52:33 ad Exp $ */
/* $NetBSD: intr.c,v 1.101 2008/12/16 22:35:26 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.100 2008/01/09 13:52:33 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.101 2008/12/16 22:35:26 christos Exp $");
#include "opt_multiprocessor.h"
#include "opt_sparc_arch.h"
@ -98,9 +98,9 @@ strayintr(struct clockframe *fp)
char bits[64];
int timesince;
snprintb(bits, sizeof(bits), PSR_BITS, fp->psr);
printf("stray interrupt ipl 0x%x pc=0x%x npc=0x%x psr=%s\n",
fp->ipl, fp->pc, fp->npc, bitmask_snprintf(fp->psr,
PSR_BITS, bits, sizeof(bits)));
fp->ipl, fp->pc, fp->npc, bits);
timesince = time_uptime - straytime;
if (timesince <= 10) {
@ -123,10 +123,9 @@ bogusintr(struct clockframe *fp)
{
char bits[64];
snprintb(bits, sizeof(bits), PSR_BITS, fp->psr);
printf("cpu%d: bogus interrupt ipl 0x%x pc=0x%x npc=0x%x psr=%s\n",
cpu_number(),
fp->ipl, fp->pc, fp->npc, bitmask_snprintf(fp->psr,
PSR_BITS, bits, sizeof(bits)));
cpu_number(), fp->ipl, fp->pc, fp->npc, bits);
}
#endif /* DIAGNOSTIC */
@ -198,9 +197,9 @@ nmi_hard(void)
afsr = afva = 0;
if ((*cpuinfo.get_asyncflt)(&afsr, &afva) == 0) {
snprintb(bits, sizeof(bits), AFSR_BITS, afsr);
printf("Async registers (mid %d): afsr=%s; afva=0x%x%x\n",
cpuinfo.mid,
bitmask_snprintf(afsr, AFSR_BITS, bits, sizeof(bits)),
cpuinfo.mid, bits,
(afsr & AFSR_AFA) >> AFSR_AFA_RSHIFT, afva);
}
@ -235,8 +234,9 @@ nmi_hard(void)
* Examine pending system interrupts.
*/
si = *((uint32_t *)ICR_SI_PEND);
printf("cpu%d: NMI: system interrupts: %s\n", cpu_number(),
bitmask_snprintf(si, SINTR_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), SINTR_BITS, si);
printf("cpu%d: NMI: system interrupts: %s\n", cpu_number(), bits);
if ((si & SINTR_M) != 0) {
/* ECC memory error */
@ -374,8 +374,9 @@ nmi_hard_msiiep(void)
int fatal = 0;
si = mspcic_read_4(pcic_sys_ipr);
printf("NMI: system interrupts: %s\n",
bitmask_snprintf(si, MSIIEP_SYS_IPR_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), MSIIEP_SYS_IPR_BITS, si);
printf("NMI: system interrupts: %s\n", bits);
if (si & MSIIEP_SYS_IPR_MEM_FAULT) {
uint32_t afsr, afar, mfsr, mfar;
@ -386,17 +387,15 @@ nmi_hard_msiiep(void)
mfar = *(volatile uint32_t *)MSIIEP_MFAR;
mfsr = *(volatile uint32_t *)MSIIEP_MFSR;
if (afsr & MSIIEP_AFSR_ERR)
printf("async fault: afsr=%s; afar=%08x\n",
bitmask_snprintf(afsr, MSIIEP_AFSR_BITS,
bits, sizeof(bits)),
afar);
if (afsr & MSIIEP_AFSR_ERR) {
snprintb(bits, sizeof(bits), MSIIEP_AFSR_BITS, afsr);
printf("async fault: afsr=%s; afar=%08x\n", bits, afsr);
}
if (mfsr & MSIIEP_MFSR_ERR)
printf("mem fault: mfsr=%s; mfar=%08x\n",
bitmask_snprintf(mfsr, MSIIEP_MFSR_BITS,
bits, sizeof(bits)),
mfar);
if (mfsr & MSIIEP_MFSR_ERR) {
snprintb(bits, sizeof(bits), MSIIEP_MFSR_BITS, mfsr);
printf("mem fault: mfsr=%s; mfar=%08x\n", bits, mfsr);
}
fatal = 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: memecc.c,v 1.10 2008/04/28 20:23:36 martin Exp $ */
/* $NetBSD: memecc.c,v 1.11 2008/12/16 22:35:26 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: memecc.c,v 1.10 2008/04/28 20:23:36 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: memecc.c,v 1.11 2008/12/16 22:35:26 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -124,10 +124,10 @@ memecc_error(void)
efsr = bus_space_read_4(memecc_sc->sc_bt, bh, ECC_FSR_REG);
efar0 = bus_space_read_4(memecc_sc->sc_bt, bh, ECC_AFR0_REG);
efar1 = bus_space_read_4(memecc_sc->sc_bt, bh, ECC_AFR1_REG);
printf("memory error:\n\tEFSR: %s\n",
bitmask_snprintf(efsr, ECC_FSR_BITS, bits, sizeof(bits)));
printf("\tMBus transaction: %s\n",
bitmask_snprintf(efar0, ECC_AFR_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), ECC_FSR_BITS, efsr);
printf("memory error:\n\tEFSR: %s\n", bits);
snprintb(bits, sizeof(bits), ECC_AFR_BITS, efar0);
printf("\tMBus transaction: %s\n", bits);
printf("\taddress: 0x%x%x\n", efar0 & ECC_AFR_PAH, efar1);
printf("\tmodule location: %s\n",
prom_pa_location(efar1, efar0 & ECC_AFR_PAH));

View File

@ -1,4 +1,4 @@
/* $NetBSD: memreg.c,v 1.41 2008/05/21 14:10:28 ad Exp $ */
/* $NetBSD: memreg.c,v 1.42 2008/12/16 22:35:26 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: memreg.c,v 1.41 2008/05/21 14:10:28 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: memreg.c,v 1.42 2008/12/16 22:35:26 christos Exp $");
#include "opt_sparc_arch.h"
@ -180,12 +180,11 @@ memerr4_4c(unsigned int issync,
char bits[64];
u_int pte;
snprintb(bits, sizeof(bits), SER_BITS, ser);
printf("%ssync mem arr: ser=%s sva=0x%x ",
issync ? "" : "a",
bitmask_snprintf(ser, SER_BITS, bits, sizeof(bits)),
sva);
printf("aer=%s ava=0x%x\n", bitmask_snprintf(aer & 0xff,
AER_BITS, bits, sizeof(bits)), ava);
issync ? "" : "a", bits, sva);
snprintb(bits, sizeof(bits), AER_BITS, aer & 0xff);
printf("aer=%s ava=0x%x\n", bits, ava);
pte = getpte4(sva);
if ((pte & PG_V) != 0 && (pte & PG_TYPE) == PG_OBMEM) {
@ -201,10 +200,10 @@ memerr4_4c(unsigned int issync,
prom_pa_location(pa, 0));
}
if (par_err_reg)
printf("parity error register = %s\n",
bitmask_snprintf(*par_err_reg, PER_BITS,
bits, sizeof(bits)));
if (par_err_reg) {
snprintb(bits, sizeof(bits), PER_BITS, *par_err_reg);
printf("parity error register = %s\n", bits);
}
panic("memory error"); /* XXX */
}
@ -219,11 +218,11 @@ hardmemerr4m(unsigned type, u_int sfsr, u_int sfva, u_int afsr, u_int afva)
char *s, bits[64];
printf("memory fault: type %d", type);
s = bitmask_snprintf(sfsr, SFSR_BITS, bits, sizeof(bits));
s = snprintb(bits, sizeof(bits), SFSR_BITS, sfsr);
printf("sfsr=%s sfva=0x%x\n", s, sfva);
if (afsr != 0) {
s = bitmask_snprintf(afsr, AFSR_BITS, bits, sizeof(bits));
s = snprintb(bits, sizeof(bits), AFSR_BITS, afsr);
printf("; afsr=%s afva=0x%x%x\n", s,
(afsr & AFSR_AFA) >> AFSR_AFA_RSHIFT, afva);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.176 2008/10/15 06:51:18 wrstuden Exp $ */
/* $NetBSD: trap.c,v 1.177 2008/12/16 22:35:26 christos Exp $ */
/*
* Copyright (c) 1996
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.176 2008/10/15 06:51:18 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.177 2008/12/16 22:35:26 christos Exp $");
#include "opt_ddb.h"
#include "opt_compat_svr4.h"
@ -293,9 +293,9 @@ trap(unsigned type, int psr, int pc, struct trapframe *tf)
return;
}
dopanic:
snprintb(bits, sizeof(bits), PSR_BITS, psr);
printf("trap type 0x%x: pc=0x%x npc=0x%x psr=%s\n",
type, pc, tf->tf_npc, bitmask_snprintf(psr,
PSR_BITS, bits, sizeof(bits)));
type, pc, tf->tf_npc,
#ifdef DDB
write_all_windows();
(void) kdb_trap(type, tf);
@ -332,9 +332,9 @@ trap(unsigned type, int psr, int pc, struct trapframe *tf)
if (type < 0x80) {
if (!ignore_bogus_traps)
goto dopanic;
snprintb(bits, sizeof(bits), PSR_BITS, psr);
printf("trap type 0x%x: pc=0x%x npc=0x%x psr=%s\n",
type, pc, tf->tf_npc, bitmask_snprintf(psr,
PSR_BITS, bits, sizeof(bits)));
type, pc, tf->tf_npc,
sig = SIGILL;
KSI_INIT_TRAP(&ksi);
ksi.ksi_trap = type;
@ -838,8 +838,8 @@ mem_access_fault(unsigned type, int ser, u_int v, int pc, int psr,
extern char Lfsbail[];
if (type == T_TEXTFAULT) {
(void) splhigh();
printf("text fault: pc=0x%x ser=%s\n", pc,
bitmask_snprintf(ser, SER_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits)), SER_BITS, ser);
printf("text fault: pc=0x%x ser=%s\n", pc, bits);
panic("kernel fault");
/* NOTREACHED */
}
@ -938,9 +938,9 @@ kfault:
(int)l->l_addr->u_pcb.pcb_onfault : 0;
if (!onfault) {
(void) splhigh();
snprintb(bits, sizeof(bits), SER_BITS, ser);
printf("data fault: pc=0x%x addr=0x%x ser=%s\n",
pc, v, bitmask_snprintf(ser, SER_BITS,
bits, sizeof(bits)));
pc, v, bits);
panic("kernel fault");
/* NOTREACHED */
}
@ -1155,9 +1155,9 @@ mem_access_fault4m(unsigned type, u_int sfsr, u_int sfva, struct trapframe *tf)
extern char Lfsbail[];
if (sfsr & SFSR_AT_TEXT || type == T_TEXTFAULT) {
(void) splhigh();
snprintb(bits, sizeof(bits), SFSR_BITS, sfsr);
printf("text fault: pc=0x%x sfsr=%s sfva=0x%x\n", pc,
bitmask_snprintf(sfsr, SFSR_BITS, bits,
sizeof(bits)), sfva);
bits, sfva);
panic("kernel fault");
/* NOTREACHED */
}
@ -1223,9 +1223,9 @@ kfault:
(int)l->l_addr->u_pcb.pcb_onfault : 0;
if (!onfault) {
(void) splhigh();
snprintb(bits, sizeof(bits), SFSR_BITS, sfsr);
printf("data fault: pc=0x%x addr=0x%x sfsr=%s\n",
pc, sfva, bitmask_snprintf(sfsr, SFSR_BITS,
bits, sizeof(bits)));
pc, sfva, bits);
panic("kernel fault");
/* NOTREACHED */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdc.c,v 1.25 2008/06/20 20:23:01 jnemeth Exp $ */
/* $NetBSD: fdc.c,v 1.26 2008/12/16 22:35:26 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.25 2008/06/20 20:23:01 jnemeth Exp $");
__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.26 2008/12/16 22:35:26 christos Exp $");
#include "opt_ddb.h"
#include "opt_md.h"
@ -1358,6 +1358,21 @@ fdcstart(struct fdc_softc *fdc)
(void)fdcstate(fdc);
}
static void
fdcpstatus(struct fdc_softc *fdc)
{
char bits[64];
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
}
void
fdcstatus(struct fdc_softc *fdc, const char *s)
{
@ -1388,19 +1403,11 @@ fdcstatus(struct fdc_softc *fdc, const char *s)
printf("\n");
break;
case 2:
printf(" (st0 %s cyl %d)\n",
bitmask_snprintf(fdc->sc_status[0], NE7_ST0BITS,
bits, sizeof(bits)), fdc->sc_status[1]);
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
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]);
fscpstatus(fsc);
break;
#ifdef DIAGNOSTIC
default:

View File

@ -1,4 +1,4 @@
/* $NetBSD: psycho.c,v 1.94 2008/12/10 03:31:51 mrg Exp $ */
/* $NetBSD: psycho.c,v 1.95 2008/12/16 22:35:26 christos Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.94 2008/12/10 03:31:51 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.95 2008/12/16 22:35:26 christos Exp $");
#include "opt_ddb.h"
@ -877,11 +877,10 @@ psycho_ue(void *arg)
/*
* It's uncorrectable. Dump the regs and panic.
*/
snprintb(bits, sizeof(bits), PSYCHO_UE_AFSR_BITS, afsr);
printf("%s: uncorrectable DMA error AFAR %llx pa %llx AFSR %llx:\n%s\n",
device_xname(&sc->sc_dev), afar,
(long long)iommu_extract(is, (vaddr_t)afar), afsr,
bitmask_snprintf(afsr, PSYCHO_UE_AFSR_BITS,
bits, sizeof(bits)));
(long long)iommu_extract(is, (vaddr_t)afar), afsr, bits);
/* Sometimes the AFAR points to an IOTSB entry */
if (afar >= is->is_ptsb && afar < is->is_ptsb + size) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: schizo.c,v 1.7 2008/12/15 06:30:59 mrg Exp $ */
/* $NetBSD: schizo.c,v 1.8 2008/12/16 22:35:26 christos Exp $ */
/* $OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $ */
/*
@ -316,14 +316,14 @@ schizo_pci_error(void *vpbm)
printf("%s: pci bus %c error\n", sc->sc_dv.dv_xname,
sp->sp_bus_a ? 'A' : 'B');
printf("PCIAFSR=%s\n", bitmask_snprintf(afsr, SCZ_PCIAFSR_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(bits), SCZ_PCIAFSR_BITS, afsr);
printf("PCIAFSR=%s\n", bits);
printf("PCIAFAR=%lx\n", afar);
printf("PCICTRL=%s\n", bitmask_snprintf(ctrl, SCZ_PCICTRL_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(bits), SCZ_PCICTRL_BITS, ctrl);
printf("PCICTRL=%s\n", bits);
#ifdef PCI_COMMAND_STATUS_BITS
printf("PCICSR=%s\n", bitmask_snprintf(csr, PCI_COMMAND_STATUS_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(bits), PCI_COMMAND_STATUS_BITS, csr);
printf("PCICSR=%s\n", bits);
#endif
if (ctrl & SCZ_PCICTRL_MMU_ERR) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.60 2008/05/18 22:40:14 martin Exp $ */
/* $NetBSD: intr.c,v 1.61 2008/12/16 22:35:27 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.60 2008/05/18 22:40:14 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.61 2008/12/16 22:35:27 christos Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -95,11 +95,11 @@ strayintr(const struct trapframe64 *fp, int vectored)
/* If we're in polled mode ignore spurious interrupts */
if ((fp->tf_pil == PIL_SER) /* && swallow_zsintrs */) return;
snprintb(buf, sizeof(buf), PSTATE_BITS,
(fp->tf_tstate>>TSTATE_PSTATE_SHIFT));
printf("stray interrupt ipl %u pc=%llx npc=%llx pstate=%s vecttored=%d\n",
fp->tf_pil, (unsigned long long)fp->tf_pc,
(unsigned long long)fp->tf_npc,
bitmask_snprintf((fp->tf_tstate>>TSTATE_PSTATE_SHIFT),
PSTATE_BITS, buf, sizeof(buf)), vectored);
(unsigned long long)fp->tf_npc, buf, vectored);
timesince = time_second - straytime;
if (timesince <= 10) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.155 2008/10/15 06:51:19 wrstuden Exp $ */
/* $NetBSD: trap.c,v 1.156 2008/12/16 22:35:27 christos Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.155 2008/10/15 06:51:19 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.156 2008/12/16 22:35:27 christos Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -459,7 +459,7 @@ trap(struct trapframe64 *tf, unsigned int type, vaddr_t pc, long tstate)
printf("trap: type 0x%x: pc=%lx &tf=%p\n",
type, pc, tf);
bitmask_snprintf(pstate, PSTATE_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), PSTATE_BITS, pstate);
printf(" npc=%lx pstate=%s %s\n",
(long)tf->tf_npc, sbuf,
type < N_TRAP_TYPES ? trap_type[type] :
@ -474,7 +474,7 @@ trap(struct trapframe64 *tf, unsigned int type, vaddr_t pc, long tstate)
trap_trace_dis = 1;
printf("trap: type 0x%x: lvl=%d pc=%lx &tf=%p",
type, (int)tl(), pc, tf);
bitmask_snprintf(pstate, PSTATE_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), PSTATE_BITS, pstate);
printf(" npc=%lx pstate=%s %s\n",
(long)tf->tf_npc, sbuf,
type < N_TRAP_TYPES ? trap_type[type] :
@ -570,14 +570,13 @@ dopanic:
trap_trace_dis = 1;
{
char sbuf[sizeof(PSTATE_BITS) + 64];
char sb[sizeof(PSTATE_BITS) + 64];
printf("trap type 0x%x: cpu %d, pc=%lx",
type, cpu_number(), pc);
bitmask_snprintf(pstate, PSTATE_BITS, sbuf,
sizeof(sbuf));
snprintb(sb, sizeof(sb), PSTATE_BITS, pstate);
printf(" npc=%lx pstate=%s\n",
(long)tf->tf_npc, sbuf);
(long)tf->tf_npc, sb);
DEBUGGER(type, tf);
panic(type < N_TRAP_TYPES ? trap_type[type] : T);
}
@ -1295,7 +1294,7 @@ data_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t afva,
trapdebug & (TDB_ADDFLT | TDB_FOLLOW)) {
char buf[768];
bitmask_snprintf(sfsr, SFSR_BITS, buf, sizeof buf);
snprintb(buf, sizeof buf, SFSR_BITS, sfsr);
printf("%d data_access_error(%lx, %lx, %lx, %p)=%lx @ %p %s\n",
curproc?curproc->p_pid:-1,
(long)type, (long)sfva, (long)afva, tf,
@ -1307,7 +1306,7 @@ data_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t afva,
}
if ((trapdebug & TDB_TL) && tl()) {
char buf[768];
bitmask_snprintf(sfsr, SFSR_BITS, buf, sizeof buf);
snprintb(buf, sizeof buf, SFSR_BITS, sfsr);
printf("%d tl %ld data_access_error(%lx, %lx, %lx, %p)="
"%lx @ %lx %s\n",
@ -1362,7 +1361,7 @@ data_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t afva,
char buf[768];
trap_trace_dis = 1; /* Disable traptrace for printf */
bitmask_snprintf(sfsr, SFSR_BITS, buf, sizeof buf);
snprintb(buf, sizeof buf, SFSR_BITS, sfsr);
(void) splhigh();
printf("data fault: pc=%lx addr=%lx sfsr=%s\n",
(u_long)pc, (long)sfva, buf);
@ -1378,7 +1377,7 @@ data_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t afva,
if (afsr & ASFR_PRIV) {
char buf[128];
bitmask_snprintf(afsr, AFSR_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf), AFSR_BITS, afsr);
panic("Privileged Async Fault: AFAR %p AFSR %lx\n%s",
(void *)afva, afsr, buf);
/* NOTREACHED */
@ -1592,7 +1591,7 @@ text_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t pc,
write_user_windows();
if ((trapdebug & TDB_NSAVED && curpcb->pcb_nsaved) ||
trapdebug & (TDB_TXTFLT | TDB_FOLLOW)) {
bitmask_snprintf(sfsr, SFSR_BITS, buf, sizeof buf);
snprintb(buf, sizeof buf, SFSR_BITS, sfsr);
printf("%ld text_access_error(%lx, %lx, %lx, %p)=%lx @ %lx %s\n",
(long)(curproc?curproc->p_pid:-1),
(long)type, pc, (long)afva, tf, (long)tf->tf_tstate,
@ -1602,7 +1601,7 @@ text_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t pc,
print_trapframe(tf);
}
if ((trapdebug & TDB_TL) && tl()) {
bitmask_snprintf(sfsr, SFSR_BITS, buf, sizeof buf);
snprintb(buf, sizeof buf, SFSR_BITS, sfsr);
printf("%ld tl %ld text_access_error(%lx, %lx, %lx, %p)=%lx @ %lx %s\n",
(long)(curproc?curproc->p_pid:-1), (long)tl(),
(long)type, (long)pc, (long)afva, tf,
@ -1667,7 +1666,7 @@ text_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t pc,
if (tstate & TSTATE_PRIV) {
extern int trap_trace_dis;
trap_trace_dis = 1; /* Disable traptrace for printf */
bitmask_snprintf(sfsr, SFSR_BITS, buf, sizeof buf);
snprintb(buf, sizeof buf, SFSR_BITS, sfsr);
(void) splhigh();
printf("text error: pc=%lx sfsr=%s\n", pc, buf);
DEBUGGER(type, tf);
@ -1702,7 +1701,7 @@ text_access_error(struct trapframe64 *tf, unsigned int type, vaddr_t pc,
if (tstate & TSTATE_PRIV) {
extern int trap_trace_dis;
trap_trace_dis = 1; /* Disable traptrace for printf */
bitmask_snprintf(sfsr, SFSR_BITS, buf, sizeof buf);
snprintb(buf, sizeof buf, SFSR_BITS, sfsr);
(void) splhigh();
printf("text error: pc=%lx sfsr=%s\n", pc, buf);
DEBUGGER(type, tf);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dma.c,v 1.20 2008/04/13 04:55:53 tsutsui Exp $ */
/* $NetBSD: dma.c,v 1.21 2008/12/16 22:35:27 christos Exp $ */
/*
* Copyright (c) 1994 Paul Kranenburg. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dma.c,v 1.20 2008/04/13 04:55:53 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: dma.c,v 1.21 2008/12/16 22:35:27 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -313,13 +313,16 @@ espdmaintr(struct dma_softc *sc)
csr = DMA_GCSR(sc);
#ifdef NCR53C9X_DEBUG
if (ncr53c9x_debug & NCR_SHOWDMA)
snprintb(bits, sizeof(bits), DMACSRBITS, csr);
#endif
NCR_DMA(("%s: intr: addr 0x%x, csr %s\n",
device_xname(sc->sc_dev), DMADDR(sc),
bitmask_snprintf(csr, DMACSRBITS, bits, sizeof(bits))));
device_xname(sc->sc_dev), DMADDR(sc), bits));
if (csr & D_ERR_PEND) {
printf("%s: error: csr=%s\n", device_xname(sc->sc_dev),
bitmask_snprintf(csr, DMACSRBITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), DMACSRBITS, csr);
printf("%s: error: csr=%s\n", device_xname(sc->sc_dev), bits);
csr &= ~D_EN_DMA; /* Stop DMA */
DMA_SCSR(sc, csr);
csr |= D_FLUSH;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.67 2008/11/09 07:01:42 tsutsui Exp $ */
/* $NetBSD: fd.c,v 1.68 2008/12/16 22:35:27 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.67 2008/11/09 07:01:42 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.68 2008/12/16 22:35:27 christos Exp $");
#include "opt_ddb.h"
@ -947,11 +947,41 @@ fdcstart(struct fdc_softc *fdc)
(void)fdcstate(fdc);
}
static void
fdcpstatus(int n, struct fdc_softc *fdc)
{
char bits[64];
switch (n) {
case 0:
printf("\n");
break;
case 2:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
break;
#ifdef DIAGNOSTIC
default:
printf("\nfdcstatus: weird size");
break;
#endif
}
}
void
fdcstatus(device_t dv, int n, const char *s)
{
struct fdc_softc *fdc = device_private(device_parent(dv));
char bits[64];
#if 0
/*
* A 82072 seems to return <invalid command> on
@ -969,31 +999,7 @@ fdcstatus(device_t dv, int n, const char *s)
printf("%s: %s: state %d", device_xname(dv), s, fdc->sc_state);
switch (n) {
case 0:
printf("\n");
break;
case 2:
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 %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
default:
printf(" fdcstatus: weird size: %d\n", n);
break;
#endif
}
fdcpstatus(n, fdc);
}
void
@ -1508,7 +1514,6 @@ fdcstate(struct fdc_softc *fdc)
void
fdcretry(struct fdc_softc *fdc)
{
char bits[64];
struct fd_softc *fd;
struct buf *bp;
@ -1544,15 +1549,7 @@ fdcretry(struct fdc_softc *fdc)
diskerr(bp, "fd", "hard error", LOG_PRINTF,
fd->sc_skip / FDC_BSIZE, NULL);
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]);
fdcpstatus(7, fdc);
}
bp->b_error = EIO;

View File

@ -1,4 +1,4 @@
/* $NetBSD: memerr.c,v 1.21 2008/06/28 12:13:38 tsutsui Exp $ */
/* $NetBSD: memerr.c,v 1.22 2008/12/16 22:35:27 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: memerr.c,v 1.21 2008/06/28 12:13:38 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: memerr.c,v 1.22 2008/12/16 22:35:27 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -178,8 +178,8 @@ memerr_interrupt(void *arg)
(ctx & 8) ? "DVMA" : "CPU");
printf(" ctx=%d, vaddr=0x%x, paddr=0x%x\n",
(ctx & 7), va, pa);
printf(" csr=%s\n", bitmask_snprintf(csr, sc->sc_csrbits,
bits, sizeof(bits)));
snprintb(bits, sizeof(bits), sc->sc_csrbits, csr);
printf(" csr=%s\n", bits);
/*
* If we have parity-checked memory, there is

View File

@ -1,4 +1,4 @@
/* $NetBSD: uba_sbi.c,v 1.25 2008/11/20 17:08:03 hans Exp $ */
/* $NetBSD: uba_sbi.c,v 1.26 2008/12/16 22:35:27 christos Exp $ */
/*
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uba_sbi.c,v 1.25 2008/11/20 17:08:03 hans Exp $");
__KERNEL_RCSID(0, "$NetBSD: uba_sbi.c,v 1.26 2008/12/16 22:35:27 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -356,15 +356,14 @@ ubaerror(struct uba_softc *uh, int *ipl, int *uvec)
"too many zero vectors (%d in <%d sec)\n",
vc->uh_zvcnt, (int)dt + 1);
bitmask_snprintf(uba->uba_cnfgr&(~0xff), UBACNFGR_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), UBACNFGR_BITS,
uba->uba_cnfgr & ~0xff);
aprint_error(
"\tIPL 0x%x\n"
"\tcnfgr: %s\tAdapter Code: 0x%x\n",
*ipl, sbuf, uba->uba_cnfgr&0xff);
bitmask_snprintf(uba->uba_sr, ubasr_bits,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), ubasr_bits, uba->uba_sr);
aprint_error(
"\tsr: %s\n"
"\tdcr: %x (MIC %sOK)\n",
@ -376,8 +375,8 @@ ubaerror(struct uba_softc *uh, int *ipl, int *uvec)
return;
}
if (uba->uba_cnfgr & NEX_CFGFLT) {
bitmask_snprintf(uba->uba_sr, ubasr_bits, sbuf, sizeof(sbuf));
bitmask_snprintf(uba->uba_cnfgr, NEXFLT_BITS, sbuf2, sizeof(sbuf2));
snprintb(sbuf, sizeof(sbuf), ubasr_bits, uba->uba_sr);
snprintb(sbuf2, sizeof(sbuf2), NEXFLT_BITS, uba->uba_cnfgr);
aprint_error_dev(vc->uv_sc.uh_dev,
"sbi fault sr=%s cnfgr=%s\n", sbuf, sbuf2);
ubareset(&vc->uv_sc);
@ -386,7 +385,7 @@ ubaerror(struct uba_softc *uh, int *ipl, int *uvec)
}
sr = uba->uba_sr;
s = spluba();
bitmask_snprintf(uba->uba_sr, ubasr_bits, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), ubasr_bits, uba->uba_sr);
aprint_error_dev(vc->uv_sc.uh_dev,
"uba error sr=%s fmer=%x fubar=%o\n",
sbuf, uba->uba_fmer, 4*uba->uba_fubar);

View File

@ -1,4 +1,4 @@
/* $NetBSD: crl.c,v 1.25 2008/03/11 05:34:03 matt Exp $ */
/* $NetBSD: crl.c,v 1.26 2008/12/16 22:35:27 christos Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: crl.c,v 1.25 2008/03/11 05:34:03 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: crl.c,v 1.26 2008/12/16 22:35:27 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -211,10 +211,10 @@ crlintr(void *arg)
crlstat.crl_ds = mfpr(PR_STXDB);
bitmask_snprintf(crlstat.crl_cs, CRLCS_BITS,
sbuf, sizeof(sbuf));
bitmask_snprintf(crlstat.crl_ds, CRLDS_BITS,
sbuf2, sizeof(sbuf2));
snprintb(sbuf, sizeof(sbuf), CRLCS_BITS,
crlstat.crl_cs);
snprintb(sbuf, sizeof(sbuf), CRLDS_BITS,
crlstat.crl_ds);
printf("crlcs=0x%s, crlds=0x%s\n", sbuf, sbuf2);
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka43.c,v 1.33 2008/03/11 05:34:03 matt Exp $ */
/* $NetBSD: ka43.c,v 1.34 2008/12/16 22:35:28 christos Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ka43.c,v 1.33 2008/03/11 05:34:03 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ka43.c,v 1.34 2008/12/16 22:35:28 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -188,10 +188,10 @@ ka43_memerr(void)
printf("memory error!\n");
bitmask_snprintf(mfpr(PR_PCSTS), KA43_PCSTS_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA43_PCSTS_BITS, mfpr(PR_PCSTS));
printf("primary cache status: %s\n", sbuf);
bitmask_snprintf(*ka43_creg, KA43_SESR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA43_SESR_BITS, *ka43_creg);
printf("secondary cache status: %s\n", sbuf);
}
@ -226,10 +226,10 @@ ka43_cache_reset(void)
ka43_cache_invalidate();
ka43_cache_enable();
bitmask_snprintf(mfpr(PR_PCSTS), KA43_PCSTS_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA43_PCSTS_BITS, mfpr(PR_PCSTS));
printf("primary cache status: %s\n", sbuf);
bitmask_snprintf(*ka43_creg, KA43_SESR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA43_SESR_BITS, *ka43_creg);
printf("secondary cache status: %s\n", sbuf);
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka650.c,v 1.34 2008/03/11 05:34:03 matt Exp $ */
/* $NetBSD: ka650.c,v 1.35 2008/12/16 22:35:28 christos Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
* All rights reserved.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ka650.c,v 1.34 2008/03/11 05:34:03 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ka650.c,v 1.35 2008/12/16 22:35:28 christos Exp $");
#include <sys/param.h>
#include <sys/time.h>
@ -205,8 +205,7 @@ ka650_mchk(void *cmcf)
printf("\n\tvap %x istate1 %x istate2 %x pc %x psl %x\n",
mcf->mc65_mrvaddr, mcf->mc65_istate1, mcf->mc65_istate2,
mcf->mc65_pc, mcf->mc65_psl);
bitmask_snprintf(ka650merr_ptr->merr_dser, DMASER_BITS,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), DMASER_BITS, ka650merr_ptr->merr_dser);
printf("dmaser=0x%s qbear=0x%x dmaear=0x%x\n", sbuf,
(int)ka650merr_ptr->merr_qbear,
(int)ka650merr_ptr->merr_dear);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka670.c,v 1.14 2008/03/11 05:34:03 matt Exp $ */
/* $NetBSD: ka670.c,v 1.15 2008/12/16 22:35:28 christos Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ka670.c,v 1.14 2008/03/11 05:34:03 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ka670.c,v 1.15 2008/12/16 22:35:28 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -172,10 +172,10 @@ ka670_memerr(void)
printf("memory error!\n");
bitmask_snprintf(mfpr(PR_PCSTS), KA670_PCSTS_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA670_PCSTS_BITS, mfpr(PR_PCSTS));
printf("primary cache status: %s\n", sbuf);
bitmask_snprintf(mfpr(PR_BCSTS), KA670_BCSTS_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA670_BCSTS_BITS, mfpr(PR_BCSTS));
printf("secondary cache status: %s\n", sbuf);
}
@ -198,10 +198,10 @@ ka670_cache_init(void)
mtpr(KA670_PCS_ENABLE | KA670_PCS_REFRESH, PR_PCSTS); /* flush primary cache */
#ifdef DEBUG
bitmask_snprintf(mfpr(PR_PCSTS), KA670_PCSTS_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA670_PCSTS_BITS, mfpr(PR_PCSTS));
printf("primary cache status: %s\n", sbuf);
bitmask_snprintf(mfpr(PR_BCSTS), KA670_BCSTS_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), KA670_BCSTS_BITS, mfpr(PR_BCSTS));
printf("secondary cache status: %s\n", sbuf);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka820.c,v 1.49 2008/03/11 05:34:03 matt Exp $ */
/* $NetBSD: ka820.c,v 1.50 2008/12/16 22:35:28 christos Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.49 2008/03/11 05:34:03 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.50 2008/12/16 22:35:28 christos Exp $");
#include "opt_multiprocessor.h"
@ -351,8 +351,8 @@ static const char b2[] = "\20\40RDS\37HIERR\36CRD\35ADRS";
continue;
csr1 = MEMRD(MSREG_CSR1);
csr2 = MEMRD(MSREG_CSR2);
bitmask_snprintf(csr1, b1, sbuf, sizeof(sbuf));
bitmask_snprintf(csr2, b2, sbuf2, sizeof(sbuf2));
snprintb(sbuf, sizeof(sbuf), b1, csr1);
snprintb(sbuf2, sizeof(sbuf2), b2, csr2);
aprint_error_dev(sc->sc_dev, "csr1=%s csr2=%s\n", sbuf, sbuf2);
if ((csr1 & MS1_ERRSUM) == 0)
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka860.c,v 1.31 2008/03/11 05:34:03 matt Exp $ */
/* $NetBSD: ka860.c,v 1.32 2008/12/16 22:35:28 christos Exp $ */
/*
* Copyright (c) 1986, 1988 Regents of the University of California.
* All rights reserved.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ka860.c,v 1.31 2008/03/11 05:34:03 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ka860.c,v 1.32 2008/12/16 22:35:28 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -160,8 +160,8 @@ ka86_memerr(void)
printf("mcr0: ecc error, addr %x (array %d) syn %x\n",
M8600_ADDR(mear), array, M8600_SYN(mdecc));
bitmask_snprintf(mstat1, M8600_MSTAT1_BITS, sbuf, sizeof(sbuf));
bitmask_snprintf(mstat2, M8600_MSTAT2_BITS, sbuf2, sizeof(sbuf2));
snprintb(sbuf, sizeof(sbuf), M8600_MSTAT1_BITS, mstat1);
snprintb(sbuf2, sizeof(sbuf2), M8600_MSTAT2_BITS, mstat2);
printf("\tMSTAT1 = %s\n\tMSTAT2 = %s\n", sbuf, sbuf2);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.86 2008/12/05 13:14:42 isaki Exp $ */
/* $NetBSD: fd.c,v 1.87 2008/12/16 22:35:28 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.86 2008/12/05 13:14:42 isaki Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.87 2008/12/16 22:35:28 christos Exp $");
#include "rnd.h"
#include "opt_ddb.h"
@ -936,11 +936,41 @@ fdcstart(struct fdc_softc *fdc)
(void) fdcintr(fdc);
}
static void
fdcpstatus(int n, struct fdc_softc *fdc)
{
switch (n) {
case 0:
printf("\n");
break;
case 2:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
break;
#ifdef DIAGNOSTIC
default:
printf("\nfdcstatus: weird size");
break;
#endif
}
}
void
fdcstatus(device_t dv, int n, const char *s)
{
struct fdc_softc *fdc = device_private(device_parent(dv));
char bits[64];
if (n == 0) {
out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
@ -949,32 +979,7 @@ fdcstatus(device_t dv, int n, const char *s)
}
printf("%s: %s: state %d", device_xname(dv), s, fdc->sc_state);
switch (n) {
case 0:
printf("\n");
break;
case 2:
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 %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
default:
printf(" fdcstatus: weird size: %d\n", n);
break;
#endif
}
fdcpstatus(n, fdc);
}
void
@ -1454,7 +1459,6 @@ fdcretry(struct fdc_softc *fdc)
{
struct fd_softc *fd;
struct buf *bp;
char bits[64];
DPRINTF(("fdcretry:\n"));
fd = TAILQ_FIRST(&fdc->sc_drives);
@ -1479,19 +1483,7 @@ fdcretry(struct fdc_softc *fdc)
default:
diskerr(bp, "fd", "hard error", LOG_PRINTF,
fd->sc_skip, (struct disklabel *)NULL);
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]);
fdcpstatus(7, fdc);
bp->b_error = EIO;
fdfinish(fd, bp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.30 2008/05/11 22:18:08 ad Exp $ */
/* $NetBSD: clock.c,v 1.31 2008/12/16 22:35:28 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -121,7 +121,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.30 2008/05/11 22:18:08 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.31 2008/12/16 22:35:28 christos Exp $");
/* #define CLOCKDEBUG */
/* #define CLOCK_PARANOIA */
@ -361,8 +361,8 @@ startrtclock(void)
/* Check diagnostic status */
if ((s = mc146818_read(NULL, NVRAM_DIAG)) != 0) { /* XXX softc */
char bits[128];
printf("RTC BIOS diagnostic error %s\n",
bitmask_snprintf(s, NVRAM_DIAG_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), NVRAM_DIAG_BITS, s);
printf("RTC BIOS diagnostic error %s\n", bits);
}
tc_init(&i8254_timecounter);

View File

@ -1,4 +1,4 @@
/* $NetBSD: apic.c,v 1.7 2008/04/28 20:23:40 martin Exp $ */
/* $NetBSD: apic.c,v 1.8 2008/12/16 22:35:28 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: apic.c,v 1.7 2008/04/28 20:23:40 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: apic.c,v 1.8 2008/12/16 22:35:28 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -62,13 +62,15 @@ apic_format_redir(const char *where1, const char *where2, int idx,
{
char buf[256];
snprintb(buf, sizeof(buf), redirlofmt, redirlo);
printf("%s: %s%d %s",
where1, where2, idx,
bitmask_snprintf(redirlo, redirlofmt, buf, sizeof(buf)));
where1, where2, idx, buf);
if ((redirlo & LAPIC_DEST_MASK) == 0)
printf(" %s",
bitmask_snprintf(redirhi, redirhifmt, buf, sizeof(buf)));
if ((redirlo & LAPIC_DEST_MASK) == 0) {
snprintb(buf, sizeof(buf), redirhifmt, redirhi);
printf(" %s", buf);
}
printf("\n");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mpacpi.c,v 1.71 2008/11/09 15:34:14 cegger Exp $ */
/* $NetBSD: mpacpi.c,v 1.72 2008/12/16 22:35:28 christos Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.71 2008/11/09 15:34:14 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.72 2008/12/16 22:35:28 christos Exp $");
#include "acpi.h"
#include "opt_acpi.h"
@ -1041,12 +1041,12 @@ mpacpi_print_intr(struct mp_intr_map *mpi)
printf("%d", mpi->bus->mb_idx);
(*(mpi->bus->mb_intr_print))(mpi->bus_pin);
}
snprintb(buf, sizeof(buf), inttype_fmt, mpi->type);
printf(" (type %s", buf);
snprintb(buf, sizeof(buf), flagtype_fmt, mpi->flags);
printf(" flags %s)\n", buf);
printf(" (type %s",
bitmask_snprintf(mpi->type, inttype_fmt, buf, sizeof(buf)));
printf(" flags %s)\n",
bitmask_snprintf(mpi->flags, flagtype_fmt, buf, sizeof(buf)));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mpbios.c,v 1.49 2008/11/09 15:34:14 cegger Exp $ */
/* $NetBSD: mpbios.c,v 1.50 2008/12/16 22:35:29 christos Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.49 2008/11/09 15:34:14 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.50 2008/12/16 22:35:29 christos Exp $");
#include "acpi.h"
#include "lapic.h"
@ -1158,11 +1158,11 @@ mpbios_int(const uint8_t *ent, int enttype, struct mp_intr_map *mpi)
(*(mpb->mb_intr_print))(dev);
printf(" (type %s",
bitmask_snprintf(type, inttype_fmt, buf, sizeof(buf)));
snprintb(buf, sizeof(buf), inttype_fmt, type);
printf(" (type %s", buf);
printf(" flags %s)\n",
bitmask_snprintf(flags, flagtype_fmt, buf, sizeof(buf)));
snprintb(buf, sizeof(buf), flagtype_fmt, flags);
printf(" flags %s)\n", buf);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.365 2008/12/13 19:38:20 christos Exp $ */
/* $NetBSD: wd.c,v 1.366 2008/12/16 22:35:29 christos Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.365 2008/12/13 19:38:20 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.366 2008/12/16 22:35:29 christos Exp $");
#include "opt_ata.h"
@ -345,8 +345,7 @@ wdattach(struct device *parent, struct device *self, void *aux)
if (wd->sc_quirks != 0) {
char sbuf[sizeof(WD_QUIRK_FMT) + 64];
bitmask_snprintf(wd->sc_quirks, WD_QUIRK_FMT,
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), WD_QUIRK_FMT, wd->sc_quirks);
aprint_normal_dev(self, "quirks %s\n", sbuf);
}
@ -1865,7 +1864,7 @@ wd_setcache(struct wd_softc *wd, int bits)
}
if (ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
char sbuf[sizeof(at_errbits) + 64];
bitmask_snprintf(ata_c.flags, at_errbits, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), at_errbits, ata_c.flags);
aprint_error_dev(wd->sc_dev, "wd_setcache: status=%s\n", sbuf);
return EIO;
}
@ -1894,7 +1893,7 @@ wd_standby(struct wd_softc *wd, int flags)
}
if (ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
char sbuf[sizeof(at_errbits) + 64];
bitmask_snprintf(ata_c.flags, at_errbits, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), at_errbits, ata_c.flags);
aprint_error_dev(wd->sc_dev, "wd_standby: status=%s\n", sbuf);
return EIO;
}
@ -1935,7 +1934,7 @@ wd_flushcache(struct wd_softc *wd, int flags)
}
if (ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
char sbuf[sizeof(at_errbits) + 64];
bitmask_snprintf(ata_c.flags, at_errbits, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), at_errbits, ata_c.flags);
aprint_error_dev(wd->sc_dev, "wd_flushcache: status=%s\n",
sbuf);
return EIO;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4231_ebus.c,v 1.27 2008/12/11 07:09:00 mrg Exp $ */
/* $NetBSD: cs4231_ebus.c,v 1.28 2008/12/16 22:35:29 christos Exp $ */
/*
* Copyright (c) 2002 Valeriy E. Ushakov
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.27 2008/12/11 07:09:00 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.28 2008/12/16 22:35:29 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -272,10 +272,8 @@ cs4231_ebus_dma_reset(bus_space_tag_t dt, bus_space_handle_t dh)
if (timo == 0) {
char bits[128];
printf("cs4231_ebus_dma_reset: timed out: csr=%s\n",
bitmask_snprintf(csr, EBUS_DCSR_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(bits), EBUS_DCSR_BITS, csr);
printf("cs4231_ebus_dma_reset: timed out: csr=%s\n", bits);
return ETIMEDOUT;
}
@ -464,8 +462,9 @@ cs4231_ebus_dma_intr(struct cs_transfer *t, bus_space_tag_t dt,
/* read DMA status, clear TC bit by writing it back */
csr = bus_space_read_4(dt, dh, EBUS_DMAC_DCSR);
bus_space_write_4(dt, dh, EBUS_DMAC_DCSR, csr);
DPRINTF(("audiocs: %s dcsr=%s\n", t->t_name,
bitmask_snprintf(csr, EBUS_DCSR_BITS, bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), EBUS_DCSR_BITS, csr);
DPRINTF(("audiocs: %s dcsr=%s\n", t->t_name, bits));
if (csr & EBDMA_ERR_PEND) {
++t->t_ierrcnt.ev_count;
@ -516,8 +515,9 @@ cs4231_ebus_intr(void *arg)
if (cs4231_ebus_debug > 1)
cs4231_ebus_regdump("audiointr", ebsc);
snprintb(bits, sizeof(bits), AD_R2_BITS, status);
DPRINTF(("%s: status: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
bitmask_snprintf(status, AD_R2_BITS, bits, sizeof(bits))));
bits));
#endif
if (status & INTERRUPT_STATUS) {
@ -525,8 +525,9 @@ cs4231_ebus_intr(void *arg)
int reason;
reason = ad_read(&sc->sc_ad1848, CS_IRQ_STATUS);
snprintb(bits, sizeof(bits), CS_I24_BITS, reason);
DPRINTF(("%s: i24: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
bitmask_snprintf(reason, CS_I24_BITS, bits, sizeof(bits))));
bits));
#endif
/* clear interrupt from ad1848 */
ADWRITE(&sc->sc_ad1848, AD1848_STATUS, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: aac.c,v 1.41 2008/10/02 08:21:57 sborrill Exp $ */
/* $NetBSD: aac.c,v 1.42 2008/12/16 22:35:29 christos Exp $ */
/*-
* Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.41 2008/10/02 08:21:57 sborrill Exp $");
__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.42 2008/12/16 22:35:29 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -348,7 +348,7 @@ aac_describe_code(const struct aac_code_lookup *table, u_int32_t code)
}
/*
* bitmask_snprintf(9) format string for the adapter options.
* snprintb(3) format string for the adapter options.
*/
static const char *optfmt =
"\20\1SNAPSHOT\2CLUSTERS\3WCACHE\4DATA64\5HOSTTIME\6RAID50"
@ -399,9 +399,8 @@ aac_describe_controller(struct aac_softc *sc)
info->MonitorRevision.buildNumber,
((u_int32_t)info->SerialNumber & 0xffffff));
aprint_verbose_dev(&sc->sc_dv, "Controller supports: %s\n",
bitmask_snprintf(sc->sc_supported_options, optfmt, fmtbuf,
sizeof(fmtbuf)));
snprintb(fmtbuf, sizeof(fmtbuf), optfmt, sc->sc_supported_options);
aprint_verbose_dev(&sc->sc_dv, "Controller supports: %s\n", fmtbuf);
/* Save the kernel revision structure for later use. */
sc->sc_revision = info->KernelRevision;
@ -1678,7 +1677,7 @@ aac_print_fib(struct aac_softc *sc, struct aac_fib *fib,
int i;
printf("%s: FIB @ %p\n", caller, fib);
bitmask_snprintf(le32toh(fib->Header.XferState),
snprintb(tbuf, sizeof(tbuf),
"\20"
"\1HOSTOWNED"
"\2ADAPTEROWNED"
@ -1700,9 +1699,7 @@ aac_print_fib(struct aac_softc *sc, struct aac_fib *fib,
"\22ADAPMICROFIB"
"\23BIOSFIB"
"\24FAST_RESPONSE"
"\25APIFIB\n",
tbuf,
sizeof(tbuf));
"\25APIFIB\n", le32toh(fib->Header.XferState));
printf(" XferState %s\n", tbuf);
printf(" Command %d\n", le16toh(fib->Header.Command));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ac97.c,v 1.88 2008/06/24 10:57:45 gmcgarry Exp $ */
/* $NetBSD: ac97.c,v 1.89 2008/12/16 22:35:30 christos Exp $ */
/* $OpenBSD: ac97.c,v 1.8 2000/07/19 09:01:35 csapuntz Exp $ */
/*
@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.88 2008/06/24 10:57:45 gmcgarry Exp $");
__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.89 2008/12/16 22:35:30 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1336,11 +1336,10 @@ ac97_attach_type(struct ac97_host_if *host_if, struct device *sc_dev, int type)
ac97_read(as, AC97_REG_EXT_AUDIO_ID, &as->ext_id);
if (as->ext_id != 0) {
/* Print capabilities */
bitmask_snprintf(as->ext_id,
"\20\20SECONDARY10\17SECONDARY01"
"\14AC97_23\13AC97_22\12AMAP\11LDAC\10SDAC"
"\7CDAC\4VRM\3SPDIF\2DRA\1VRA",
flagbuf, FLAGBUFLEN);
snprintb(flagbuf, sizeof(flagbuf),
"\20\20SECONDARY10\17SECONDARY01"
"\14AC97_23\13AC97_22\12AMAP\11LDAC\10SDAC"
"\7CDAC\4VRM\3SPDIF\2DRA\1VRA", as->ext_id);
aprint_normal_dev(sc_dev, "ac97: ext id %s\n",
flagbuf);
@ -1421,9 +1420,8 @@ ac97_attach_type(struct ac97_host_if *host_if, struct device *sc_dev, int type)
as->type = AC97_CODEC_TYPE_MODEM;
/* Print capabilities */
bitmask_snprintf(as->ext_mid,
"\20\5CID2\4CID1\3HANDSET\2LINE2\1LINE1",
flagbuf, FLAGBUFLEN);
snprintb(flagbuf, sizeof(flagbuf),
"\20\5CID2\4CID1\3HANDSET\2LINE2\1LINE1", as->ext_mid);
aprint_normal_dev(sc_dev, "ac97: ext mid %s",
flagbuf);
aprint_normal(", %s codec\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: atppc.c,v 1.27 2008/04/18 14:56:40 cegger Exp $ */
/* $NetBSD: atppc.c,v 1.28 2008/12/16 22:35:30 christos Exp $ */
/*
* Copyright (c) 2001 Alcove - Nicolas Souchu
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atppc.c,v 1.27 2008/04/18 14:56:40 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: atppc.c,v 1.28 2008/12/16 22:35:30 christos Exp $");
#include "opt_atppc.h"
@ -166,8 +166,8 @@ atppc_sc_attach(struct atppc_softc *lsc)
}
/* Print out chipset capabilities */
bitmask_snprintf(lsc->sc_has, "\20\1INTR\2DMA\3FIFO\4PS2\5ECP\6EPP",
buf, sizeof(buf));
snprintb(buf, sizeof(buf), "\20\1INTR\2DMA\3FIFO\4PS2\5ECP\6EPP",
lsc->sc_has);
printf("%s: capabilities=%s\n", device_xname(lsc->sc_dev), buf);
/* Initialize device's buffer pointers */

View File

@ -1,4 +1,4 @@
/* $NetBSD: atw.c,v 1.141 2008/11/07 00:20:02 dyoung Exp $ */
/* $NetBSD: atw.c,v 1.142 2008/12/16 22:35:30 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.141 2008/11/07 00:20:02 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.142 2008/12/16 22:35:30 christos Exp $");
#include "bpfilter.h"
@ -3294,8 +3294,8 @@ atw_txintr(struct atw_softc *sc)
if ((ifp->if_flags & IFF_DEBUG) != 0 &&
(txstat & ATW_TXSTAT_ERRMASK) != 0) {
bitmask_snprintf(txstat & ATW_TXSTAT_ERRMASK,
ATW_TXSTAT_FMT, txstat_buf, sizeof(txstat_buf));
snprintb(txstat_buf, sizeof(txstat_buf),
ATW_TXSTAT_FMT, txstat & ATW_TXSTAT_ERRMASK);
printf("%s: txstat %s %" __PRIuBITS "\n",
device_xname(sc->sc_dev), txstat_buf,
__SHIFTOUT(txstat, ATW_TXSTAT_ARC_MASK));

View File

@ -1,4 +1,4 @@
/* $NetBSD: gem.c,v 1.79 2008/11/07 00:20:02 dyoung Exp $ */
/* $NetBSD: gem.c,v 1.80 2008/12/16 22:35:30 christos Exp $ */
/*
*
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.79 2008/11/07 00:20:02 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.80 2008/12/16 22:35:30 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -2005,9 +2005,9 @@ gem_eint(struct gem_softc *sc, u_int status)
v);
return (1);
}
printf("%s: status=%s\n", device_xname(&sc->sc_dev),
bitmask_snprintf(status, GEM_INTR_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), GEM_INTR_BITS, status);
printf("%s: status=%s\n", device_xname(&sc->sc_dev), bits);
return (1);
}
@ -2115,9 +2115,12 @@ gem_intr(v)
sc->sc_ev_intr.ev_count++;
status = bus_space_read_4(t, h, GEM_STATUS);
#ifdef GEM_DEBUG
snprintb(bits, sizeof(bits), GEM_INTR_BITS, status);
#endif
DPRINTF(sc, ("%s: gem_intr: cplt 0x%x status %s\n",
device_xname(&sc->sc_dev), (status >> 19),
bitmask_snprintf(status, GEM_INTR_BITS, bits, sizeof(bits))));
device_xname(&sc->sc_dev), (status >> 19), bits));
if ((status & (GEM_INTR_RX_TAG_ERR | GEM_INTR_BERR)) != 0)
r |= gem_eint(sc, status);

View File

@ -1,4 +1,4 @@
/* $NetBSD: hme.c,v 1.67 2008/11/07 00:20:02 dyoung Exp $ */
/* $NetBSD: hme.c,v 1.68 2008/12/16 22:35:31 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.67 2008/11/07 00:20:02 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.68 2008/12/16 22:35:31 christos Exp $");
/* #define HMEDEBUG */
@ -1104,9 +1104,9 @@ hme_eint(sc, status)
device_xname(&sc->sc_dev), cf, st, sm);
return (1);
}
printf("%s: status=%s\n", device_xname(&sc->sc_dev),
bitmask_snprintf(status, HME_SEB_STAT_BITS, bits,sizeof(bits)));
snprintb(bits, sizeof(bits), HME_SEB_STAT_BITS, status);
printf("%s: status=%s\n", device_xname(&sc->sc_dev), bits);
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82365.c,v 1.102 2008/04/08 12:07:26 cegger Exp $ */
/* $NetBSD: i82365.c,v 1.103 2008/12/16 22:35:31 christos Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.102 2008/04/08 12:07:26 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.103 2008/12/16 22:35:31 christos Exp $");
#define PCICDEBUG
@ -369,11 +369,12 @@ pcic_power(why, arg)
if (sc->irq != -1)
reg |= sc->irq << PCIC_CSC_INTR_IRQ_SHIFT;
pcic_write(h, PCIC_CSC_INTR, reg);
#ifdef PCICDEBUG
snprintb(bitbuf, sizeof(bitbuf), PCIC_CSC_INTR_FORMAT,
pcic_read(h, PCIC_CSC_INTR));
#endif
DPRINTF(("%s: CSC_INTR was zero; reset to %s\n",
device_xname(&sc->dev),
bitmask_snprintf(pcic_read(h, PCIC_CSC_INTR),
PCIC_CSC_INTR_FORMAT,
bitbuf, sizeof(bitbuf))));
device_xname(&sc->dev), bitbuf));
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82586.c,v 1.63 2008/11/07 00:20:02 dyoung Exp $ */
/* $NetBSD: i82586.c,v 1.64 2008/12/16 22:35:31 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -137,7 +137,7 @@ Mode of operation:
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.63 2008/11/07 00:20:02 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.64 2008/12/16 22:35:31 christos Exp $");
#include "bpfilter.h"
@ -441,9 +441,10 @@ i82586_rx_errors(sc, fn, status)
int status;
{
char bits[128];
log(LOG_ERR, "%s: rx error (frame# %d): %s\n", device_xname(&sc->sc_dev), fn,
bitmask_snprintf(status, IE_FD_STATUSBITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), IE_FD_STATUSBITS, status);
log(LOG_ERR, "%s: rx error (frame# %d): %s\n",
device_xname(&sc->sc_dev), fn, bits);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: lsi64854.c,v 1.33 2008/04/28 20:23:50 martin Exp $ */
/* $NetBSD: lsi64854.c,v 1.34 2008/12/16 22:35:31 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lsi64854.c,v 1.33 2008/04/28 20:23:50 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: lsi64854.c,v 1.34 2008/12/16 22:35:31 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -380,15 +380,18 @@ lsi64854_scsi_intr(void *arg)
uint32_t csr;
csr = L64854_GCSR(sc);
#ifdef DEBUG
snprintb(bits, sizeof(bits), DDMACSR_BITS, csr);
#endif
DPRINTF(LDB_SCSI, ("%s: %s: addr 0x%x, csr %s\n",
device_xname(sc->sc_dev), __func__,
bus_space_read_4(sc->sc_bustag, sc->sc_regs, L64854_REG_ADDR),
bitmask_snprintf(csr, DDMACSR_BITS, bits, sizeof(bits))));
bits));
if (csr & (D_ERR_PEND|D_SLAVE_ERR)) {
printf("%s: error: csr=%s\n", device_xname(sc->sc_dev),
bitmask_snprintf(csr, DDMACSR_BITS, bits,sizeof(bits)));
snprintb(bits, sizeof(bits), DDMACSR_BITS, csr);
printf("%s: error: csr=%s\n", device_xname(sc->sc_dev), bits);
csr &= ~D_EN_DMA; /* Stop DMA */
/* Invalidate the queue; SLAVE_ERR bit is write-to-clear */
csr |= D_INVALIDATE|D_SLAVE_ERR;
@ -512,8 +515,8 @@ lsi64854_enet_intr(void *arg)
rv = ((csr & E_INT_PEND) != 0) ? 1 : 0;
if (csr & (E_ERR_PEND|E_SLAVE_ERR)) {
printf("%s: error: csr=%s\n", device_xname(sc->sc_dev),
bitmask_snprintf(csr, EDMACSR_BITS, bits,sizeof(bits)));
snprintb(bits, sizeof(bits), EDMACSR_BITS, csr);
printf("%s: error: csr=%s\n", device_xname(sc->sc_dev), bits);
csr &= ~L64854_EN_DMA; /* Stop DMA */
/* Invalidate the queue; SLAVE_ERR bit is write-to-clear */
csr |= E_INVALIDATE|E_SLAVE_ERR;
@ -615,17 +618,20 @@ lsi64854_pp_intr(void *arg)
csr = L64854_GCSR(sc);
#ifdef DEBUG
snprintb(bits, sizeof(bits), PDMACSR_BITS, csr);
#endif
DPRINTF(LDB_PP, ("%s: pp intr: addr 0x%x, csr %s\n",
device_xname(sc->sc_dev),
bus_space_read_4(sc->sc_bustag, sc->sc_regs, L64854_REG_ADDR),
bitmask_snprintf(csr, PDMACSR_BITS, bits, sizeof(bits))));
bits));
if (csr & (P_ERR_PEND|P_SLAVE_ERR)) {
resid = bus_space_read_4(sc->sc_bustag, sc->sc_regs,
L64854_REG_CNT);
snprintb(bits, sizeof(bits), PDMACSR_BITS, csr);
printf("%s: pp error: resid %d csr=%s\n",
device_xname(sc->sc_dev), resid,
bitmask_snprintf(csr, PDMACSR_BITS, bits,sizeof(bits)));
device_xname(sc->sc_dev), resid, bits);
csr &= ~P_EN_DMA; /* Stop DMA */
/* Invalidate the queue; SLAVE_ERR bit is write-to-clear */
csr |= P_INVALIDATE|P_SLAVE_ERR;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb86960.c,v 1.71 2008/11/07 00:20:02 dyoung Exp $ */
/* $NetBSD: mb86960.c,v 1.72 2008/12/16 22:35:31 christos Exp $ */
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.71 2008/11/07 00:20:02 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.72 2008/12/16 22:35:31 christos Exp $");
/*
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
@ -957,7 +957,7 @@ mb86960_rint(struct mb86960_softc *sc, uint8_t rstat)
#if FE_DEBUG >= 3
char sbuf[sizeof(FE_D1_ERRBITS) + 64];
bitmask_snprintf(rstat, FE_D1_ERRBITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), FE_D1_ERRBITS, rstat);
log(LOG_WARNING, "%s: receive error: %s\n",
device_xname(sc->sc_dev), sbuf);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: midway.c,v 1.83 2008/11/07 00:20:02 dyoung Exp $ */
/* $NetBSD: midway.c,v 1.84 2008/12/16 22:35:31 christos Exp $ */
/* (sync'd to midway.c 1.68) */
/*
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.83 2008/11/07 00:20:02 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.84 2008/12/16 22:35:31 christos Exp $");
#include "opt_natm.h"
@ -140,7 +140,7 @@ __KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.83 2008/11/07 00:20:02 dyoung Exp $");
#include "opt_ddb.h"
#include "opt_inet.h"
#else
#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f))
#define snprintb((q), (f), "%b", q,f,b,l) snprintf((b), (l))
#endif
#if NEN > 0 || !defined(__FreeBSD__)
@ -2685,7 +2685,7 @@ void *arg;
{
char sbuf[256];
bitmask_snprintf(reg, MID_INTBITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), MID_INTBITS, reg);
printf("%s: interrupt=0x%s\n", device_xname(&sc->sc_dev), sbuf);
}
#endif
@ -2697,7 +2697,7 @@ void *arg;
if ((reg & (MID_INT_IDENT|MID_INT_LERR|MID_INT_DMA_ERR|MID_INT_SUNI)) != 0) {
char sbuf[256];
bitmask_snprintf(reg, MID_INTBITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), MID_INTBITS, reg);
printf("%s: unexpected interrupt=0x%s, resetting card\n",
device_xname(&sc->sc_dev), sbuf);
#ifdef EN_DEBUG
@ -3420,7 +3420,7 @@ int unit, level;
if (unit != -1 && unit != lcv)
continue;
bitmask_snprintf(level, END_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), END_BITS, level);
printf("dumping device %s at level 0x%s\n", device_xname(&sc->sc_dev), sbuf);
if (sc->dtq_us == 0) {
@ -3468,13 +3468,13 @@ int unit, level;
printf("mregs:\n");
printf("resid = 0x%x\n", EN_READ(sc, MID_RESID));
bitmask_snprintf(EN_READ(sc, MID_INTSTAT), MID_INTBITS, ybuf, sizeof(ybuf));
snprintb(ybuf, sizeof(ybuf), MID_INTBITS, EN_READ(sc, MID_INTSTAT));
printf("interrupt status = 0x%s\n", ybuf);
bitmask_snprintf(EN_READ(sc, MID_INTENA), MID_INTBITS, ybuf, sizeof(ybuf));
snprintb(ybuf, sizeof(ybuf), MID_INTBITS, EN_READ(sc, MID_INTENA));
printf("interrupt enable = 0x%s\n", ybuf);
bitmask_snprintf(EN_READ(sc, MID_MAST_CSR), MID_MCSRBITS, ybuf, sizeof(ybuf));
snprintb(ybuf, sizeof(ybuf), MID_MCSRBITS, EN_READ(sc, MID_MAST_CSR));
printf("mcsr = 0x%s\n", ybuf);
printf("serv_write = [chip=%d] [us=%d]\n", EN_READ(sc, MID_SERV_WRITE),

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunscpal.c,v 1.23 2008/07/06 13:29:50 tsutsui Exp $ */
/* $NetBSD: sunscpal.c,v 1.24 2008/12/16 22:35:31 christos Exp $ */
/*
* Copyright (c) 2001 Matthew Fredette
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunscpal.c,v 1.23 2008/07/06 13:29:50 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: sunscpal.c,v 1.24 2008/12/16 22:35:31 christos Exp $");
#include "opt_ddb.h"
@ -309,8 +309,8 @@ sunscpal_dma_poll(struct sunscpal_softc *sc)
#ifdef SUNSCPAL_DEBUG
if (sunscpal_debug & SUNSCPAL_DBG_DMA) {
char buffer[64];
bitmask_snprintf(SUNSCPAL_READ_2(sc, sunscpal_icr),
SUNSCPAL_ICR_BITS, buffer, sizeof(buffer));
snprintb(buffer, sizeof(buffer),
SUNSCPAL_READ_2(sc, sunscpal_icr), SUNSCPAL_ICR_BITS);
printf("%s: done, icr=%s\n", __func__, buffer);
}
#endif
@ -356,8 +356,7 @@ sunscpal_dma_stop(struct sunscpal_softc *sc)
if (icr & (SUNSCPAL_ICR_BUS_ERROR)) {
char buffer[64];
bitmask_snprintf(icr, SUNSCPAL_ICR_BITS, buffer,
sizeof(buffer));
snprintb(buffer, sizeof(buffer), SUNSCPAL_ICR_BITS, icr);
printf("sc: DMA error, icr=%s, reset\n", buffer);
sr->sr_xs->error = XS_DRIVER_STUFFUP;
sc->sc_state |= SUNSCPAL_ABORTING;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.87 2008/05/03 08:23:41 plunky Exp $ */
/* $NetBSD: fd.c,v 1.88 2008/12/16 22:35:31 christos Exp $ */
/*-
* Copyright (c) 1998, 2003, 2008 The NetBSD Foundation, Inc.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.87 2008/05/03 08:23:41 plunky Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.88 2008/12/16 22:35:31 christos Exp $");
#include "rnd.h"
#include "opt_ddb.h"
@ -961,36 +961,26 @@ fdcstart(struct fdc_softc *fdc)
(void)fdcintr1(fdc);
}
void
fdcstatus(device_t dv, int n, const char *s)
static void
fdcpstatus(int n, struct fdc_softc *fdc)
{
struct fdc_softc *fdc = device_private(device_parent(dv));
char bits[64];
if (n == 0) {
out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
(void) fdcresult(fdc);
n = 2;
}
aprint_normal_dev(dv, "%s", s);
switch (n) {
case 0:
printf("\n");
break;
case 2:
printf(" (st0 %s cyl %d)\n",
bitmask_snprintf(fdc->sc_status[0], NE7_ST0BITS,
bits, sizeof(bits)), fdc->sc_status[1]);
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
break;
case 7:
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)));
snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
printf(" (st0 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
printf(" st1 %s", bits);
snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
printf(" st2 %s", bits);
printf(" cyl %d head %d sec %d)\n",
fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
break;
@ -1002,6 +992,22 @@ fdcstatus(device_t dv, int n, const char *s)
}
}
void
fdcstatus(device_t dv, int n, const char *s)
{
struct fdc_softc *fdc = device_private(device_parent(dv));
if (n == 0) {
out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
(void) fdcresult(fdc);
n = 2;
}
fdcpstatus(n, fdc);
aprint_normal_dev(dv, "%s", s);
}
void
fdctimeout(void *arg)
{
@ -1337,7 +1343,6 @@ fdcintr(void *arg)
void
fdcretry(struct fdc_softc *fdc)
{
char bits[64];
struct fd_softc *fd;
struct buf *bp;
@ -1367,23 +1372,7 @@ fdcretry(struct fdc_softc *fdc)
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
diskerr(bp, "fd", "hard error", LOG_PRINTF,
fd->sc_skip / FDC_BSIZE, NULL);
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]);
fdcpstatus(7, fdc);
}
bp->b_error = EIO;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_iy.c,v 1.81 2008/11/07 00:20:07 dyoung Exp $ */
/* $NetBSD: if_iy.c,v 1.82 2008/12/16 22:35:32 christos Exp $ */
/* #define IYDEBUG */
/* #define IYMEMDEBUG */
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.81 2008/11/07 00:20:07 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.82 2008/12/16 22:35:32 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -412,19 +412,20 @@ struct iy_softc *sc;
bus_space_write_2(iot, ioh, HOST_ADDR_REG, p);
v = le16toh(bus_space_read_stream_2(iot, ioh, MEM_PORT_REG));
bitmask_snprintf(v, "\020\006Ab\010Dn", sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), "\020\006Ab\010Dn", v);
printf("0x%04x: %s ", p, sbuf);
v = le16toh(bus_space_read_stream_2(iot, ioh, MEM_PORT_REG));
bitmask_snprintf(v, "\020\6MAX_COL\7HRT_BEAT\010TX_DEF\011UND_RUN\012JERR\013LST_CRS\014LTCOL\016TX_OK\020COLL",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\6MAX_COL\7HRT_BEAT\010TX_DEF\011UND_RUN"
"\012JERR\013LST_CRS\014LTCOL\016TX_OK\020COLL", v);
printf("0x%s", sbuf);
p = le16toh(bus_space_read_stream_2(iot, ioh, MEM_PORT_REG));
printf(" 0x%04x", p);
v = le16toh(bus_space_read_stream_2(iot, ioh, MEM_PORT_REG));
bitmask_snprintf(v, "\020\020Ch", sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), "\020\020Ch", v);
printf(" 0x%s\n", sbuf);
} while (v & 0x8000);
@ -488,8 +489,10 @@ struct iy_softc *sc;
{
char sbuf[128];
bitmask_snprintf(temp, "\020\1PRMSC\2NOBRDST\3SEECRC\4LENGTH\5NOSaIns\6MultiIA",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\1PRMSC\2NOBRDST\3SEECRC\4LENGTH\5NOSaIns\6MultiIA",
temp);
printf("%s: RECV_MODES set to %s\n", device_xname(&sc->sc_dev), sbuf);
}
#endif
@ -506,8 +509,8 @@ struct iy_softc *sc;
{
char sbuf[128];
bitmask_snprintf(temp, "\020\1LnkInDis\2PolCor\3TPE\4JabberDis\5NoAport\6BNC",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\1LnkInDis\2PolCor\3TPE\4JabberDis\5NoAport\6BNC");
printf("%s: media select was 0x%s ", device_xname(&sc->sc_dev), sbuf);
}
#endif
@ -545,8 +548,9 @@ struct iy_softc *sc;
{
char sbuf[128];
bitmask_snprintf(temp, "\020\1LnkInDis\2PolCor\3TPE\4JabberDis\5NoAport\6BNC",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\1LnkInDis\2PolCor\3TPE\4JabberDis\5NoAport\6BNC",
temp);
printf("changed to 0x%s\n", sbuf);
}
#endif
@ -562,13 +566,14 @@ struct iy_softc *sc;
{
char sbuf[128];
bitmask_snprintf(temp, "\020\4bad_irq\010flash/boot present",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\4bad_irq\010flash/boot present", temp);
printf("%s: int no was %s\n", device_xname(&sc->sc_dev), sbuf);
temp = bus_space_read_1(iot, ioh, INT_NO_REG);
bitmask_snprintf(temp, "\020\4bad_irq\010flash/boot present",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\4bad_irq\010flash/boot present", temp);
printf("%s: int no now %s\n", device_xname(&sc->sc_dev), sbuf);
}
#endif
@ -583,8 +588,9 @@ struct iy_softc *sc;
{
char sbuf[128];
bitmask_snprintf(temp, "\020\2WORD_WIDTH\010INT_ENABLE",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), "\020\2WORD_WIDTH\010INT_ENABLE",
temp);
printf("%s: HW access is %s\n", device_xname(&sc->sc_dev), sbuf);
}
#endif
@ -595,8 +601,8 @@ struct iy_softc *sc;
char sbuf[128];
temp = bus_space_read_1(iot, ioh, REG1);
bitmask_snprintf(temp, "\020\2WORD_WIDTH\010INT_ENABLE",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), "\020\2WORD_WIDTH\010INT_ENABLE",
temp);
printf("%s: HW access is %s\n", device_xname(&sc->sc_dev), sbuf);
}
#endif
@ -969,13 +975,13 @@ iyintr(arg)
if (status & ALL_INTS) {
char sbuf[128];
bitmask_snprintf(status, "\020\1RX_STP\2RX\3TX\4EXEC",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), "\020\1RX_STP\2RX\3TX\4EXEC",
status);
printf("%s: got interrupt %s", device_xname(&sc->sc_dev), sbuf);
if (status & EXEC_INT) {
bitmask_snprintf(bus_space_read_1(iot, ioh, 0),
"\020\6ABORT", sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\6ABORT", bus_space_read_1(iot, ioh, 0));
printf(" event %s\n", sbuf);
} else
printf("\n");
@ -1112,8 +1118,10 @@ struct iy_softc *sc;
{
char sbuf[128];
bitmask_snprintf(rxstatus, "\020\1RCLD\2IA_MCH\010SHORT\011OVRN\013ALGERR\014CRCERR\015LENERR\016RCVOK\020TYP",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\1RCLD\2IA_MCH\010SHORT\011OVRN\013ALGERR"
"\014CRCERR\015LENERR\016RCVOK\020TYP", rxstatus);
printf("%s: pck at 0x%04x stat %s next 0x%x len 0x%x\n",
device_xname(&sc->sc_dev), rxadrs, sbuf, rxnext, rxlen);
}
@ -1163,8 +1171,11 @@ struct iy_softc *sc;
{
char sbuf[128];
bitmask_snprintf(txstat2, "\020\6MAX_COL\7HRT_BEAT\010TX_DEF\011UND_RUN\012JERR\013LST_CRS\014LTCOL\016TX_OK\020COLL",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\020\6MAX_COL\7HRT_BEAT\010TX_DEF"
"\011UND_RUN\012JERR\013LST_CRS"
"\014LTCOL\016TX_OK\020COLL", txstat2)
printf("txstat 0x%x stat2 0x%s next 0x%x len 0x%x\n",
txstatus, sbuf, txnext, txlen);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: edc_mca.c,v 1.40 2008/05/04 13:11:14 martin Exp $ */
/* $NetBSD: edc_mca.c,v 1.41 2008/12/16 22:35:32 christos Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.40 2008/05/04 13:11:14 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.41 2008/12/16 22:35:32 christos Exp $");
#include "rnd.h"
@ -772,7 +772,7 @@ edc_dump_status_block(struct edc_mca_softc *sc, u_int16_t *status_block,
printf("%s: Device Error Code: %s\n",
device_xname(&sc->sc_dev),
edc_dev_errors[status_block[2] & 0xff]);
bitmask_snprintf((status_block[2] & 0xff00) >> 8,
snprintb(buf, sizeof(buf),
"\20"
"\01SeekOrCmdComplete"
"\02Track0Flag"
@ -781,8 +781,8 @@ edc_dump_status_block(struct edc_mca_softc *sc, u_int16_t *status_block,
"\05Ready"
"\06Reserved0"
"\07STANDBY"
"\010Reserved0",
buf, sizeof(buf));
"\010Reserved0", (status_block[2] & 0xff00) >> 8);
printf("%s: Device Status: %s\n",
device_xname(&sc->sc_dev), buf);
#else

View File

@ -1,4 +1,4 @@
/* $NetBSD: azalia.c,v 1.64 2008/06/26 15:51:10 kent Exp $ */
/* $NetBSD: azalia.c,v 1.65 2008/12/16 22:35:33 christos Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.64 2008/06/26 15:51:10 kent Exp $");
__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.65 2008/12/16 22:35:33 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -1643,9 +1643,10 @@ azalia_widget_init(widget_t *this, const codec_t *codec,
this->nid = nid;
this->widgetcap = result;
this->type = COP_AWCAP_TYPE(result);
bitmask_snprintf(this->widgetcap, "\20\014LRSWAP\013POWER\012DIGITAL"
snprintb(flagbuf, sizeof(flagbuf),
"\20\014LRSWAP\013POWER\012DIGITAL"
"\011CONNLIST\010UNSOL\07PROC\06STRIPE\05FORMATOV\04AMPOV\03OUTAMP"
"\02INAMP\01STEREO", flagbuf, FLAGBUFLEN);
"\02INAMP\01STEREO", this->widgetcap);
DPRINTF(("%s: ", device_xname(codec->dev)));
if (this->widgetcap & COP_AWCAP_POWER) {
codec->comresp(codec, nid, CORB_SET_POWER_STATE, CORB_PS_D0, &result);
@ -1783,8 +1784,8 @@ azalia_widget_print_audio(const widget_t *this, const char *lead, int channels)
{
char flagbuf[FLAGBUFLEN];
bitmask_snprintf(this->d.audio.encodings, "\20\3AC3\2FLOAT32\1PCM",
flagbuf, FLAGBUFLEN);
snprintb(flagbuf, sizeof(flagbuf),
"\20\3AC3\2FLOAT32\1PCM", this->d.audio.encodings);
if (channels < 0) {
aprint_normal("%sencodings=%s\n", lead, flagbuf);
} else if (this->widgetcap & COP_AWCAP_DIGITAL) {
@ -1794,10 +1795,12 @@ azalia_widget_print_audio(const widget_t *this, const char *lead, int channels)
aprint_normal("%smax channels=%d, encodings=%s\n",
lead, channels, flagbuf);
}
bitmask_snprintf(this->d.audio.bits_rates, "\20\x15""32bit\x14""24bit\x13""20bit"
snprintb(flagbuf, sizeof(flagbuf),
"\20\x15""32bit\x14""24bit\x13""20bit"
"\x12""16bit\x11""8bit""\x0c""384kHz\x0b""192kHz\x0a""176.4kHz"
"\x09""96kHz\x08""88.2kHz\x07""48kHz\x06""44.1kHz\x05""32kHz\x04"
"22.05kHz\x03""16kHz\x02""11.025kHz\x01""8kHz",
this->d.audio.bits_rates);
flagbuf, FLAGBUFLEN);
aprint_normal("%sPCM formats=%s\n", lead, flagbuf);
return 0;
@ -1860,9 +1863,10 @@ azalia_widget_print_pin(const widget_t *this, const char *lead)
DPRINTF(("%spin config; device=%s color=%s assoc=%d seq=%d", lead,
pin_devices[this->d.pin.device], pin_colors[this->d.pin.color],
this->d.pin.association, this->d.pin.sequence));
bitmask_snprintf(this->d.pin.cap, "\20\021EAPD\07BALANCE\06INPUT"
snprintb(flagbuf, sizeof(flagbuf),
"\20\021EAPD\07BALANCE\06INPUT"
"\05OUTPUT\04HEADPHONE\03PRESENCE\02TRIGGER\01IMPEDANCE",
flagbuf, FLAGBUFLEN);
this->d.pin.cap);
DPRINTF((" cap=%s\n", flagbuf));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: btvmei.c,v 1.18 2008/04/10 19:13:36 cegger Exp $ */
/* $NetBSD: btvmei.c,v 1.19 2008/12/16 22:35:33 christos Exp $ */
/*
* Copyright (c) 1999
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.18 2008/04/10 19:13:36 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.19 2008/12/16 22:35:33 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -284,7 +284,7 @@ b3_617_reset(sc)
if (status & LSR_CERROR_MASK) {
char sbuf[sizeof(BIT3_LSR_BITS) + 64];
bitmask_snprintf(status, BIT3_LSR_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), BIT3_LSR_BITS, status);
printf("%s: interface error, lsr=%s\n", device_xname(&sc->sc_dev),
sbuf);
return (-1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ichsmb.c,v 1.17 2008/10/01 15:38:14 christos Exp $ */
/* $NetBSD: ichsmb.c,v 1.18 2008/12/16 22:35:33 christos Exp $ */
/* $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */
/*
@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.17 2008/10/01 15:38:14 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.18 2008/12/16 22:35:33 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -228,7 +228,7 @@ ichsmb_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
DELAY(ICHIIC_DELAY);
}
#ifdef ICHIIC_DEBUG
bitmask_snprintf(st, LPCIB_SMB_HS_BITS, fbuf, sizeof(fbuf));
snprintb(fbuf, sizeof(fbuf), LPCIB_SMB_HS_BITS, st);
printf("%s: exec: st 0x%s\n", device_xname(sc->sc_dev), fbuf);
#endif
if (st & LPCIB_SMB_HS_BUSY)
@ -311,7 +311,7 @@ timeout:
/*
* Transfer timeout. Kill the transaction and clear status bits.
*/
bitmask_snprintf(st, LPCIB_SMB_HS_BITS, fbuf, sizeof(fbuf));
snprintb(fbuf, sizeof(fbuf), LPCIB_SMB_HS_BITS, st);
aprint_error_dev(sc->sc_dev,
"exec: op %d, addr 0x%02x, cmdlen %zd, len %zd, "
"flags 0x%02x: timeout, status 0x%s\n",
@ -321,7 +321,7 @@ timeout:
DELAY(ICHIIC_DELAY);
st = bus_space_read_1(sc->sc_iot, sc->sc_ioh, LPCIB_SMB_HS);
if ((st & LPCIB_SMB_HS_FAILED) == 0) {
bitmask_snprintf(st, LPCIB_SMB_HS_BITS, fbuf, sizeof(fbuf));
snprintb(fbuf, sizeof(fbuf), LPCIB_SMB_HS_BITS, st);
aprint_error_dev(sc->sc_dev, "abort failed, status 0x%s\n",
fbuf);
}
@ -349,7 +349,7 @@ ichsmb_intr(void *arg)
return (0);
#ifdef ICHIIC_DEBUG
bitmask_snprintf(st, LPCIB_SMB_HS_BITS, fbuf, sizeof(fbuf));
snprintb(fbuf, sizeof(fbuf), LPCIB_SMB_HS_BITS, st);
printf("%s: intr st 0x%s\n", device_xname(sc->sc_dev), fbuf);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_nfe.c,v 1.37 2008/11/07 00:20:07 dyoung Exp $ */
/* $NetBSD: if_nfe.c,v 1.38 2008/12/16 22:35:33 christos Exp $ */
/* $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $ */
/*-
@ -21,7 +21,7 @@
/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.37 2008/11/07 00:20:07 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.38 2008/12/16 22:35:33 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -956,9 +956,9 @@ nfe_txeof(struct nfe_softc *sc)
continue;
if ((flags & NFE_TX_ERROR_V1) != 0) {
snprintb(buf, sizeof(buf), NFE_V1_TXERR, flags);
aprint_error_dev(sc->sc_dev, "tx v1 error %s\n",
bitmask_snprintf(flags, NFE_V1_TXERR,
buf, sizeof(buf)));
buf);
ifp->if_oerrors++;
} else
ifp->if_opackets++;
@ -968,9 +968,9 @@ nfe_txeof(struct nfe_softc *sc)
continue;
if ((flags & NFE_TX_ERROR_V2) != 0) {
snprintb(buf, sizeof(buf), NFE_V2_TXERR, flags);
aprint_error_dev(sc->sc_dev, "tx v2 error %s\n",
bitmask_snprintf(flags, NFE_V2_TXERR,
buf, sizeof(buf)));
buf);
ifp->if_oerrors++;
} else
ifp->if_opackets++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_xge.c,v 1.9 2008/04/10 19:13:37 cegger Exp $ */
/* $NetBSD: if_xge.c,v 1.10 2008/12/16 22:35:33 christos Exp $ */
/*
* Copyright (c) 2004, SUNET, Swedish University Computer Network.
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.9 2008/04/10 19:13:37 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.10 2008/12/16 22:35:33 christos Exp $");
#include "bpfilter.h"
#include "rnd.h"
@ -633,7 +633,7 @@ xge_init(struct ifnet *ifp)
char buf[200];
printf("%s: adapter not quiescent, aborting\n", XNAME);
val = (val & QUIESCENT) ^ QUIESCENT;
bitmask_snprintf(val, QUIESCENT_BMSK, buf, sizeof buf);
snprintb(buf, sizeof buf, QUIESCENT_BMSK, val);
printf("%s: ADAPTER_STATUS missing bits %s\n", XNAME, buf);
return 1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci.c,v 1.120 2008/11/16 17:31:03 bouyer Exp $ */
/* $NetBSD: pci.c,v 1.121 2008/12/16 22:35:33 christos Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.120 2008/11/16 17:31:03 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.121 2008/12/16 22:35:33 christos Exp $");
#include "opt_pci.h"
@ -255,12 +255,11 @@ pciprint(void *aux, const char *pnp)
if (qd == NULL) {
printf(" no quirks");
} else {
bitmask_snprintf(qd->quirks,
snprintb(devinfo, sizeof (devinfo),
"\002\001multifn\002singlefn\003skipfunc0"
"\004skipfunc1\005skipfunc2\006skipfunc3"
"\007skipfunc4\010skipfunc5\011skipfunc6"
"\012skipfunc7",
devinfo, sizeof (devinfo));
"\012skipfunc7", qd->quirks);
printf(" quirks %s", devinfo);
}
printf(")");

View File

@ -1,4 +1,4 @@
/* $NetBSD: yds.c,v 1.43 2008/07/09 15:42:37 joerg Exp $ */
/* $NetBSD: yds.c,v 1.44 2008/12/16 22:35:34 christos Exp $ */
/*
* Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.43 2008/07/09 15:42:37 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.44 2008/12/16 22:35:34 christos Exp $");
#include "mpu.h"
@ -776,9 +776,8 @@ yds_attach(device_t parent, device_t self, void *aux)
if (ydsdebug) {
char bits[80];
printf("%s: chip has %s\n", device_xname(self),
bitmask_snprintf(sc->sc_flags, YDS_CAP_BITS, bits,
sizeof(bits)));
snprintb(bits, sizeof*bifs), YDS_CAP_BITS, sc->sc_flags);
printf("%s: chip has %s\n", device_xname(self), bits);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: lpt.c,v 1.27 2008/04/16 09:39:01 cegger Exp $ */
/* $NetBSD: lpt.c,v 1.28 2008/12/16 22:35:34 christos Exp $ */
/*
* Copyright (c) 1990 William F. Jolitz, TeleMuse
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.27 2008/04/16 09:39:01 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: lpt.c,v 1.28 2008/12/16 22:35:34 christos Exp $");
#include "opt_ppbus_lpt.h"
@ -178,8 +178,9 @@ lpt_attach(device_t parent, device_t self, void *aux)
/* Print out mode */
ppbdev->ctx.mode = ppbus_get_mode(parent);
bitmask_snprintf(ppbdev->ctx.mode, "\20\1COMPATIBLE\2NIBBLE"
"\3PS2\4EPP\5ECP\6FAST_CENTR", buf, sizeof(buf));
snprintb(buf, sizeof(buf),
"\20\1COMPATIBLE\2NIBBLE\3PS2\4EPP\5ECP\6FAST_CENTR",
ppbdev->ctx.mode);
printf(": port mode = %s\n", buf);
/* Initialize the device on open by default */

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_de.c,v 1.23 2008/03/11 05:34:01 matt Exp $ */
/* $NetBSD: if_de.c,v 1.24 2008/12/16 22:35:34 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989 Regents of the University of California.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.23 2008/03/11 05:34:01 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.24 2008/12/16 22:35:34 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -615,10 +615,10 @@ dewait(struct de_softc *sc, const char *fn)
char bits0[64];
char bits1[64];
csr1 = DE_RCSR(DE_PCSR1);
snprintb(bits0, sizeof(bits0), PCSR0_BITS, csr0);
snprintb(bits1, sizeof(bits1), PCSR1_BITS, csr1);
aprint_error_dev(sc->sc_dev, "%s failed, csr0=%s csr1=%s\n",
fn,
bitmask_snprintf(csr0, PCSR0_BITS, bits0, sizeof(bits0)),
bitmask_snprintf(csr1, PCSR1_BITS, bits1, sizeof(bits1)));
fn, bits0, bits1);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_dmc.c,v 1.17 2008/11/07 00:20:12 dyoung Exp $ */
/* $NetBSD: if_dmc.c,v 1.18 2008/12/16 22:35:34 christos Exp $ */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.17 2008/11/07 00:20:12 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.18 2008/12/16 22:35:34 christos Exp $");
#undef DMCDEBUG /* for base table dump on fatal error */
@ -695,8 +695,8 @@ dmcxint(void *a)
arg &= DMC_CNTMASK;
if (arg & DMC_FATAL) {
if (arg != DMC_START) {
bitmask_snprintf(arg, CNTLO_BITS,
buf, sizeof(buf));
snprintb(buf, sizeof(buf), CNTLO_BITS,
arg);
log(LOG_ERR,
"%s: fatal error, flags=%s\n",
device_xname(&sc->sc_dev), buf);
@ -730,7 +730,7 @@ dmcxint(void *a)
break;
report:
#ifdef DMCDEBUG
bitmask_snprintf(arg, CNTLO_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf), CNTLO_BITS, arg);
printd("%s: soft error, flags=%s\n",
device_xname(&sc->sc_dev), buf);
#endif
@ -944,10 +944,10 @@ dmctimeout(struct ifnet *ifp)
char buf1[64], buf2[64];
if (sc->sc_flag & DMC_ONLINE) {
bitmask_snprintf(DMC_RBYTE(DMC_BSEL0) & 0xff, DMC0BITS,
buf1, sizeof(buf1));
bitmask_snprintf(DMC_RBYTE(DMC_BSEL2) & 0xff, DMC2BITS,
buf2, sizeof(buf2));
snprintb(buf1, sizeof(buf1), DMC0BITS,
DMC_RBYTE(DMC_BSEL0) & 0xff);
snprintb(buf2, sizeof(buf2), DMC2BITS,
DMC_RBYTE(DMC_BSEL2) & 0xff);
log(LOG_ERR, "%s: output timeout, bsel0=%s bsel2=%s\n",
device_xname(&sc->sc_dev), buf1, buf2);
dmcrestart(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_il.c,v 1.19 2008/04/05 19:16:49 cegger Exp $ */
/* $NetBSD: if_il.c,v 1.20 2008/12/16 22:35:34 christos Exp $ */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.19 2008/04/05 19:16:49 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.20 2008/12/16 22:35:34 christos Exp $");
#include "opt_inet.h"
@ -230,9 +230,8 @@ ilwait(struct il_softc *sc, char *op)
if (IL_RCSR(IL_CSR)&IL_STATUS) {
char bits[64];
aprint_error_dev(&sc->sc_dev, "%s failed, csr=%s\n", op,
bitmask_snprintf(IL_RCSR(IL_CSR), IL_BITS, bits,
sizeof(bits)));
snprintb(bits, sizeof(bits), IL_BITS, IL_RCSR(IL_CSR));
aprint_error_dev(&sc->sc_dev, "%s failed, csr=%s\n", op, bits);
return (-1);
}
return (0);
@ -444,9 +443,8 @@ ilcint(void *arg)
if ((sc->sc_if.if_flags & IFF_OACTIVE) == 0) {
char bits[64];
snprintb(bits, sizeof(bits), IL_BITS, IL_RCSR(IL_CSR));
aprint_error_dev(&sc->sc_dev, "stray xmit interrupt, csr=%s\n",
bitmask_snprintf(IL_RCSR(IL_CSR), IL_BITS, bits,
sizeof(bits)));
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_qt.c,v 1.14 2008/03/11 05:34:01 matt Exp $ */
/* $NetBSD: if_qt.c,v 1.15 2008/12/16 22:35:34 christos Exp $ */
/*
* Copyright (c) 1992 Steven M. Schultz
* All rights reserved.
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_qt.c,v 1.14 2008/03/11 05:34:01 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_qt.c,v 1.15 2008/12/16 22:35:34 christos Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -535,7 +535,7 @@ qttint(struct qt_softc *sc)
{
#ifdef QTDEBUG
char buf[100];
bitmask_snprintf(rp->tmd2, TMD2_BITS, buf, 100);
snprintb(buf, sizeof(buf), TMD2_BITS, rp->tmd2);
printf("%s: tmd2 %s\n", device_xname(sc->sc_dev), buf);
#endif
sc->is_if.if_oerrors++;
@ -576,9 +576,9 @@ qtrint(struct qt_softc *sc)
{
#ifdef QTDEBUG
char buf[100];
bitmask_snprintf(rp->rmd0, RMD0_BITS, buf, 100);
snprintb(buf, sizeof(buf), RMD0_BITS, rp->rmd0);
printf("%s: rmd0 %s\n", device_xname(sc->sc_dev), buf);
bitmask_snprintf(rp->rmd2, RMD2_BITS, buf, 100);
snprintb(buf, sizeof(buf), RMD2_BITS, rp->rmd2);
printf("%s: rmd2 %s\n", device_xname(sc->sc_dev), buf);
#endif
sc->is_if.if_ierrors++;
@ -627,7 +627,7 @@ void
qtsrr(struct qt_softc *sc, int srrbits)
{
char buf[100];
bitmask_snprintf(srrbits, SRR_BITS, buf, sizeof buf);
snprintb(buf, sizeof(buf), SRR_BITS, srrbits);
printf("%s: srr=%s\n", device_xname(sc->sc_dev), buf);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ts.c,v 1.25 2008/04/05 19:16:49 cegger Exp $ */
/* $NetBSD: ts.c,v 1.26 2008/12/16 22:35:35 christos Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.25 2008/04/05 19:16:49 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.26 2008/12/16 22:35:35 christos Exp $");
#undef TSDEBUG
@ -540,9 +540,9 @@ prtstat(struct ts_softc *sc, int sr)
{
char buf[100];
bitmask_snprintf(sr, TS_TSSR_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf), TS_TSSR_BITS, sr);
aprint_normal_dev(sc->sc_dev, "TSSR=%s\n", buf);
bitmask_snprintf(sc->sc_vts->status.xst0,TS_XST0_BITS,buf,sizeof(buf));
snprintb(buf, sizeof(buf), TS_XST0_BITS, sc->sc_vts->status.xst0);
aprint_normal_dev(sc->sc_dev, "XST0=%s\n", buf);
}
@ -565,7 +565,7 @@ tsintr(void *arg)
#ifdef TSDEBUG
{
char buf[100];
bitmask_snprintf(sr, TS_TSSR_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf), TS_TSSR_BITS, sr);
printf("tsintr: sr %x mh %x\n", sr, mh);
printf("srbits: %s\n", buf);
}
@ -658,8 +658,8 @@ tsintr(void *arg)
#ifdef TSDEBUG
{
char buf[100];
bitmask_snprintf(sc->sc_vts->status.xst0,
TS_XST0_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf),
TS_XST0_BITS, sc->sc_vts->status.xst0);
printf("TSA: sr %x bits %s\n",
sc->sc_vts->status.xst0, buf);
}
@ -685,8 +685,8 @@ tsintr(void *arg)
#ifndef TSDEBUG
{
char buf[100];
bitmask_snprintf(sc->sc_vts->status.xst0,
TS_XST0_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf),
TS_XST0_BITS, sc->sc_vts->status.xst0);
printf("TSA: sr %x bits %s\n",
sc->sc_vts->status.xst0, buf);
}
@ -704,8 +704,8 @@ tsintr(void *arg)
#ifdef TSDEBUG
{
char buf[100];
bitmask_snprintf(sc->sc_vts->status.xst0,
TS_XST0_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf),
TS_XST0_BITS, sc->sc_vts->status.xst0);
printf("FR: sr %x bits %s\n",
sc->sc_vts->status.xst0, buf);
}
@ -848,8 +848,8 @@ tsopen(dev_t dev, int flag, int type, struct lwp *l)
#ifdef TSDEBUG
{
char buf[100];
bitmask_snprintf(sc->sc_vts->status.xst0,
TS_XST0_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf),
TS_XST0_BITS, sc->sc_vts->status.xst0);
printf("tsopen: xst0 %s\n", buf);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4231_sbus.c,v 1.42 2008/04/29 18:07:11 ad Exp $ */
/* $NetBSD: cs4231_sbus.c,v 1.43 2008/12/16 22:35:35 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2002, 2007 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cs4231_sbus.c,v 1.42 2008/04/29 18:07:11 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: cs4231_sbus.c,v 1.43 2008/12/16 22:35:35 christos Exp $");
#include "audio.h"
#if NAUDIO > 0
@ -224,10 +224,9 @@ cs4231_sbus_regdump(char *label, struct cs4231_sbus_softc *sc)
printf("dmacnc: 0x%x\n",
bus_space_read_4(sc->sc_bh, sc->sc_bh, APC_DMA_CNC));
printf("apc_dmacsr=%s\n",
bitmask_snprintf(
bus_space_read_4(sc->sc_bh, sc->sc_bh, APC_DMA_CSR),
APC_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), APC_BITS,
bus_space_read_4(sc->sc_bh, sc->sc_bh, APC_DMA_CSR));
printf("apc_dmacsr=%s\n", bits);
ad1848_dump_regs(&sc->sc_cs4231.sc_ad1848);
}
@ -275,8 +274,10 @@ cs4231_sbus_trigger_output(void *addr, void *start, void *end, int blksize,
bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh, APC_DMA_PNC)));
csr = bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh, APC_DMA_CSR);
DPRINTF(("trigger_output: csr=%s\n",
bitmask_snprintf(csr, APC_BITS, bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("trigger_output: csr=%s\n", bits));
if ((csr & PDMA_GO) == 0 || (csr & APC_PPAUSE) != 0) {
int cfg;
@ -295,8 +296,11 @@ cs4231_sbus_trigger_output(void *addr, void *start, void *end, int blksize,
ad_write(&sc->sc_ad1848, SP_INTERFACE_CONFIG,
(cfg | PLAYBACK_ENABLE));
} else {
DPRINTF(("trigger_output: already: csr=%s\n",
bitmask_snprintf(csr, APC_BITS, bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("trigger_output: already: csr=%s\n", bits));
}
/* load next block if we can */
@ -333,8 +337,10 @@ cs4231_sbus_halt_output(void *addr)
sc->sc_playback.t_active = 0;
csr = bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh, APC_DMA_CSR);
DPRINTF(("halt_output: csr=%s\n",
bitmask_snprintf(csr, APC_BITS, bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("halt_output: csr=%s\n", bits));
csr &= ~APC_INTR_MASK; /* do not clear interrupts accidentally */
csr |= APC_PPAUSE; /* pause playback (let current complete) */
@ -345,9 +351,10 @@ cs4231_sbus_halt_output(void *addr)
do {
csr = bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh,
APC_DMA_CSR);
DPRINTF(("halt_output: csr=%s\n",
bitmask_snprintf(csr, APC_BITS,
bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("halt_output: csr=%s\n", bits));
} while ((csr & APC_PM) == 0);
cfg = ad_read(&sc->sc_ad1848, SP_INTERFACE_CONFIG);
@ -383,8 +390,10 @@ cs4231_sbus_trigger_input(void *addr, void *start, void *end, int blksize,
return ret;
csr = bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh, APC_DMA_CSR);
DPRINTF(("trigger_input: csr=%s\n",
bitmask_snprintf(csr, APC_BITS, bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("trigger_input: csr=%s\n", bits));
DPRINTF(("trigger_input: was: %x %d, %x %d\n",
bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh, APC_DMA_CVA),
bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh, APC_DMA_CC),
@ -420,8 +429,10 @@ cs4231_sbus_trigger_input(void *addr, void *start, void *end, int blksize,
ad_write(&sc->sc_ad1848, SP_INTERFACE_CONFIG,
(cfg | CAPTURE_ENABLE));
} else {
DPRINTF(("trigger_input: already: csr=%s\n",
bitmask_snprintf(csr, APC_BITS, bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("trigger_input: already: csr=%s\n", bits));
}
/* supply next block if we can */
@ -457,8 +468,11 @@ cs4231_sbus_halt_input(void *addr)
sc->sc_capture.t_active = 0;
csr = bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh, APC_DMA_CSR);
DPRINTF(("halt_input: csr=%s\n",
bitmask_snprintf(csr, APC_BITS, bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("halt_input: csr=%s\n", bits));
csr &= ~APC_INTR_MASK; /* do not clear interrupts accidentally */
csr |= APC_CPAUSE;
@ -469,9 +483,12 @@ cs4231_sbus_halt_input(void *addr)
do {
csr = bus_space_read_4(sbsc->sc_bt, sbsc->sc_bh,
APC_DMA_CSR);
DPRINTF(("halt_input: csr=%s\n",
bitmask_snprintf(csr, APC_BITS,
bits, sizeof(bits))));
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), APC_BITS, csr);
#endif
DPRINTF(("halt_input: csr=%s\n", bits));
} while ((csr & APC_CM) == 0);
cfg = ad_read(&sc->sc_ad1848, SP_INTERFACE_CONFIG);
@ -512,15 +529,19 @@ cs4231_sbus_intr(void *arg)
#endif
status = ADREAD(&sc->sc_ad1848, AD1848_STATUS);
#ifdef AUDIO_DEBUG
snprintb(bits, sizeof(bits), AD_R2_BITS, status);
#endif
DPRINTF(("%s: status: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
bitmask_snprintf(status, AD_R2_BITS, bits, sizeof(bits))));
bits));
if (status & INTERRUPT_STATUS) {
#ifdef AUDIO_DEBUG
int reason;
reason = ad_read(&sc->sc_ad1848, CS_IRQ_STATUS);
snprintb(bits, sizeof(bits), CS_I24_BITS, reason);
DPRINTF(("%s: i24: %s\n", device_xname(&sc->sc_ad1848.sc_dev),
bitmask_snprintf(reason, CS_I24_BITS, bits, sizeof(bits))));
bits));
#endif
/* clear ad1848 interrupt */
ADWRITE(&sc->sc_ad1848, AD1848_STATUS, 0);
@ -570,8 +591,9 @@ cs4231_sbus_intr(void *arg)
/* got an interrupt we don't know how to handle */
if (!served) {
#ifdef DIAGNOSTIC
printf("%s: unhandled csr=%s\n", device_xname(&sc->sc_ad1848.sc_dev),
bitmask_snprintf(csr, APC_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), APC_BITS, csr);
printf("%s: unhandled csr=%s\n",
device_xname(&sc->sc_ad1848.sc_dev), bits);
#endif
/* evcnt? */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: qe.c,v 1.46 2008/11/07 00:20:12 dyoung Exp $ */
/* $NetBSD: qe.c,v 1.47 2008/12/16 22:35:35 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.46 2008/11/07 00:20:12 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: qe.c,v 1.47 2008/12/16 22:35:35 christos Exp $");
#define QEDEBUG
@ -610,8 +610,8 @@ qeintr(arg)
bus_space_tag_t t1 = sc->sc_bustag;
bus_space_handle_t mr = sc->sc_mr;
printf("qe%d: intr: qestat=%s\n", sc->sc_channel,
bitmask_snprintf(qestat, QE_CR_STAT_BITS, bits, sizeof(bits)));
snprintb(bits, sizeof(bits), QE_CR_STAT_BITS, qestat);
printf("qe%d: intr: qestat=%s\n", sc->sc_channel, bits);
printf("MACE registers:\n");
for (i = 0 ; i < 32; i++) {
@ -626,9 +626,8 @@ qeintr(arg)
#ifdef QEDEBUG
if (sc->sc_debug) {
char bits[64];
printf("qe%d: eint: qestat=%s\n", sc->sc_channel,
bitmask_snprintf(qestat, QE_CR_STAT_BITS, bits,
sizeof(bits)));
snprintb(bits, sizeof(bits), QE_CR_STAT_BITS, qestat);
printf("qe%d: eint: qestat=%s\n", sc->sc_channel, bits);
}
#endif
r |= qe_eint(sc, qestat);

View File

@ -1,4 +1,4 @@
/* $NetBSD: stp4020.c,v 1.55 2008/04/28 20:23:57 martin Exp $ */
/* $NetBSD: stp4020.c,v 1.56 2008/12/16 22:35:35 christos Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: stp4020.c,v 1.55 2008/04/28 20:23:57 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: stp4020.c,v 1.56 2008/12/16 22:35:35 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -716,8 +716,7 @@ stp4020_intr(arg)
#ifdef STP4020_DEBUG
if (stp4020_debug != 0) {
char bits[64];
bitmask_snprintf(v, STP4020_ISR0_IOBITS,
bits, sizeof(bits));
snprintb(bits, sizeof(bits), STP4020_ISR0_IOBITS, v);
printf("stp4020_statintr: ISR0=%s\n", bits);
}
#endif
@ -1046,8 +1045,9 @@ stp4020_chip_socket_enable(pch)
}
if (i <= 0) {
char bits[64];
bitmask_snprintf(stp4020_rd_sockctl(h, STP4020_ISR0_IDX),
STP4020_ISR0_IOBITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits),
STP4020_ISR0_IOBITS,
stp4020_rd_sockctl(h, STP4020_ISR0_IDX));
printf("stp4020_chip_socket_enable: not ready: status %s\n",
bits);
return;
@ -1188,20 +1188,20 @@ stp4020_dump_regs(h)
* Dump control and status registers.
*/
printf("socket[%d] registers:\n", h->sock);
bitmask_snprintf(stp4020_rd_sockctl(h, STP4020_ICR0_IDX),
STP4020_ICR0_BITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), STP4020_ICR0_BITS,
stp4020_rd_sockctl(h, STP4020_ICR0_IDX));
printf("\tICR0=%s\n", bits);
bitmask_snprintf(stp4020_rd_sockctl(h, STP4020_ICR1_IDX),
STP4020_ICR1_BITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), STP4020_ICR1_BITS,
stp4020_rd_sockctl(h, STP4020_ICR1_IDX));
printf("\tICR1=%s\n", bits);
bitmask_snprintf(stp4020_rd_sockctl(h, STP4020_ISR0_IDX),
STP4020_ISR0_IOBITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), STP4020_ISR0_IOBITS,
stp4020_rd_sockctl(h, STP4020_ISR0_IDX));
printf("\tISR0=%s\n", bits);
bitmask_snprintf(stp4020_rd_sockctl(h, STP4020_ISR1_IDX),
STP4020_ISR1_BITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), STP4020_ISR1_BITS,
stp4020_rd_sockctl(h, STP4020_ISR1_IDX));
printf("\tISR1=%s\n", bits);
}
#endif /* STP4020_DEBUG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ehci.c,v 1.155 2008/11/28 17:18:21 jmorse Exp $ */
/* $NetBSD: ehci.c,v 1.156 2008/12/16 22:35:35 christos Exp $ */
/*
* Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.155 2008/11/28 17:18:21 jmorse Exp $");
__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.156 2008/12/16 22:35:35 christos Exp $");
#include "ohci.h"
#include "uhci.h"
@ -85,7 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.155 2008/11/28 17:18:21 jmorse Exp $");
#define DPRINTFN(n,x) do { if (ehcidebug>(n)) printf x; } while (0)
int ehcidebug = 0;
#ifndef __NetBSD__
#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f))
#define snprintb((q), (f), "%b", q,f,b,l) snprintf((b), (l))
#endif
#else
#define DPRINTF(x)
@ -966,9 +966,9 @@ ehci_idone(struct ehci_xfer *ex)
#ifdef EHCI_DEBUG
char sbuf[128];
bitmask_snprintf((u_int32_t)status,
"\20\7HALTED\6BUFERR\5BABBLE\4XACTERR"
"\3MISSED\1PINGSTATE", sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\20\7HALTED\6BUFERR\5BABBLE\4XACTERR\3MISSED\1PINGSTATE",
(u_int32_t)status);
DPRINTFN(2, ("ehci_idone: error, addr=%d, endpt=0x%02x, "
"status 0x%s\n",
@ -1437,9 +1437,9 @@ ehci_dump_qtd(ehci_qtd_t *qtd)
printf(" altnext="); ehci_dump_link(qtd->qtd_altnext, 0);
printf("\n");
s = le32toh(qtd->qtd_status);
bitmask_snprintf(EHCI_QTD_GET_STATUS(s),
"\20\10ACTIVE\7HALTED\6BUFERR\5BABBLE\4XACTERR"
"\3MISSED\2SPLIT\1PING", sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\20\10ACTIVE\7HALTED\6BUFERR\5BABBLE\4XACTERR"
"\3MISSED\2SPLIT\1PING", EHCI_QTD_GET_STATUS(s));
printf(" status=0x%08x: toggle=%d bytes=0x%x ioc=%d c_page=0x%x\n",
s, EHCI_QTD_GET_TOGGLE(s), EHCI_QTD_GET_BYTES(s),
EHCI_QTD_GET_IOC(s), EHCI_QTD_GET_C_PAGE(s));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ohci.c,v 1.196 2008/08/13 09:43:56 drochner Exp $ */
/* $NetBSD: ohci.c,v 1.197 2008/12/16 22:35:36 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.196 2008/08/13 09:43:56 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.197 2008/12/16 22:35:36 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -93,7 +93,7 @@ struct cfdriver ohci_cd = {
#define DPRINTFN(n,x) if (ohcidebug>(n)) logprintf x
int ohcidebug = 0;
#ifndef __NetBSD__
#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f))
#define snprintb((q), (f), "%b", q,f,b,l) snprintf((b), (l))
#endif
#else
#define DPRINTF(x)
@ -2018,9 +2018,9 @@ ohci_dump_td(ohci_softc_t *sc, ohci_soft_td_t *std)
{
char sbuf[128];
bitmask_snprintf((u_int32_t)O32TOH(std->td.td_flags),
"\20\23R\24OUT\25IN\31TOG1\32SETTOGGLE",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\20\23R\24OUT\25IN\31TOG1\32SETTOGGLE",
(u_int32_t)O32TOH(std->td.td_flags));
usb_syncmem(&std->dma, std->offs, sizeof(std->td),
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
@ -2072,11 +2072,11 @@ ohci_dump_ed(ohci_softc_t *sc, ohci_soft_ed_t *sed)
usb_syncmem(&sed->dma, sed->offs, sizeof(sed->ed),
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
bitmask_snprintf((u_int32_t)O32TOH(sed->ed.ed_flags),
"\20\14OUT\15IN\16LOWSPEED\17SKIP\20ISO",
sbuf, sizeof(sbuf));
bitmask_snprintf((u_int32_t)O32TOH(sed->ed.ed_headp),
"\20\1HALT\2CARRY", sbuf2, sizeof(sbuf2));
snprintb(sbuf, sizeof(sbuf),
"\20\14OUT\15IN\16LOWSPEED\17SKIP\20ISO",
(u_int32_t)O32TOH(sed->ed.ed_flags));
snprintb(sbuf2, sizeof(sbuf2), "\20\1HALT\2CARRY",
(u_int32_t)O32TOH(sed->ed.ed_headp));
printf("ED(%p) at 0x%08lx: addr=%d endpt=%d maxp=%d flags=%s\ntailp=0x%08lx "
"headflags=%s headp=0x%08lx nexted=0x%08lx\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhci.c,v 1.223 2008/06/28 17:42:53 bouyer Exp $ */
/* $NetBSD: uhci.c,v 1.224 2008/12/16 22:35:36 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
/*
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.223 2008/06/28 17:42:53 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.224 2008/12/16 22:35:36 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -99,7 +99,7 @@ uhci_softc_t *thesc;
int uhcidebug = 0;
int uhcinoloop = 0;
#ifndef __NetBSD__
#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f))
#define snprintb((q), (f), "%b", q,f,b,l) snprintf((b), (l))
#endif
#else
#define DPRINTF(x)
@ -847,12 +847,12 @@ uhci_dump_td(uhci_soft_td_t *p)
(long)le32toh(p->td.td_token),
(long)le32toh(p->td.td_buffer)));
bitmask_snprintf((u_int32_t)le32toh(p->td.td_link), "\20\1T\2Q\3VF",
sbuf, sizeof(sbuf));
bitmask_snprintf((u_int32_t)le32toh(p->td.td_status),
"\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
"STALLED\30ACTIVE\31IOC\32ISO\33LS\36SPD",
sbuf2, sizeof(sbuf2));
snprintb(sbuf, sizeof(sbuf), "\20\1T\2Q\3VF",
(u_int32_t)le32toh(p->td.td_link));
snprintb(sbuf2, sizeof(sbuf2),
"\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
"STALLED\30ACTIVE\31IOC\32ISO\33LS\36SPD",
(u_int32_t)le32toh(p->td.td_status));
DPRINTFN(-1,(" %s %s,errcnt=%d,actlen=%d pid=%02x,addr=%d,endpt=%d,"
"D=%d,maxlen=%d\n", sbuf, sbuf2,
@ -1612,10 +1612,9 @@ uhci_idone(uhci_intr_info_t *ii)
#ifdef UHCI_DEBUG
char sbuf[128];
bitmask_snprintf((u_int32_t)status,
"\20\22BITSTUFF\23CRCTO\24NAK\25"
"BABBLE\26DBUFFER\27STALLED\30ACTIVE",
sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf),
"\20\22BITSTUFF\23CRCTO\24NAK\25"
"BABBLE\26DBUFFER\27STALLED\30ACTIVE",(u_int32_t)status);
DPRINTFN((status == UHCI_TD_STALLED)*10,
("uhci_idone: error, addr=%d, endpt=0x%02x, "

View File

@ -1,4 +1,4 @@
/* $NetBSD: si.c,v 1.21 2008/04/28 20:24:01 martin Exp $ */
/* $NetBSD: si.c,v 1.22 2008/12/16 22:35:36 christos Exp $ */
/*-
* Copyright (c) 1996,2000 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.21 2008/04/28 20:24:01 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.22 2008/12/16 22:35:36 christos Exp $");
#include "opt_ddb.h"
@ -332,9 +332,8 @@ si_attach(device_t parent, device_t self, void *aux)
}
if (sc->sc_options) {
aprint_normal_dev(self, "options=%s\n",
bitmask_snprintf(sc->sc_options, SI_OPTIONS_BITS,
bits, sizeof(bits)));
snprintb(bits, sizeof(bits), sc->sc_options, SI_OPTIONS_BITS);
aprint_normal_dev(self, "options=%s\n", bits);
}
ncr_sc->sc_channel.chan_id = 7;

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_subr.c,v 1.79 2008/12/16 16:27:05 reinoud Exp $ */
/* $NetBSD: udf_subr.c,v 1.80 2008/12/16 22:35:36 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.79 2008/12/16 16:27:05 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.80 2008/12/16 22:35:36 christos Exp $");
#endif /* not lint */
@ -138,8 +138,7 @@ udf_dump_discinfo(struct udf_mount *ump)
printf("\tfst on last ses %d\n", di->first_track_last_session);
printf("\tlst on last ses %d\n", di->last_track_last_session);
printf("\tlink block penalty %d\n", di->link_block_penalty);
bitmask_snprintf(di->disc_flags, MMC_DFLAGS_FLAGBITS, bits,
sizeof(bits));
snprintb(bits, sizeof(bits), MMC_DFLAGS_FLAGBITS, di->disc_flags);
printf("\tdisc flags %s\n", bits);
printf("\tdisc id %x\n", di->disc_id);
printf("\tdisc barcode %"PRIx64"\n", di->disc_barcode);
@ -147,9 +146,9 @@ udf_dump_discinfo(struct udf_mount *ump)
printf("\tnum sessions %d\n", di->num_sessions);
printf("\tnum tracks %d\n", di->num_tracks);
bitmask_snprintf(di->mmc_cur, MMC_CAP_FLAGBITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), MMC_CAP_FLAGBITS, di->mmc_cur);
printf("\tcapabilities cur %s\n", bits);
bitmask_snprintf(di->mmc_cap, MMC_CAP_FLAGBITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), MMC_CAP_FLAGBITS, di->mmc_cap);
printf("\tcapabilities cap %s\n", bits);
}
#else
@ -2004,11 +2003,11 @@ udf_process_vds(struct udf_mount *ump) {
DPRINTF(VOLUMES, ("\tfids partition %d\n", ump->fids_part));
DPRINTF(VOLUMES, ("\t\talloc scheme %d\n", ump->vtop_alloc[ump->fids_part]));
bitmask_snprintf(ump->lvopen, UDFLOGVOL_BITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), UDFLOGVOL_BITS, ump->lvopen);
DPRINTF(VOLUMES, ("\tactions on logvol open %s\n", bits));
bitmask_snprintf(ump->lvclose, UDFLOGVOL_BITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), UDFLOGVOL_BITS, ump->lvclose);
DPRINTF(VOLUMES, ("\tactions on logvol close %s\n", bits));
bitmask_snprintf(ump->lvreadwrite, UDFONERROR_BITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), UDFONERROR_BITS, ump->lvreadwrite);
DPRINTF(VOLUMES, ("\tactions on logvol errors %s\n", bits));
DPRINTF(VOLUMES, ("\tselected sheduler `%s`\n",
@ -5621,7 +5620,7 @@ udf_update(struct vnode *vp, struct timespec *acc,
char bits[128];
DPRINTF(CALL, ("udf_update(node, %p, %p, %p, %d)\n", acc, mod, birth,
updflags));
bitmask_snprintf(udf_node->i_flags, IN_FLAGBITS, bits, sizeof(bits));
snprintb(bits, sizeof(bits), IN_FLAGBITS, udf_node->i_flags);
DPRINTF(CALL, ("\tnode flags %s\n", bits));
DPRINTF(CALL, ("\t\tmnt_async = %d\n", mnt_async));
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_prf2.c,v 1.3 2008/09/23 22:20:24 pooka Exp $ */
/* $NetBSD: subr_prf2.c,v 1.4 2008/12/16 22:35:37 christos Exp $ */
/*-
* Copyright (c) 1986, 1988, 1991, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_prf2.c,v 1.3 2008/09/23 22:20:24 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_prf2.c,v 1.4 2008/12/16 22:35:37 christos Exp $");
#include <sys/param.h>
#include <sys/kprintf.h>
@ -64,145 +64,3 @@ tablefull(const char *tab, const char *hint)
else
log(LOG_ERR, "%s: table is full\n", tab);
}
/*
* bitmask_snprintf: print an interpreted bitmask to a buffer
*
* => returns pointer to the buffer
*/
char *
bitmask_snprintf(u_quad_t val, const char *p, char *bf, size_t buflen)
{
char *bp, *q;
size_t left;
const char *sbase;
char snbuf[KPRINTF_BUFSIZE];
int base, bit, ch, len, sep;
u_quad_t field;
bp = bf;
memset(bf, 0, buflen);
/*
* Always leave room for the trailing NULL.
*/
left = buflen - 1;
/*
* Print the value into the buffer. Abort if there's not
* enough room.
*/
if (buflen < KPRINTF_BUFSIZE)
return (bf);
ch = *p++;
base = ch != '\177' ? ch : *p++;
sbase = base == 8 ? "%qo" : base == 10 ? "%qd" : base == 16 ? "%qx" : 0;
if (sbase == 0)
return (bf); /* punt if not oct, dec, or hex */
snprintf(snbuf, sizeof(snbuf), sbase, val);
for (q = snbuf ; *q ; q++) {
*bp++ = *q;
left--;
}
/*
* If the value we printed was 0 and we're using the old-style format,
* or if we don't have room for "<x>", we're done.
*/
if (((val == 0) && (ch != '\177')) || left < 3)
return (bf);
#define PUTBYTE(b, c, l) do { \
*(b)++ = (c); \
if (--(l) == 0) \
goto out; \
} while (/*CONSTCOND*/ 0)
#define PUTSTR(b, p, l) do { \
int c; \
while ((c = *(p)++) != 0) { \
*(b)++ = c; \
if (--(l) == 0) \
goto out; \
} \
} while (/*CONSTCOND*/ 0)
/*
* Chris Torek's new bitmask format is identified by a leading \177
*/
sep = '<';
if (ch != '\177') {
/* old (standard) format. */
for (;(bit = *p++) != 0;) {
if (val & (1 << (bit - 1))) {
PUTBYTE(bp, sep, left);
for (; (ch = *p) > ' '; ++p) {
PUTBYTE(bp, ch, left);
}
sep = ',';
} else
for (; *p > ' '; ++p)
continue;
}
} else {
/* new quad-capable format; also does fields. */
field = val;
while ((ch = *p++) != '\0') {
bit = *p++; /* now 0-origin */
switch (ch) {
case 'b':
if (((u_int)(val >> bit) & 1) == 0)
goto skip;
PUTBYTE(bp, sep, left);
PUTSTR(bp, p, left);
sep = ',';
break;
case 'f':
case 'F':
len = *p++; /* field length */
field = (val >> bit) & ((1ULL << len) - 1);
if (ch == 'F') /* just extract */
break;
PUTBYTE(bp, sep, left);
sep = ',';
PUTSTR(bp, p, left);
PUTBYTE(bp, '=', left);
sprintf(snbuf, sbase, field);
q = snbuf; PUTSTR(bp, q, left);
break;
case '=':
case ':':
/*
* Here "bit" is actually a value instead,
* to be compared against the last field.
* This only works for values in [0..255],
* of course.
*/
if ((int)field != bit)
goto skip;
if (ch == '=')
PUTBYTE(bp, '=', left);
else {
PUTBYTE(bp, sep, left);
sep = ',';
}
PUTSTR(bp, p, left);
break;
default:
skip:
while (*p++ != '\0')
continue;
break;
}
}
}
if (sep != '<')
PUTBYTE(bp, '>', left);
out:
return (bf);
#undef PUTBYTE
#undef PUTSTR
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_mbuf.c,v 1.129 2008/12/07 20:58:46 pooka Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.130 2008/12/16 22:35:37 christos Exp $ */
/*-
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.129 2008/12/07 20:58:46 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.130 2008/12/16 22:35:37 christos Exp $");
#include "opt_mbuftrace.h"
#include "opt_ddb.h"
@ -1606,7 +1606,7 @@ m_print(const struct mbuf *m, const char *modif, void (*pr)(const char *, ...))
nextchain:
(*pr)("MBUF %p\n", m);
bitmask_snprintf((u_int)m->m_flags, M_FLAGS_BITS, buf, sizeof(buf));
snprintb(buf, sizeof(buf), M_FLAGS_BITS, (u_int)m->m_flags);
(*pr)(" data=%p, len=%d, type=%d, flags=0x%s\n",
m->m_data, m->m_len, m->m_type, buf);
(*pr)(" owner=%p, next=%p, nextpkt=%p\n", m->m_owner, m->m_next,
@ -1615,8 +1615,7 @@ nextchain:
(int)M_LEADINGSPACE(m), (int)M_TRAILINGSPACE(m),
(int)M_READONLY(m));
if ((m->m_flags & M_PKTHDR) != 0) {
bitmask_snprintf(m->m_pkthdr.csum_flags, M_CSUM_BITS, buf,
sizeof(buf));
snprintb(buf, sizeof(buf), M_CSUM_BITS, m->m_pkthdr.csum_flags);
(*pr)(" pktlen=%d, rcvif=%p, csum_flags=0x%s, csum_data=0x%"
PRIx32 ", segsz=%u\n",
m->m_pkthdr.len, m->m_pkthdr.rcvif,

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_subr.c,v 1.360 2008/12/14 11:15:59 ad Exp $ */
/* $NetBSD: vfs_subr.c,v 1.361 2008/12/16 22:35:37 christos Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.360 2008/12/14 11:15:59 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.361 2008/12/16 22:35:37 christos Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@ -2492,7 +2492,7 @@ vprint(const char *label, struct vnode *vp)
vl = (vp->v_vnlock != NULL ? vp->v_vnlock : &vp->v_lock);
flag = vp->v_iflag | vp->v_vflag | vp->v_uflag;
bitmask_snprintf(flag, vnode_flagbits, bf, sizeof(bf));
snprintb(bf, sizeof(bf), vnode_flagbits, flag);
if (label != NULL)
printf("%s: ", label);
@ -3053,8 +3053,8 @@ vfs_buf_print(struct buf *bp, int full, void (*pr)(const char *, ...))
PRIx64 " dev 0x%x\n",
bp->b_vp, bp->b_lblkno, bp->b_blkno, bp->b_rawblkno, bp->b_dev);
bitmask_snprintf(bp->b_flags | bp->b_oflags | bp->b_cflags,
buf_flagbits, bf, sizeof(bf));
snprintb(bf, sizeof(bf),
buf_flagbits, bp->b_flags | bp->b_oflags | bp->b_cflags);
(*pr)(" error %d flags 0x%s\n", bp->b_error, bf);
(*pr)(" bufsize 0x%lx bcount 0x%lx resid 0x%lx\n",
@ -3071,8 +3071,8 @@ vfs_vnode_print(struct vnode *vp, int full, void (*pr)(const char *, ...))
char bf[256];
uvm_object_printit(&vp->v_uobj, full, pr);
bitmask_snprintf(vp->v_iflag | vp->v_vflag | vp->v_uflag,
vnode_flagbits, bf, sizeof(bf));
snprintb(bf, sizeof(bf),
vnode_flagbits, vp->v_iflag | vp->v_vflag | vp->v_uflag);
(*pr)("\nVNODE flags %s\n", bf);
(*pr)("mp %p numoutput %d size 0x%llx writesize 0x%llx\n",
vp->v_mount, vp->v_numoutput, vp->v_size, vp->v_writesize);
@ -3115,10 +3115,10 @@ vfs_mount_print(struct mount *mp, int full, void (*pr)(const char *, ...))
(*pr)("fs_bshift %d dev_bshift = %d\n",
mp->mnt_fs_bshift,mp->mnt_dev_bshift);
bitmask_snprintf(mp->mnt_flag, __MNT_FLAG_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), __MNT_FLAG_BITS, mp->mnt_flag);
(*pr)("flag = %s\n", sbuf);
bitmask_snprintf(mp->mnt_iflag, __IMNT_FLAG_BITS, sbuf, sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), __IMNT_FLAG_BITS, mp->mnt_iflag);
(*pr)("iflag = %s\n", sbuf);
(*pr)("refcnt = %d unmounting @ %p updating @ %p\n", mp->mnt_refcnt,
@ -3146,8 +3146,8 @@ vfs_mount_print(struct mount *mp, int full, void (*pr)(const char *, ...))
(*pr)("\towner = %"PRIu32"\n",mp->mnt_stat.f_owner);
(*pr)("\tnamemax = %lu\n",mp->mnt_stat.f_namemax);
bitmask_snprintf(mp->mnt_stat.f_flag, __MNT_FLAG_BITS, sbuf,
sizeof(sbuf));
snprintb(sbuf, sizeof(sbuf), __MNT_FLAG_BITS, mp->mnt_stat.f_flag);
(*pr)("\tflag = %s\n",sbuf);
(*pr)("\tsyncwrites = %" PRIu64 "\n",mp->mnt_stat.f_syncwrites);
(*pr)("\tasyncwrites = %" PRIu64 "\n",mp->mnt_stat.f_asyncwrites);

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.92 2008/11/20 23:50:08 matt Exp $
# $NetBSD: Makefile,v 1.93 2008/12/16 22:35:38 christos Exp $
LIB= kern
NOPIC= # defined
@ -26,6 +26,7 @@ M= ${KERNDIR}/arch/${ARCHSUBDIR}
CPPFLAGS= -I$M ${KERNCPPFLAGS} ${KERNMISCCPPFLAGS}
.include "${.PARSEDIR}/../../../common/lib/libc/Makefile.inc"
.include "${.PARSEDIR}/../../../common/lib/libutil/Makefile.inc"
.include "${.PARSEDIR}/../../../common/lib/libprop/Makefile.inc"
CPPFLAGS+= -I${KERNDIR}/../../../common/include

View File

@ -1,4 +1,4 @@
/* $NetBSD: libkern.h,v 1.84 2008/11/16 16:15:58 ad Exp $ */
/* $NetBSD: libkern.h,v 1.85 2008/12/16 22:35:38 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -340,6 +340,7 @@ u_long strtoul __P((const char *, char **, int));
long long strtoll __P((const char *, char **, int));
unsigned long long strtoull __P((const char *, char **, int));
uintmax_t strtoumax __P((const char *, char **, int));
int snprintb __P((char *, size_t, const char *, uint64_t));
int kheapsort(void *, size_t, size_t, int (*)(const void *, const void *),
void *);
#endif /* !_LIB_LIBKERN_LIBKERN_H_ */

Some files were not shown because too many files have changed in this diff Show More