Index: /branches/ia32/lisp-kernel/x86-spentry32.s
===================================================================
--- /branches/ia32/lisp-kernel/x86-spentry32.s	(revision 9397)
+++ /branches/ia32/lisp-kernel/x86-spentry32.s	(revision 9398)
@@ -3864,21 +3864,24 @@
 
 _spentry(callback)
-	__(int $3)
 	__(push %ebp)
 	__(movl %esp,%ebp)
+	/* C scalar args are already on the stack. */
+	/* arg word 0 at 8(%ebp), word 1 at 12(%ebp), etc. */
+
 	/* C NVRs */
 	__(push %edi)
 	__(push %esi)
 	__(push %ebx)
+	__(push %ebp)
 	
-	__(movl %eax,%edi)
+	__(box_fixnum(%eax,%esi))	/* put callback index in arg_y */
 	__(ref_global(get_tcr,%eax))
 	__(push $1)
 	__(call *%eax)
-	/* linear TCR addr now in %eax; callback index in %edi */
-	__(movl %edi,%eax)
+	/* linear TCR addr now in %eax */
 	__(push %rcontext:tcr.foreign_sp)
+	__(movl %esp,%rcontext:tcr.foreign_sp)
 	__(clr %arg_z)
-	__(clr %arg_y)
+	/* arg_y contains callback index */
 	__(clr %temp1)
 	__(clr %temp0)
@@ -3886,6 +3889,6 @@
 	__(pxor %fpzero,%fpzero)
 	__(movl %rcontext:tcr.save_vsp,%esp)
-	__(box_fixnum(%eax,%arg_y))
 	__(movl %ebp,%arg_z)
+	__(movl %rcontext:tcr.save_ebp,%ebp)
 	__(movl $TCR_STATE_LISP,%rcontext:tcr.valence)
 	__(stmxcsr %rcontext:tcr.foreign_mxcsr)
@@ -3904,8 +3907,12 @@
 	__(emms)
 	__(pop %rcontext:tcr.foreign_sp)
+	__(addl $node_size,%esp)
         __(ldmxcsr %rcontext:tcr.foreign_mxcsr)
+	__(pop %ebp)
 	__(pop %ebx)
 	__(pop %esi)
 	__(pop %edi)
+	__(movl -4(%ebp),%eax)
+	/* fp result? */
 	__(leave)
 	__(ret)
