Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sparc64/sparc64/vm_machdep.c
Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | cpu_set_syscall_retval(struct thread *td, int error) | ||||
default: | default: | ||||
td->td_frame->tf_out[0] = SV_ABI_ERRNO(td->td_proc, error); | td->td_frame->tf_out[0] = SV_ABI_ERRNO(td->td_proc, error); | ||||
td->td_frame->tf_tstate |= TSTATE_XCC_C; | td->td_frame->tf_tstate |= TSTATE_XCC_C; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
void | void | ||||
cpu_set_upcall(struct thread *td, struct thread *td0) | cpu_copy_thread(struct thread *td, struct thread *td0) | ||||
{ | { | ||||
struct trapframe *tf; | struct trapframe *tf; | ||||
struct frame *fr; | struct frame *fr; | ||||
struct pcb *pcb; | struct pcb *pcb; | ||||
bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); | bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); | ||||
pcb = td->td_pcb; | pcb = td->td_pcb; | ||||
tf = td->td_frame; | tf = td->td_frame; | ||||
fr = (struct frame *)tf - 1; | fr = (struct frame *)tf - 1; | ||||
fr->fr_local[0] = (u_long)fork_return; | fr->fr_local[0] = (u_long)fork_return; | ||||
fr->fr_local[1] = (u_long)td; | fr->fr_local[1] = (u_long)td; | ||||
fr->fr_local[2] = (u_long)tf; | fr->fr_local[2] = (u_long)tf; | ||||
pcb->pcb_pc = (u_long)fork_trampoline - 8; | pcb->pcb_pc = (u_long)fork_trampoline - 8; | ||||
pcb->pcb_sp = (u_long)fr - SPOFF; | pcb->pcb_sp = (u_long)fr - SPOFF; | ||||
/* Setup to release the spin count in fork_exit(). */ | /* Setup to release the spin count in fork_exit(). */ | ||||
td->td_md.md_spinlock_count = 1; | td->td_md.md_spinlock_count = 1; | ||||
td->td_md.md_saved_pil = 0; | td->td_md.md_saved_pil = 0; | ||||
} | } | ||||
void | void | ||||
cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, | cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, | ||||
stack_t *stack) | stack_t *stack) | ||||
{ | { | ||||
struct trapframe *tf; | struct trapframe *tf; | ||||
uint64_t sp; | uint64_t sp; | ||||
if (td == curthread) | if (td == curthread) | ||||
flushw(); | flushw(); | ||||
tf = td->td_frame; | tf = td->td_frame; | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Intercept the return address from a freshly forked process that has NOT | * Intercept the return address from a freshly forked process that has NOT | ||||
* been scheduled yet. | * been scheduled yet. | ||||
* | * | ||||
* This is needed to make kernel threads stay in kernel mode. | * This is needed to make kernel threads stay in kernel mode. | ||||
*/ | */ | ||||
void | void | ||||
cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) | cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) | ||||
{ | { | ||||
struct frame *fp; | struct frame *fp; | ||||
struct pcb *pcb; | struct pcb *pcb; | ||||
pcb = td->td_pcb; | pcb = td->td_pcb; | ||||
fp = (struct frame *)(pcb->pcb_sp + SPOFF); | fp = (struct frame *)(pcb->pcb_sp + SPOFF); | ||||
fp->fr_local[0] = (u_long)func; | fp->fr_local[0] = (u_long)func; | ||||
fp->fr_local[1] = (u_long)arg; | fp->fr_local[1] = (u_long)arg; | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |