Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/mips/pm_machdep.c
Show First 20 Lines • Show All 435 Lines • ▼ Show 20 Lines | #if defined(__mips_n32) || defined(__mips_n64) | ||||
if (!SV_PROC_FLAG(td->td_proc, SV_LP64)) | if (!SV_PROC_FLAG(td->td_proc, SV_LP64)) | ||||
td->td_frame->sp -= 65536; | td->td_frame->sp -= 65536; | ||||
#endif | #endif | ||||
td->td_frame->pc = imgp->entry_addr & ~3; | td->td_frame->pc = imgp->entry_addr & ~3; | ||||
td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */ | td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */ | ||||
td->td_frame->sr = MIPS_SR_KSU_USER | MIPS_SR_EXL | MIPS_SR_INT_IE | | td->td_frame->sr = MIPS_SR_KSU_USER | MIPS_SR_EXL | MIPS_SR_INT_IE | | ||||
(mips_rd_status() & MIPS_SR_INT_MASK); | (mips_rd_status() & MIPS_SR_INT_MASK); | ||||
#if defined(__mips_n32) | #if defined(__mips_n32) || defined(__mips_n64) | ||||
td->td_frame->sr |= MIPS_SR_PX; | td->td_frame->sr |= MIPS_SR_PX; | ||||
#elif defined(__mips_n64) | |||||
td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; | |||||
#endif | #endif | ||||
#if defined(__mips_n64) | |||||
if (SV_PROC_FLAG(td->td_proc, SV_LP64)) | |||||
td->td_frame->sr |= MIPS_SR_UX; | |||||
td->td_frame->sr |= MIPS_SR_KX; | |||||
#endif | |||||
/* | /* | ||||
* FREEBSD_DEVELOPERS_FIXME: | * FREEBSD_DEVELOPERS_FIXME: | ||||
* Setup any other CPU-Specific registers (Not MIPS Standard) | * Setup any other CPU-Specific registers (Not MIPS Standard) | ||||
* and/or bits in other standard MIPS registers (if CPU-Specific) | * and/or bits in other standard MIPS registers (if CPU-Specific) | ||||
* that are needed. | * that are needed. | ||||
*/ | */ | ||||
/* | /* | ||||
* Set up arguments for the rtld-capable crt0: | * Set up arguments for the rtld-capable crt0: | ||||
* a0 stack pointer | * a0 stack pointer | ||||
* a1 rtld cleanup (filled in by dynamic loader) | * a1 rtld cleanup (filled in by dynamic loader) | ||||
* a2 rtld object (filled in by dynamic loader) | * a2 rtld object (filled in by dynamic loader) | ||||
* a3 ps_strings | * a3 ps_strings | ||||
*/ | */ | ||||
td->td_frame->a0 = (register_t) stack; | td->td_frame->a0 = (register_t) stack; | ||||
td->td_frame->a1 = 0; | td->td_frame->a1 = 0; | ||||
td->td_frame->a2 = 0; | td->td_frame->a2 = 0; | ||||
td->td_frame->a3 = (register_t)imgp->ps_strings; | td->td_frame->a3 = (register_t)imgp->ps_strings; | ||||
td->td_md.md_flags &= ~MDTD_FPUSED; | td->td_md.md_flags &= ~MDTD_FPUSED; | ||||
if (PCPU_GET(fpcurthread) == td) | if (PCPU_GET(fpcurthread) == td) | ||||
PCPU_SET(fpcurthread, (struct thread *)0); | PCPU_SET(fpcurthread, (struct thread *)0); | ||||
td->td_md.md_ss_addr = 0; | td->td_md.md_ss_addr = 0; | ||||
#ifdef COMPAT_FREEBSD32 | |||||
if (!SV_PROC_FLAG(td->td_proc, SV_LP64)) | |||||
td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; | |||||
else | |||||
#endif | |||||
td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; | td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; | ||||
} | } | ||||
int | int | ||||
ptrace_clear_single_step(struct thread *td) | ptrace_clear_single_step(struct thread *td) | ||||
{ | { | ||||
struct proc *p; | struct proc *p; | ||||
int error; | int error; | ||||
Show All 27 Lines |