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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to