FreeBSD/sys/sparc64/sparc64/trap.c
/*
 * Syscall handler
 * The arguments to the syscall are passed in the out registers by the caller,
 * and are saved in the trap frame.  The syscall number is passed in %g1 (and
 * also saved in the trap frame).
 */
Syscall handler
The arguments to the syscall are passed in the out registers by the caller,
and are saved in the trap frame.  The syscall number is passed in %g1 (and
also saved in the trap frame).
Syscall handler The arguments to the syscall are passed in the out registers by the caller and are saved in the trap frame . The syscall number is passed in %g1 ( and also saved in the trap frame ) .
void
syscall(struct trapframe *tf)
{
	struct thread *td;
	struct syscall_args sa;
	int error;
	td = curthread;
	td->td_frame = tf;
	KASSERT(td != NULL, ("trap: curthread NULL"));
	KASSERT(td->td_proc != NULL, ("trap: curproc NULL"));
	td->td_pcb->pcb_tpc = tf->tf_tpc;
	TF_DONE(tf);
	error = syscallenter(td, &sa);
	syscallret(td, error, &sa);
}
void syscall ( struct trapframe * tf ) { struct thread * td ; struct syscall_args sa ; int error ; td = curthread ; td -> td_frame = tf ; KASSERT ( td != NULL , ( " " ) ) ; KASSERT ( td -> td_proc != NULL , ( " " ) ) ; td -> td_pcb -> pcb_tpc = tf -> tf_tpc ; TF_DONE ( tf ) ; error = syscallenter ( td , & sa ) ; syscallret ( td , error , & sa ) ; }
Syscall handler
 The arguments to the syscall are passed in the out registers by the caller,
 and are saved in the trap frame.
Syscall handler The arguments to the syscall are passed in the out registers by the caller and are saved in the trap frame .
/*
	 * For syscalls, we don't want to retry the faulting instruction
	 * (usually), instead we need to advance one instruction.
	 */