HomeFreeBSD

Allow dcons(4) to be unloaded when loaded as a module.

Description

Allow dcons(4) to be unloaded when loaded as a module.

When the module is unloaded, the tty devices are destroyed. That requires
implementing the tsw_free callback to avoid a panic. This driver requires
no particular cleanup to be done from the callback, but the module itself
must remain in memory until the deferred tsw_free callbacks are invoked.
These changes implement that by incrementing a reference count variable in
the detach routine, and decrementing it in the tsw_free callback. The
MOD_UNLOAD event handler doesn't return until the count drops to zero.

PR: 237758

Details

Provenance
ianAuthored on May 10 2019, 2:30 AM
Parents
rGafb7737237bc: iflib: use default ntxd and nrxd when user value is not power of 2
Branches
Unknown
Tags
Unknown

Event Timeline