Page MenuHomeFreeBSD

syscallarg_t: Add a type for system call arguments
ClosedPublic

Authored by brooks on Jan 7 2022, 4:44 PM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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
272

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
272

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
272

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