[Openmcl-cvs-notifications] r11376 - in /trunk/source/lisp-kernel: x86-spentry32.s x86-subprims32.s

gb at clozure.com gb at clozure.com
Sun Nov 16 22:06:10 EST 2008


Author: gb
Date: Sun Nov 16 22:06:10 2008
New Revision: 11376

Log:
On FreeBSD, whether or not we can write to rcontext depends on whether
or not the 32-bit lisp is running on a 64-bit kernel, so check
'rcontext_readonly' and skip loading rcontext from the tcr if it's
non-zero.  (On a 32-bit kernel, %fs can get clobbered sometimes.)

Modified:
    trunk/source/lisp-kernel/x86-spentry32.s
    trunk/source/lisp-kernel/x86-subprims32.s

Modified: trunk/source/lisp-kernel/x86-spentry32.s
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-spentry32.s (original)
+++ trunk/source/lisp-kernel/x86-spentry32.s Sun Nov 16 22:06:10 2008
@@ -4262,15 +4262,16 @@
 	__(push %ebx)
 	__(push %ebp)
 	__(box_fixnum(%eax,%esi))	/* put callback index in arg_y */
-        __ifndef([FREEBSD])
-	 __(ref_global(get_tcr,%eax))
-	 __(subl $12,%esp)		/* alignment */
-	 __(push $1)			/* stack now 16-byte aligned */
-	 __(call *%eax)
-	 __(addl $16,%esp)		/* discard arg, alignment words */
-	 /* linear TCR addr now in %eax */
-	 __(movw tcr.ldt_selector(%eax), %rcontext_reg)
-        __endif
+        __(cmpb $0,C(rcontext_readonly))
+        __(jne 0f)
+	__(ref_global(get_tcr,%eax))
+	__(subl $12,%esp)		/* alignment */
+	__(push $1)			/* stack now 16-byte aligned */
+	__(call *%eax)
+	__(addl $16,%esp)		/* discard arg, alignment words */
+	/* linear TCR addr now in %eax */
+	__(movw tcr.ldt_selector(%eax), %rcontext_reg)
+0:      =

 =

         /* ebp is 16-byte aligned, and we've pushed 4 words.  Make
           sure that when we push old foreign_sp, %esp will be 16-byte

Modified: trunk/source/lisp-kernel/x86-subprims32.s
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-subprims32.s (original)
+++ trunk/source/lisp-kernel/x86-subprims32.s Sun Nov 16 22:06:10 2008
@@ -74,14 +74,15 @@
 	__(push %esi)
 	__(push %ebx)
 	__(mov 8(%ebp), %ebx)	/* get tcr */
-        __ifndef([FREEBSD])
-	 __(movw tcr.ldt_selector(%ebx), %rcontext_reg)
-        __endif
+        __(cmpb $0,C(rcontext_readonly))
+        __(jne 0f)
+        __(movw tcr.ldt_selector(%ebx), %rcontext_reg)
+0:              =

         __(movl 8(%ebp),%eax)
         __(cmpl rcontext(tcr.linear),%eax)
-        __(je 0f)
+        __(je 1f)
         __(hlt)
-0:              =

+1:              =

         .if c_stack_16_byte_aligned
 	__(sub $12, %esp) 	/* stack now 16-byte aligned */
         .else



More information about the Openmcl-cvs-notifications mailing list