Page MenuHomeFreeBSD

uio: Use switch statements when handling UIO_READ vs UIO_WRITE
ClosedPublic

Authored by jhb on May 9 2024, 6:04 PM.
Tags
None
Referenced Files
F172165218: D45142.id138309.diff
Wed, Sep 16, 1:43 PM
Unknown Object (File)
Sat, Sep 12, 12:29 AM
Unknown Object (File)
Fri, Sep 11, 9:13 AM
Unknown Object (File)
Fri, Sep 11, 9:13 AM
Unknown Object (File)
Fri, Sep 11, 5:25 AM
Unknown Object (File)
Wed, Sep 9, 1:42 PM
Unknown Object (File)
Sat, Aug 22, 8:12 AM
Unknown Object (File)
Aug 14 2026, 2:16 AM

Details

Summary

This is mostly to reduce the diff with CheriBSD which adds additional
constants to enum uio_rw, but also matches the normal style used for
uio_segflg.

Obtained from: CheriBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57643
Build 54531: arc lint + arc unit

Event Timeline

jhb requested review of this revision.May 9 2024, 6:04 PM
kib added inline comments.
sys/amd64/amd64/mem.c
123

Fix style?

sys/arm64/arm64/mem.c
91

same

This revision is now accepted and ready to land.May 9 2024, 8:02 PM
In D45142#1029592, @jhb wrote:

Drop md.c change

How come?

In D45142#1029592, @jhb wrote:

Drop md.c change

How come?

I ended up reworking md.c to check the bio->bp_cmd instead which I think is cleaner. I haven't posted a review for that change yet but will in a bit.

sys/amd64/amd64/mem.c
123

Actually, I think I might fix kernacc to return a bool instead as a followup. The current function is:

int
kernacc(void *addr, int len, int rw)
{
...
	if ((vm_offset_t)addr + len > vm_map_max(kernel_map) ||
	    (vm_offset_t)addr + len < (vm_offset_t)addr)
		return (FALSE);
...
	return (rv == TRUE);
}