More of my unprofessional opinion since we'll need all the help we can
get...

+void *
+dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new)
+*/
+EENTRY(dtrace_casptr)
+ENTRY(dtrace_cas32)
+#if __ARM_ARCH >= 6
+
+1:     ldrex   r3, [r0]        /* Load target */
+       cmp     r3, r1          /* Check if *target == cmp */
+       bne     2f              /* No, return */
+       strex   ip, r2, [r0]    /* Store new to target */
+       cmp     ip, #0          /* Did the store succeed? */
+       bne     1b              /* No, try again */
+2:     mov     r0, r3          /* Return the value loaded from target */
+       RET
+

..

Surely we have a function like this already, does dtrace really
need its own asm implementation>?


+static int
+log2(int size)
+{
+       switch (size) {
+       case 1: return (0);
+       case 2: return (1);
+       case 4: return (2);
+       case 8: return (3);
+       }
+       return (0);
+}

Using the name of a standard C function differently sounds dangerous

Reply via email to