Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/vm_machdep.c
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | pcb2 = (struct pcb *)(td2->td_kstack + | ||||
td2->td_kstack_pages * PAGE_SIZE) - 1; | td2->td_kstack_pages * PAGE_SIZE) - 1; | ||||
td2->td_pcb = pcb2; | td2->td_pcb = pcb2; | ||||
bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); | bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); | ||||
/* Clear the debug register state. */ | /* Clear the debug register state. */ | ||||
bzero(&pcb2->pcb_dbg_regs, sizeof(pcb2->pcb_dbg_regs)); | bzero(&pcb2->pcb_dbg_regs, sizeof(pcb2->pcb_dbg_regs)); | ||||
ptrauth_fork(td2, td1); | |||||
tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); | tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); | ||||
bcopy(td1->td_frame, tf, sizeof(*tf)); | bcopy(td1->td_frame, tf, sizeof(*tf)); | ||||
tf->tf_x[0] = 0; | tf->tf_x[0] = 0; | ||||
tf->tf_x[1] = 0; | tf->tf_x[1] = 0; | ||||
tf->tf_spsr = td1->td_frame->tf_spsr & (PSR_M_32 | PSR_DAIF); | tf->tf_spsr = td1->td_frame->tf_spsr & (PSR_M_32 | PSR_DAIF); | ||||
td2->td_frame = tf; | td2->td_frame = tf; | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | cpu_copy_thread(struct thread *td, struct thread *td0) | ||||
td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; | td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; | ||||
td->td_pcb->pcb_fpflags &= ~(PCB_FP_STARTED | PCB_FP_KERN | PCB_FP_NOSAVE); | td->td_pcb->pcb_fpflags &= ~(PCB_FP_STARTED | PCB_FP_KERN | PCB_FP_NOSAVE); | ||||
td->td_pcb->pcb_fpusaved = &td->td_pcb->pcb_fpustate; | td->td_pcb->pcb_fpusaved = &td->td_pcb->pcb_fpustate; | ||||
td->td_pcb->pcb_vfpcpu = UINT_MAX; | td->td_pcb->pcb_vfpcpu = UINT_MAX; | ||||
/* Setup to release spin count in fork_exit(). */ | /* Setup to release spin count in fork_exit(). */ | ||||
td->td_md.md_spinlock_count = 1; | td->td_md.md_spinlock_count = 1; | ||||
td->td_md.md_saved_daif = td0->td_md.md_saved_daif & ~DAIF_I_MASKED; | td->td_md.md_saved_daif = td0->td_md.md_saved_daif & ~DAIF_I_MASKED; | ||||
/* Generate new pointer authentication keys. */ | |||||
ptrauth_copy_thread(td, td0); | |||||
} | } | ||||
/* | /* | ||||
* Set that machine state for performing an upcall that starts | * Set that machine state for performing an upcall that starts | ||||
* the entry function with the given argument. | * the entry function with the given argument. | ||||
*/ | */ | ||||
void | void | ||||
cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, | cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
cpu_thread_alloc(struct thread *td) | cpu_thread_alloc(struct thread *td) | ||||
{ | { | ||||
td->td_pcb = (struct pcb *)(td->td_kstack + | td->td_pcb = (struct pcb *)(td->td_kstack + | ||||
td->td_kstack_pages * PAGE_SIZE) - 1; | td->td_kstack_pages * PAGE_SIZE) - 1; | ||||
td->td_frame = (struct trapframe *)STACKALIGN( | td->td_frame = (struct trapframe *)STACKALIGN( | ||||
(struct trapframe *)td->td_pcb - 1); | (struct trapframe *)td->td_pcb - 1); | ||||
ptrauth_thread_alloc(td); | |||||
} | } | ||||
void | void | ||||
cpu_thread_free(struct thread *td) | cpu_thread_free(struct thread *td) | ||||
{ | { | ||||
} | } | ||||
void | void | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |