Index: /branches/arm/lisp-kernel/arm-asmutils.s
===================================================================
--- /branches/arm/lisp-kernel/arm-asmutils.s	(revision 13924)
+++ /branches/arm/lisp-kernel/arm-asmutils.s	(revision 13925)
@@ -64,25 +64,14 @@
 
 _exportfn(C(store_conditional))
-        __ifdef([LINUX])
-        /* To deal with different ARM variants, Linux provides
-           a magic kernel function that does the right thing in
-           the absence of ldrex/strex/clrex and memory-barrier
-           functions.  That function takes args in a different
-           order (r0 = expected oldval, r1 = newval, r2 = addr.)
-        */
-        __(stmdb pc!,{r4,lr})
-        __(eor r0,r0,r2)
-        __(eor r2,r2,r0)
-        __(eor r0,r0,r2)
-0:      __(ldr r3,[r2])
-        __(cmp r3,r0)
-        __(bne 1f)   
-        __(mov lr,#0xffff0fff)
-        __(add lr,lr,#(0xffff0fc0 - 0xffff0fff))
-        __(blx lr)
-        __(bcc 0b)
-1:      __(mov r0,r3)
-        __(ldmia pc!,{r4,lr})
-        __endif
+0:      __(ldrex r3,[r0])
+        __(cmp r3,r1)
+        __(bne 1f)
+        __(strex ip,r2,[r0])
+        __(cmp ip,#0)
+        __(bne 0b)
+        __(b 2f)
+1:      __(clrex)
+2:      __(mov r0,r3)
+        __(bx lr)                
 _endfn
 
Index: /branches/arm/lisp-kernel/arm-constants.s
===================================================================
--- /branches/arm/lisp-kernel/arm-constants.s	(revision 13924)
+++ /branches/arm/lisp-kernel/arm-constants.s	(revision 13925)
@@ -597,6 +597,6 @@
 	 _node(last_lisp_frame)	/* when in foreign code */
 	 _node(cs_limit)	/* cstack overflow limit */
+	 _node(bytes_consed_low)
 	 _node(bytes_consed_high)
-	 _node(bytes_consed_low)
 	 _node(log2_allocation_quantum)
 	 _node(interrupt_pending)
Index: /branches/arm/lisp-kernel/arm-gc.c
===================================================================
--- /branches/arm/lisp-kernel/arm-gc.c	(revision 13924)
+++ /branches/arm/lisp-kernel/arm-gc.c	(revision 13925)
@@ -991,4 +991,7 @@
       Bug(NULL, "Unknown stack word at 0x" LISP ":\n", current);
     }
+  }
+  if (current != limit) {
+    Bug(NULL, "Ran off the end of cstack area\n");
   }
 }
