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)
Sun, Oct 19, 4:39 AM
Unknown Object (File)
Sat, Oct 18, 9:44 PM
Unknown Object (File)
Tue, Oct 14, 7:08 PM
Unknown Object (File)
Tue, Oct 14, 7:08 PM
Unknown Object (File)
Tue, Oct 14, 7:08 PM
Unknown Object (File)
Tue, Oct 14, 7:08 PM
Unknown Object (File)
Tue, Oct 14, 8:05 AM
Unknown Object (File)
Wed, Oct 8, 3:19 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);
}