Date: Fri, 10 Feb 2012 07:03:45 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r231351 - head/sys/mips/mips Message-ID: <201202100703.q1A73jum059033@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gonzo Date: Fri Feb 10 07:03:45 2012 New Revision: 231351 URL: http://svn.freebsd.org/changeset/base/231351 Log: Fix-up value passed by thr_new syscall to make it compatible with MIPS_TLS_GET/MIPS_TLS_SET sysarch API. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Fri Feb 10 06:53:25 2012 (r231350) +++ head/sys/mips/mips/vm_machdep.c Fri Feb 10 07:03:45 2012 (r231351) @@ -601,7 +601,18 @@ int cpu_set_user_tls(struct thread *td, void *tls_base) { - td->td_md.md_tls = tls_base; + /* + * tls_base passed to this function + * from thr_new call and points to actual TCB struct, + * so we should add TP_OFFSET + sizeof(struct tcb) + * to make it the same way TLS base is passed to + * MIPS_SET_TLS/MIPS_GET_TLS API + */ +#ifndef __mips_n64 + td->td_md.md_tls = (char*)tls_base + 0x7010; +#else + td->td_md.md_tls = (char*)tls_base + 0x7008; +#endif return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202100703.q1A73jum059033>