Page MenuHomeFreeBSD

Create deprecation management functions.
ClosedPublic

Authored by imp on Jan 10 2018, 12:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 13 2024, 3:36 AM
Unknown Object (File)
Dec 10 2023, 5:45 PM
Unknown Object (File)
Nov 30 2023, 9:10 PM
Unknown Object (File)
Nov 18 2023, 4:21 AM
Unknown Object (File)
Nov 18 2023, 3:27 AM
Unknown Object (File)
Nov 18 2023, 3:14 AM
Unknown Object (File)
Nov 18 2023, 3:04 AM
Unknown Object (File)
Nov 9 2023, 3:10 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

sys/kern/subr_bus.c
5608 ↗(On Diff #37704)

"Manage deprecated / obsolete code."

5632 ↗(On Diff #37704)

Use P_OSREL_MAJOR() rather than doing it by hand.

5636 ↗(On Diff #37704)

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

sys/sys/systm.h
468 ↗(On Diff #37704)

"API for managing deprecated / obsolete code."

sys/kern/subr_bus.c
5632 ↗(On Diff #37704)

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.