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
F102920684: D45142.diff
Mon, Nov 18, 6:27 PM
Unknown Object (File)
Wed, Nov 6, 3:04 PM
Unknown Object (File)
Wed, Nov 6, 3:04 PM
Unknown Object (File)
Tue, Nov 5, 3:15 AM
Unknown Object (File)
Tue, Nov 5, 2:53 AM
Unknown Object (File)
Tue, Nov 5, 2:41 AM
Unknown Object (File)
Mon, Oct 21, 10:28 AM
Unknown Object (File)
Mon, Oct 21, 5:51 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 57642
Build 54530: 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);
}