Page MenuHomeFreeBSD

syscallarg_t: Add a type for system call arguments
ClosedPublic

Authored by brooks on Jan 7 2022, 4:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 10:51 AM
Unknown Object (File)
Oct 2 2024, 8:47 AM
Unknown Object (File)
Oct 2 2024, 5:51 AM
Unknown Object (File)
Oct 1 2024, 5:14 PM
Unknown Object (File)
Oct 1 2024, 2:55 PM
Unknown Object (File)
Sep 26 2024, 8:48 PM
Unknown Object (File)
Sep 21 2024, 5:53 AM
Unknown Object (File)
Sep 20 2024, 1:37 PM
Subscribers

Details

Summary

This more clearly differentiates system call arguments from integer
registers and return values. On current architectures it has no effect,
but on architectures where pointers are not integers (CHERI) and may
not even share registers (CHERI-MIPS) it is necessiary to differentiate
between system call arguments (syscallarg_t) and integer register values
(register_t).

Obtained from: CheriBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks requested review of this revision.Jan 7 2022, 4:44 PM
This revision is now accepted and ready to land.Jan 7 2022, 4:46 PM

Do you plan to also update other architectures and ABIs?

This revision now requires review to proceed.Jan 7 2022, 10:25 PM

Do you plan to also update other architectures and ABIs?

I've done arm and amd64. I've not touched powerpc because it follows a unique model.

sys/sys/types.h
273

Can we have it named less verbose, e.g. scarg_t ?

sys/vm/vm_mmap.c
423

Is this cast needed at all?

brooks added inline comments.
sys/vm/vm_mmap.c
423

It doesn't appear to be. I've removed it.

brooks added inline comments.
sys/sys/types.h
273

I don't see the value in trading a more obfuscated name for 5 bytes per use of a rarely used type.

kib added inline comments.
sys/sys/types.h
273

The lines where syscallarg_t needs to be spelled, get too long. Typically if you need to cast, you need to repeat the type name in the same expression one more time, so it is 5-10 chars lost out of 72.

This revision is now accepted and ready to land.Jan 12 2022, 4:53 AM