Changeset View
Changeset View
Standalone View
Standalone View
sys/sparc64/sparc64/trap.c
Show First 20 Lines • Show All 587 Lines • ▼ Show 20 Lines | |||||
* The arguments to the syscall are passed in the out registers by the caller, | * 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 | * and are saved in the trap frame. The syscall number is passed in %g1 (and | ||||
* also saved in the trap frame). | * also saved in the trap frame). | ||||
*/ | */ | ||||
void | void | ||||
syscall(struct trapframe *tf) | syscall(struct trapframe *tf) | ||||
{ | { | ||||
struct thread *td; | struct thread *td; | ||||
int error; | |||||
td = curthread; | td = curthread; | ||||
td->td_frame = tf; | td->td_frame = tf; | ||||
KASSERT(td != NULL, ("trap: curthread NULL")); | KASSERT(td != NULL, ("trap: curthread NULL")); | ||||
KASSERT(td->td_proc != NULL, ("trap: curproc NULL")); | KASSERT(td->td_proc != NULL, ("trap: curproc NULL")); | ||||
/* | /* | ||||
* For syscalls, we don't want to retry the faulting instruction | * For syscalls, we don't want to retry the faulting instruction | ||||
* (usually), instead we need to advance one instruction. | * (usually), instead we need to advance one instruction. | ||||
*/ | */ | ||||
td->td_pcb->pcb_tpc = tf->tf_tpc; | td->td_pcb->pcb_tpc = tf->tf_tpc; | ||||
TF_DONE(tf); | TF_DONE(tf); | ||||
error = syscallenter(td); | syscallenter(td); | ||||
syscallret(td, error); | syscallret(td); | ||||
} | } |