Date: Sun, 4 Mar 2012 05:19:56 +0000 (UTC) From: Juli Mallett <jmallett@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r232478 - head/sys/mips/mips Message-ID: <201203040519.q245Ju6e015764@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jmallett Date: Sun Mar 4 05:19:55 2012 New Revision: 232478 URL: http://svn.freebsd.org/changeset/base/232478 Log: Fix tls base computation with COMPAT_FREEBSD32 on n64 kernels. The previous version was missing an else and would always use the n64 TP_OFFSET. Eliminate some duplication of logic here. It may be worth getting rid of some of the ifdefs and introducing gratuitous SV_ILP32 runtime checks on n64 kernels without COMPAT_FREEBSD32 and on o32 kernels, similarly to how PowerPC works. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Sun Mar 4 00:42:18 2012 (r232477) +++ head/sys/mips/mips/vm_machdep.c Sun Mar 4 05:19:55 2012 (r232478) @@ -618,14 +618,18 @@ cpu_set_user_tls(struct thread *td, void #ifdef __mips_n64 #ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) - td->td_md.md_tls = (char*)tls_base + 0x7008; + if (!SV_PROC_FLAG(td->td_proc, SV_ILP32)) { #endif - td->td_md.md_tls = (char*)tls_base + 0x7010; -#else - td->td_md.md_tls = (char*)tls_base + 0x7008; + td->td_md.md_tls = (char*)tls_base + 0x7010; + return (0); +#ifdef COMPAT_FREEBSD32 + } #endif +#endif +#if !defined(__mips_n64) || defined(COMPAT_FREEBSD32) + td->td_md.md_tls = (char*)tls_base + 0x7008; return (0); +#endif } #ifdef DDB
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203040519.q245Ju6e015764>