Page MenuHomeFreeBSD

Create deprecation management functions.
ClosedPublic

Authored by imp on Jan 10 2018, 12:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 1:02 PM
Unknown Object (File)
Fri, Nov 22, 5:36 PM
Unknown Object (File)
Tue, Nov 19, 6:59 AM
Unknown Object (File)
Tue, Nov 19, 12:58 AM
Unknown Object (File)
Mon, Nov 18, 1:44 AM
Unknown Object (File)
Mon, Nov 18, 12:50 AM
Unknown Object (File)
Sun, Nov 17, 11:15 PM
Unknown Object (File)
Sun, Nov 17, 10:36 PM
Subscribers

Details

Summary

gone_in(majar, msg); If we're running in FreeBSD major, tell

			the user this code may be deleted soon.
			If we're running in FreeBSD major - 1,
			the the user is deprecated and will
			be gone in major.
			Otherwise say nothing.

gone_in_dev(dev, major, msg) Just like gone_in, except use device_printf.

New tunable / sysctl debug.oboslete_panic: 0 - don't panic,
1 - panic in major or newer , 2 - panic in major - 1 or newer
default: 0

if NO_OBSOLETE_CODE is defined, then both of these turn into compile
time errors when building for major. Add options NO_OBSOLETE_CODE to
kernel build system.

This lets us tag code that's going away so users know it will be gone,
as well as automatically manage things.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14234
Build 14397: arc lint + arc unit

Event Timeline

And of course the same comments for _gone_in_dev() as in _gone_in().

sys/kern/subr_bus.c
5608

"Manage deprecated / obsolete code."

5632

Use P_OSREL_MAJOR() rather than doing it by hand.

5636

The "running" seems... not right. "Obsolete code; will be removed soon" sounds better to me.

sys/sys/systm.h
468

"API for managing deprecated / obsolete code."

sys/kern/subr_bus.c
5632

For that matter, shouldn't m be a static variable (or a #define) outside of the scope of either of these functions, since it's a constant value used by both of them?

This revision was not accepted when it landed; it landed in state Needs Review.Jan 29 2018, 12:15 AM
This revision was automatically updated to reflect the committed changes.