Page MenuHomeFreeBSD

Introduce kern_mmap_req().
Needs ReviewPublic

Authored by brooks on Jan 14 2020, 5:19 AM.

Details

Reviewers
kevans
jhb
kib
Summary

This presents an extensible interface to the generic mmap(2)
implementation via a struct pointer intended to use a designated
initializer or compount literal. We take advantage of the mandatory
zeroing of fields not listed in the initializer.

Remove kern_mmap_fpcheck() and use kern_mmap_req().

The motivation for this change is a desire to keep the core
implementation from growing an ever-increasing number of arguments that
must be specified in the correct order for the lowest-level
implementations. In CheriBSD we have already added two more arguments.

Obtained from: CheriBSD

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 28649
Build 26675: arc lint + arc unit

Event Timeline

brooks created this revision.Jan 14 2020, 5:19 AM
brooks edited the summary of this revision. (Show Details)Jan 14 2020, 5:21 AM

Compiles, but needs testing.

brooks added inline comments.Jan 14 2020, 5:29 AM
sys/compat/linux/linux_mmap.c
197

We could alternatively do the declaration above and assign with a compound literal here. Style(9) doesn't really have an opinion.

I've done limited testing (booted an amd64) system with this patch. I chose to remove kern_mmap_fpcheck entirely, but could restore it if that feels like a cleaner option.

I've done limited testing (booted an amd64) system with this patch. I chose to remove kern_mmap_fpcheck entirely, but could restore it if that feels like a cleaner option.

+1 for removing it completely; it's new, so there's not much sense in keeping it around when we have a better alternative. We'll call it a short-lived mistake. =-)

brooks edited the summary of this revision. (Show Details)Thu, Feb 20, 6:38 AM
brooks added a reviewer: kib.