syscallarg_t: Add a type for system call arguments

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

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D33780
This commit is contained in:
Brooks Davis
2022-03-28 19:43:03 +01:00
parent cd8796cee0
commit b1ad6a9000
16 changed files with 32 additions and 30 deletions
+3 -3
View File
@@ -100,7 +100,7 @@ int
cpu_fetch_syscall_args(struct thread *td)
{
struct proc *p;
register_t *ap;
syscallarg_t *ap;
struct syscall_args *sa;
u_int nap;
int error;
@@ -124,10 +124,10 @@ cpu_fetch_syscall_args(struct thread *td)
else
sa->callp = &p->p_sysent->sv_table[sa->code];
error = 0;
memcpy(sa->args, ap, nap * sizeof(register_t));
memcpy(sa->args, ap, nap * sizeof(*sa->args));
if (sa->callp->sy_narg > nap) {
error = copyin((void *)td->td_frame->tf_usr_sp, sa->args +
nap, (sa->callp->sy_narg - nap) * sizeof(register_t));
nap, (sa->callp->sy_narg - nap) * sizeof(*sa->args));
}
if (error == 0) {
td->td_retval[0] = 0;