NetBSD/sys/dev
pgoyette cb32a134a5 Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
  the kernel and in the structures used for exporting the history data
  to userland via sysctl(9).  This avoids problems on some architectures
  where passing a 64-bit (or larger) value to printf(3) can cause it to
  process the value as multiple arguments.  (This can be particularly
  problematic when printf()'s format string is not a literal, since in
  that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
  include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
  updated.  Each format specifier now includes an explicit length
  modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
  updated to replace uses of "%p" with "%#jx", and the pointer
  arguments are now cast to (uintptr_t) before being subsequently cast
  to (uintmax_t).  This is needed to avoid compiler warnings about
  casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
  "%c" format strings replaced with numeric formats; several instances
  of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
  history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
  the -u option does not exist (previously, this condition was silently
  ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
  data exported via sysctl(9) and exits if they do not match the values
  with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
  requirements imposed on the format strings, along with several other
  minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
    uint64_t) for the history arguments.  But that would require another
    "rototill" of all the users in the future when we add support for an
    architecture that supports a larger size.  Also, the printf(3) format
    specifiers for explicitly-sized values, such as "%"PRIu64, are much
    more verbose (and less aesthetically appealing, IMHO) than simply
    using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
    but it is possible that I've missed some of them.  I would be glad to
    update any stragglers that anyone identifies.
2017-10-28 00:37:11 +00:00
..
acpi If _ENABLED flag of ACPI_SRAT_TYPE_CPU_AFFINITY, ACPI_SRAT_TYPE_MEMORY_AFFINITY 2017-08-31 08:45:03 +00:00
adb Add us.dvorak keymap variant for ADB keyboards. Addresses PR 51255. 2016-06-20 00:05:58 +00:00
altmem Use C99-style initializers for struct dkdriver. 2015-04-26 15:15:19 +00:00
apm Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
arcbios
ata move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init() 2017-10-20 07:06:05 +00:00
bi Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input 2016-12-15 09:28:02 +00:00
bluetooth Remove references to BlueCore. 2017-09-03 23:11:19 +00:00
bus_dma
cadence Apply deferred if_start to more drivers 2017-05-23 02:19:14 +00:00
cardbus remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
clk Add support for multiple clock domains in clk API. 2017-04-16 12:28:21 +00:00
dec spelling (DEC called it "TURBOchannel") 2017-06-22 16:46:52 +00:00
dkwedge use arraycount. 2017-09-07 10:18:26 +00:00
dm more dependiences -> dependencies 2017-06-04 08:54:38 +00:00
dmover kill alloca in favor of ssp 2017-01-07 21:11:14 +00:00
drm remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
dtv remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
ebus Make it compilable with AUDIODEBUG 2017-05-02 08:07:37 +00:00
eisa Modularize the ld driver and all of its attachments. Ensure that all 2016-09-27 03:33:32 +00:00
fdt Add support for simple MMC power sequence provider bindings. 2017-10-22 13:56:49 +00:00
filemon Take a reference on the (activity log) file itself, and not on the 2016-01-11 01:37:36 +00:00
flash
gpib - Use aprint*() instead of printf() in xxx_attach(). 2016-07-14 04:00:45 +00:00
gpio Let the controller provide a default name for pins. This makes pins easier 2017-07-06 10:43:06 +00:00
hdaudio In rev 1.0a of the Intel High Definition Audio Spec: 2017-09-26 09:24:22 +00:00
hdmicec add makefile for installing hdmicecio.h 2015-08-02 21:22:34 +00:00
hil Remove auto-repeat key functions in WSKBD_RAW mode. 2017-04-08 17:04:56 +00:00
hpc Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
i2c AXP209 isn't an SMBus device, so don't use iic_smbus_* APIs. 2017-10-22 11:00:28 +00:00
i2o While ld(4) is MP safe, many backends are not. 2017-08-09 16:44:39 +00:00
ic Update the kernhist(9) kernel history code to address issues identified 2017-10-28 00:37:11 +00:00
ieee1394 memory leak, found by Mootja; it seems that we should check the return 2017-06-25 12:39:27 +00:00
if_ndis Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input 2016-12-15 09:28:02 +00:00
ir Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
isa Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
isapnp move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init() 2017-10-20 07:06:05 +00:00
iscsi Fix session cleanup. 2017-06-24 11:31:26 +00:00
marvell remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
mca - Use aprint*() more in xxx_attach(). 2016-07-14 10:19:05 +00:00
microcode acknowleg -> acknowledg, proceedure -> procedure. 2016-12-12 15:58:44 +00:00
mii Do not deref a NULL pointer if no current media has been selected. 2017-08-12 11:21:15 +00:00
mscp remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
mvme
nand Use ONFI_STATUS_WP instead of 0x80. 2016-10-04 14:47:18 +00:00
news
nor Size of erase block is 128 bytes when sector density (z) is zero. 2015-09-18 21:30:02 +00:00
ofisa move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init() 2017-10-20 07:06:05 +00:00
ofw Add of_match_compat_data. 2017-07-03 00:47:34 +00:00
onewire
pad The pad module will now compile with WARNS=5. 2017-07-30 00:50:52 +00:00
pci - Remove all half duplex setting. 2017-10-26 01:40:33 +00:00
pckbport Remove extra newline. 2017-08-16 21:18:58 +00:00
pcmcia If error occured in the attach function, free resources and return. 2017-10-23 09:24:34 +00:00
podulebus move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init() 2017-10-20 07:06:05 +00:00
ppbus spl leak, found by Mootja 2017-06-25 12:27:13 +00:00
pud Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of 2015-12-08 20:36:14 +00:00
putter Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
qbus Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
raidframe remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
rasops remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
rcons
sbus Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
scsipi Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
sdmmc - Get SDIO reset working (from OpenBSD). 2017-10-23 13:47:17 +00:00
smbus
spi Add support Microchip SST25VF016B. 2017-08-07 09:24:43 +00:00
splash Do not panic if the splash screen is bigger than the framebuffer 2016-04-25 22:26:50 +00:00
stbi PR/50686: David Binderman: fix memory leak 2016-01-21 17:17:53 +00:00
std
sun Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
sysmon Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
tc regen 2017-06-22 17:01:34 +00:00
tprof include "ioconf.h" to get the 'void <driver>attach(int count);' prototype. 2015-08-20 14:40:16 +00:00
usb Update the kernhist(9) kernel history code to address issues identified 2017-10-28 00:37:11 +00:00
videomode
vme More on PR 41200: headers that declare ioctls should include sys/ioccom.h. 2015-09-06 06:00:59 +00:00
wscons Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
wsfb remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
wsfont allow longer font names 2017-06-23 01:57:40 +00:00
xmi
auconv.c Allow maxused to be an odd number of bytes. This makes single byte 2017-10-02 07:06:15 +00:00
auconv.h Add a null_filter to help with the audio autoconfig of pmax. 2017-07-27 23:39:37 +00:00
audio_if.h
audio.c Independent blocksizes for virtual channels where a static blocksize is 2017-10-27 01:34:32 +00:00
audiobell.c Don't keep writing data if an error has occurred. 2017-07-01 05:32:24 +00:00
audiobelldata.h The audio bell is now in 16 bit slinear format. 2017-05-27 10:54:47 +00:00
audiobellvar.h restore audiobell api 2016-12-09 13:26:11 +00:00
audiovar.h Add latency sysctl to adjust hw blocksize and hence latency of the mixer. 2017-10-26 22:38:27 +00:00
aurateconv.c Fix typo in comment. 2017-08-07 13:30:51 +00:00
auvolconv.c Fix soft volume audio distortion. OK jmcneil@. 2016-02-26 13:08:28 +00:00
auvolconv.h
bio.c include "ioconf.h" to get the 'void <driver>attach(int count);' prototype. 2015-08-20 14:40:16 +00:00
biovar.h More on PR 41200: headers that declare ioctls should include sys/ioccom.h. 2015-09-06 06:00:59 +00:00
ccd.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
ccdvar.h do not expose kernel-internal structure definitions to userland. 2017-06-08 22:23:56 +00:00
cgd_crypto.c Replace numeric block sizes with symbolic names, 2017-01-02 14:28:29 +00:00
cgd_crypto.h Replace numeric block sizes with symbolic names, 2017-01-02 14:28:29 +00:00
cgd.c pass also DIOCGCACHE to underlying device, so that upper layers would be able 2017-02-27 21:25:45 +00:00
cgdvar.h More on PR 41200: headers that declare ioctls should include sys/ioccom.h. 2015-09-06 06:00:59 +00:00
clock_subr.c Fix leap year handling for years 2100 and greater. 2016-08-15 15:51:39 +00:00
clock_subr.h
clockctl.c - Return ENOTTY rather than EINVAL for invalid ioctl, suggested by 2016-11-21 03:53:59 +00:00
cninit.c
cons.c for some reason the previous commit causes ARCS firmware on sgimips64 to 2015-05-29 16:26:45 +00:00
cons.h
dev_verbose.c Avoid writing beyond the end of the buffer we were given. 2016-10-26 06:10:39 +00:00
dev_verbose.h remove extra semicolons. 2015-11-13 01:37:19 +00:00
devlist2h.awk Add verb to sentence. 2017-06-27 08:09:14 +00:00
DEVNAMES Add tcu (MI). OK skrll@ 2016-10-01 15:24:35 +00:00
dksubr.c Initialize error also in the case where len=0, which just succeeds. 2017-08-24 11:26:32 +00:00
dkvar.h do not attach nvme ld as randomness source - device is too fast, it overwhelms 2017-04-27 17:07:22 +00:00
files.audio Include auvolconv.o in the audio driver, even if there are currently no 2017-05-30 02:21:11 +00:00
files.dev Add DKWEDGE_METHOD_RDB option, which is Amiga Rigid Disk Block (RDB) 2017-02-26 11:56:49 +00:00
firmload.c PR 51184 David Binderman: simplify redundant conditional 2016-05-30 02:33:49 +00:00
firmload.h
fss.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
fssvar.h More on PR 41200: headers that declare ioctls should include sys/ioccom.h. 2015-09-06 06:00:59 +00:00
keylock.c
keylock.h
kloader.c Move declaration of avail_start, avail_end to <machine/kloader.h> 2015-06-11 08:14:38 +00:00
kloader.h
kttcp.c MFREE -> m_free 2016-10-02 14:16:02 +00:00
kttcpio.h
ld.c make the sc_discard interface for the ld backend asynchronous and 2017-08-20 15:58:43 +00:00
ldvar.h make the sc_discard interface for the ld backend asynchronous and 2017-08-20 15:58:43 +00:00
led.c Use unsigned char for ctype functions, suggested by christos 2017-07-08 19:25:37 +00:00
led.h Add a helper for exposing LED controls via sysctl. 2017-07-08 00:54:37 +00:00
lockstat.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
lockstat.h Fix non-cpu counter build. 2016-01-24 01:01:11 +00:00
Makefile move spkrio.h out of isa 2016-12-09 04:46:39 +00:00
md_root.c Put back MEMORY_DISK_IMAGE logic, but use generated opt_memory_root_image.h 2015-08-30 05:24:03 +00:00
md.c Don't mutex_exit() if we didn't mutex_enter(). 2016-07-27 05:14:40 +00:00
md.h
midi_if.h
midi.c Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
midictl.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
midictl.h
midisyn.c
midisynvar.h
midivar.h
mm.c /dev/mem cannot lseek over 0x80000000 on 32bit architectures. 2016-10-13 08:56:31 +00:00
mm.h Add mm_md_page_color hook and use to support better page coloring. 2016-07-11 16:13:28 +00:00
mulaw.c Better solution to mulaw/alaw conversion on big endian systems/sound 2017-06-26 12:17:09 +00:00
mulaw.h Use LINEARNTOMULAW for 8 bits as well. 2017-06-25 02:16:41 +00:00
nullcons_subr.c
radio_if.h
radio.c
rnd_private.h
rndpseudo.c include "ioconf.h" to get the 'void <driver>attach(int count);' prototype. 2015-08-20 14:40:16 +00:00
sequencer.c Use C99 initializer for filterops 2017-10-25 08:12:37 +00:00
sequencervar.h
spkr_audio.c Implement xxx_rescan() and xxx_childdet() functions; these will be 2017-06-11 21:54:22 +00:00
spkr.c On a forcefull detach wait for spkr to close as the detach has to 2017-07-01 23:27:17 +00:00
spkrio.h Add ioctls for setting and getting the beep volume. Currently only 2017-06-11 03:33:48 +00:00
spkrvar.h Implement xxx_rescan() and xxx_childdet() functions; these will be 2017-06-11 21:54:22 +00:00
veriexec.c Rename verified_exec.c -> veriexec.c. 2015-12-09 18:25:32 +00:00
video_if.h
video.c remove checks for failure after memory allocation calls that cannot fail: 2017-06-01 02:45:05 +00:00
vnd.c Appease toxic bullshit warning from gcc. 2017-07-28 16:30:41 +00:00
vndvar.h Tweak whitespace to make this definition more greppable. 2017-07-28 15:52:53 +00:00