Page MenuHomeFreeBSD

uio: Use switch statements when handling UIO_READ vs UIO_WRITE
ClosedPublic

Authored by jhb on Thu, May 9, 6:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 14, 1:48 PM
Unknown Object (File)
Sun, May 12, 7:04 PM
Unknown Object (File)
Sat, May 11, 7:55 PM
Unknown Object (File)
Sat, May 11, 5:10 PM
Unknown Object (File)
Sat, May 11, 3:09 PM
Unknown Object (File)
Sat, May 11, 1:23 AM
Unknown Object (File)
Fri, May 10, 4:03 PM
Unknown Object (File)
Fri, May 10, 4:03 PM

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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Thu, May 9, 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.Thu, May 9, 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);
}