9ns: mnt: Don't use a 'bogus' struct
[akaros.git] / kern / arch / x86 / atomic.h
index 2aebdba..dd1a29c 100644 (file)
@@ -68,6 +68,11 @@ static inline long atomic_swap(atomic_t *addr, long val)
        return (long)__sync_lock_test_and_set(addr, val);
 }
 
+static inline void *atomic_swap_ptr(void **addr, void *val)
+{
+       return (void*)__sync_lock_test_and_set(addr, val);
+}
+
 static inline bool atomic_cas(atomic_t *addr, long exp_val, long new_val)
 {
        return __sync_bool_compare_and_swap(addr, exp_val, new_val);
@@ -133,7 +138,7 @@ static inline void __spin_lock_raw(volatile uint32_t *rlock)
                        "       je 2f;                "
                        "       pause;                "
                        "       jmp 1b;               "
-                       "2:                       " 
+                       "2:                       "
                        "       movb $1, %1;          "
                        "       xchgb %1, %0;         "
                        "       cmpb $0, %1;          "