Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/mips/freebsd32_machdep.c
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
#include <sys/sysproto.h> | #include <sys/sysproto.h> | ||||
#include <sys/signalvar.h> | #include <sys/signalvar.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <sys/linker.h> | #include <sys/linker.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_param.h> | #include <vm/vm_param.h> | ||||
#include <machine/cpuinfo.h> | |||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#include <machine/reg.h> | #include <machine/reg.h> | ||||
#include <machine/sigframe.h> | #include <machine/sigframe.h> | ||||
#include <machine/sysarch.h> | #include <machine/sysarch.h> | ||||
#include <machine/tls.h> | #include <machine/tls.h> | ||||
#include <compat/freebsd32/freebsd32_signal.h> | #include <compat/freebsd32/freebsd32_signal.h> | ||||
#include <compat/freebsd32/freebsd32_util.h> | #include <compat/freebsd32/freebsd32_util.h> | ||||
▲ Show 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | |||||
freebsd32_sysarch(struct thread *td, struct freebsd32_sysarch_args *uap) | freebsd32_sysarch(struct thread *td, struct freebsd32_sysarch_args *uap) | ||||
{ | { | ||||
int error; | int error; | ||||
int32_t tlsbase; | int32_t tlsbase; | ||||
switch (uap->op) { | switch (uap->op) { | ||||
case MIPS_SET_TLS: | case MIPS_SET_TLS: | ||||
td->td_md.md_tls = (void *)(intptr_t)uap->parms; | td->td_md.md_tls = (void *)(intptr_t)uap->parms; | ||||
/* | |||||
* If there is an user local register implementation (ULRI) | |||||
* update it as well. Add the TLS and TCB offsets so the | |||||
* value in this register is adjusted like in the case of the | |||||
* rdhwr trap() instruction handler. | |||||
*/ | |||||
if (cpuinfo.userlocal_reg == true) { | |||||
mips_wr_userlocal((unsigned long)(uap->parms + | |||||
td->td_md.md_tls_tcb_offset)); | |||||
} | |||||
return (0); | return (0); | ||||
case MIPS_GET_TLS: | case MIPS_GET_TLS: | ||||
tlsbase = (int32_t)(intptr_t)td->td_md.md_tls; | tlsbase = (int32_t)(intptr_t)td->td_md.md_tls; | ||||
error = copyout(&tlsbase, uap->parms, sizeof(tlsbase)); | error = copyout(&tlsbase, uap->parms, sizeof(tlsbase)); | ||||
return (error); | return (error); | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
void | void | ||||
elf32_dump_thread(struct thread *td __unused, void *dst __unused, | elf32_dump_thread(struct thread *td __unused, void *dst __unused, | ||||
size_t *off __unused) | size_t *off __unused) | ||||
{ | { | ||||
} | } |