Suppress D_NEEDGIANT warnings for some drivers
During boot we warn that the kbd and openfirm drivers are Giant-locked and may be deleted. Generally, the warning helps signal that certain old drivers are not being maintained and are subject to removal, but this doesn't really apply to certain drivers which are harder to detangle from Giant. Add a flag, D_GIANTOK, that devices can specify to suppress the misleading warning. Use it in the kbd and openfirm drivers. Reviewed by: imp, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30649
This commit is contained in:
parent
62b8258a7e
commit
fbeb4ccac9
@ -453,7 +453,7 @@ static d_poll_t genkbdpoll;
|
||||
|
||||
static struct cdevsw kbd_cdevsw = {
|
||||
.d_version = D_VERSION,
|
||||
.d_flags = D_NEEDGIANT,
|
||||
.d_flags = D_NEEDGIANT | D_GIANTOK,
|
||||
.d_open = genkbdopen,
|
||||
.d_close = genkbdclose,
|
||||
.d_read = genkbdread,
|
||||
|
@ -66,7 +66,7 @@ static d_ioctl_t openfirm_ioctl;
|
||||
|
||||
static struct cdevsw openfirm_cdevsw = {
|
||||
.d_version = D_VERSION,
|
||||
.d_flags = D_NEEDGIANT,
|
||||
.d_flags = D_NEEDGIANT | D_GIANTOK,
|
||||
.d_ioctl = openfirm_ioctl,
|
||||
.d_name = "openfirm",
|
||||
};
|
||||
|
@ -665,7 +665,7 @@ prep_cdevsw(struct cdevsw *devsw, int flags)
|
||||
devsw->d_kqfilter = dead_kqfilter;
|
||||
}
|
||||
|
||||
if (devsw->d_flags & D_NEEDGIANT) {
|
||||
if ((devsw->d_flags & (D_NEEDGIANT | D_GIANTOK)) == D_NEEDGIANT) {
|
||||
printf("WARNING: Device \"%s\" is Giant locked and may be "
|
||||
"deleted before FreeBSD 14.0.\n",
|
||||
devsw->d_name == NULL ? "???" : devsw->d_name);
|
||||
|
@ -173,6 +173,7 @@ typedef int dumper_hdr_t(struct dumperinfo *di, struct kerneldumpheader *kdh,
|
||||
*/
|
||||
#define D_TRACKCLOSE 0x00080000 /* track all closes */
|
||||
#define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */
|
||||
#define D_GIANTOK 0x00200000 /* suppress warning about using Giant */
|
||||
#define D_NEEDGIANT 0x00400000 /* driver want Giant */
|
||||
#define D_NEEDMINOR 0x00800000 /* driver uses clone_create() */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user