Page MenuHomeFreeBSD

Make <vm/vm_extern.h> more self-contained.
ClosedPublic

Authored by jhb on Jan 27 2022, 9:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 9:29 PM
Unknown Object (File)
Feb 13 2024, 4:24 AM
Unknown Object (File)
Dec 12 2023, 2:44 AM
Unknown Object (File)
Nov 29 2023, 3:47 AM
Unknown Object (File)
Sep 10 2023, 10:14 AM
Unknown Object (File)
Aug 6 2023, 10:31 AM
Unknown Object (File)
Jul 5 2023, 6:28 AM
Unknown Object (File)
Jul 2 2023, 3:09 PM
Subscribers

Details

Summary

Add a nested include of <sys/systm.h> for recently added assertions.
Without this, existing code (such as in drm-kmod) needs to be patched
to add the newly required header.

While here, rewrite the assertions using KASSERT().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jan 27 2022, 9:55 PM
jhb created this revision.
dougm added reviewers: kib, alc.

I have no objections, but it was kib, I think, who asked for the invariants in the first place, so get his ok too.

This revision is now accepted and ready to land.Jan 27 2022, 10:26 PM

sys/systm.h is of course very heavy weight, perhaps too heavy.

sys/vm/vm_extern.h
157–158

), (

modulo kib's formatting nit.

Hmm. At first this didn't make sense to me. The "assertions" were written this way so that systm.h wouldn't have to be included, but the prototype for panic() is provided by systm.h. So, this code might as well have used KASSERT all along.

jhb marked an inline comment as done.Jan 28 2022, 9:15 PM
In D34070#770387, @kib wrote:

sys/systm.h is of course very heavy weight, perhaps too heavy.

It is, but it is already a nested include in <vm/vm_page.h>.

I would not mind having a <sys/_assert.h> or the like that contained the bits need for KASSERT and friends (MPASS*, panic() prototype, etc.).

This revision was automatically updated to reflect the committed changes.