import chris torek's vfprintf() from libc [renamed to kprintf and all
floating point stuff removed]. the new kprintf replaces the 3 different (and buggy) versions of printf that were in the kernel before (kprintf, sprintf, and db_printf), thus reducing duplicated code by 2/3's. this fixes (or adds) several printf formats. examples: %#x - previously only supported by db_printf [not printf/sprintf] %8.8s - printf would print "000chuck" for "chuck" before %5p - printf would print "0x 1" for value 1 before XXX: new kprintf still supports several non-standard '%' formats that are supposed to eventually be removed: %: - passes an additional format string and argument list recursively %b - used to decode error registers %r - int, but print in radix "db_radix" [DDB only] %z - 'signed hex' [DDB only] %n - unsigned int, but print in radix "db_radix" [DDB only] note that DDB's "%n" conflicts with standard "%n" which takes the number of characters written so far and stores it into the integer indicated by the "int *" pointer arg. yuck! while here, add comments for each function explaining what it is supposed to do.
This commit is contained in:
parent
23a59f497a
commit
94fa91f862
1376
sys/kern/subr_prf.c
1376
sys/kern/subr_prf.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue