Subject: Re: NetBSD changes as of 1998/09/07 00:00 UTC
To: None <tech-toolchain@netbsd.org>
From: Eduardo E. Horvath <eeh@one-o.com>
List: tech-toolchain
Date: 09/06/1998 22:07:37
On Sun, 6 Sep 1998, Todd Vierling wrote:

> On Sun, 6 Sep 1998, NetBSD source changes wrote:
> 
> : src/sys/arch/sparc/include/ctlreg.h
> :     (pk - Sun Sep  6 21:38:36 UTC 1998)
> :     Use the new "%b" format.
> 
> Can someone explain to me what the old %b format was, and what the new one
> is?  I'd hazard a guess that the kprintf-format-warning code in both gcc and
> egcs may need updating.

The new %b format does pretty much what the old one does: given a flag and
a really strange format string describing the fields in the flag it will
print out which of the fields are set in that flag.

To quote from subr_prf.c:

 *	kprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE\n");
 *
 * would produce output:
 *
 *	reg=3<BITTWO,BITONE>
 *
 
The new format has some extra bells and whistles, handles multibit
subfields, handles quat_t where I beleive the old one was limited to
32-bits, and is easier to code.

Unfortunately the new code has not been plugged into kprintf() so if you
try to use it you get all sorts of garbage apear as your machine tries to
print out all of main memory.

=========================================================================
Eduardo Horvath				eeh@one-o.com
	"I need to find a pithy new quote." -- me