svn commit: r232478 - head/sys/mips/mips
Juli Mallett
jmallett at FreeBSD.org
Sun Mar 4 05:19:56 UTC 2012
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
More information about the svn-src-head
mailing list