Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [thorpej-cfargs2] src/sys



Module Name:    src
Committed By:   thorpej
Date:           Tue Aug  3 15:00:15 UTC 2021

Modified Files:
        src/sys/kern [thorpej-cfargs2]: subr_autoconf.c
        src/sys/sys [thorpej-cfargs2]: device.h

Log Message:
Address concerns about limited compile-time type checking with the
tag-value mechanism of specifying arguments to config_search(),
config_found(), and config_attach() by replacing the tag-value scheme
with a "struct cfargs", a pointer to which is passed to the aforementioned
functions instead.

The structure has a version field to allow for future ABI versioning
flexibility.  The external structure is canononicalized internally
before use.

To ease the initialization of this structure, use a variadic preprocessor
macro, CFARGS(), to construct an anonymous "struct cfargs" inline, the
address of which is passed to the target function.  A CFARGS_NONE macro
provides a symbolic stand-in for when the caller doesn't want to pass
arguments (currently expands to NULL and is handled during canonicalization).


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.288.2.1 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.171 -r1.171.2.1 src/sys/sys/device.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index