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
Unknown Object (File)
Fri, Jun 5, 11:02 PM
Unknown Object (File)
Mon, Jun 1, 1:38 PM
Unknown Object (File)
Mon, Jun 1, 5:22 AM
Unknown Object (File)
Sun, May 31, 4:51 PM
Unknown Object (File)
Sat, May 30, 11:49 PM
Unknown Object (File)
Fri, May 29, 5:28 PM
Unknown Object (File)
May 18 2026, 2:10 AM
Unknown Object (File)
May 18 2026, 2:10 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);
}