Index: kernel/arch/arm32/src/atomic.c
===================================================================
--- kernel/arch/arm32/src/atomic.c	(revision e1d93e3014b1712d46f9669ed7c36a0950e30e1f)
+++ kernel/arch/arm32/src/atomic.c	(revision 320762af2fd0add2c4226b0f3ad381fadacc7fb6)
@@ -38,5 +38,5 @@
 #include <arch/asm.h>
 
-unsigned __atomic_fetch_add_4(volatile unsigned *mem, unsigned val, int model)
+unsigned __atomic_fetch_add_4(volatile void *mem, unsigned val, int model)
 {
 	/*
@@ -45,15 +45,15 @@
 	 */
 	ipl_t ipl = interrupts_disable();
-	unsigned ret = *mem;
-	*mem += val;
+	unsigned ret = *((volatile unsigned *)mem);
+	*((volatile unsigned *)mem) += val;
 	interrupts_restore(ipl);
 	return ret;
 }
 
-unsigned __atomic_fetch_sub_4(volatile unsigned *mem, unsigned val, int model)
+unsigned __atomic_fetch_sub_4(volatile void *mem, unsigned val, int model)
 {
 	ipl_t ipl = interrupts_disable();
-	unsigned ret = *mem;
-	*mem -= val;
+	unsigned ret = *((volatile unsigned *)mem);
+	*((volatile unsigned *)mem) -= val;
 	interrupts_restore(ipl);
 	return ret;
@@ -67,5 +67,5 @@
  * returns the previous value of \a *ptr.
  */
-void *__sync_val_compare_and_swap_4(void **ptr, void *expected, void *new_val)
+unsigned __sync_val_compare_and_swap_4(volatile void *ptr, unsigned expected, unsigned new_val)
 {
 	/*
@@ -78,8 +78,8 @@
 	irq_spinlock_lock(&cas_lock, true);
 
-	void *cur_val = *ptr;
+	unsigned cur_val = *((volatile unsigned *)ptr);
 
 	if (cur_val == expected) {
-		*ptr = new_val;
+		*((volatile unsigned *)ptr) = new_val;
 	}
 
@@ -96,5 +96,5 @@
 /* Naive implementations of the newer intrinsics. */
 
-_Bool __atomic_compare_exchange_4(void **mem, void **expected, void *desired, _Bool weak, int success, int failure)
+_Bool __atomic_compare_exchange_4(volatile void *mem, void *expected, unsigned desired, _Bool weak, int success, int failure)
 {
 	(void) weak;
@@ -102,21 +102,21 @@
 	(void) failure;
 
-	void *old = *expected;
-	void *new = __sync_val_compare_and_swap_4(mem, old, desired);
+	unsigned old = *((unsigned *)expected);
+	unsigned new = __sync_val_compare_and_swap_4(mem, old, desired);
 	if (old == new) {
 		return 1;
 	} else {
-		*expected = new;
+		*((unsigned *)expected) = new;
 		return 0;
 	}
 }
 
-void *__atomic_exchange_4(void **mem, void *val, int model)
+unsigned __atomic_exchange_4(volatile void *mem, unsigned val, int model)
 {
 	(void) model;
 
 	irq_spinlock_lock(&cas_lock, true);
-	void *old = *mem;
-	*mem = val;
+	unsigned old = *((unsigned *)mem);
+	*((unsigned *)mem) = val;
 	irq_spinlock_unlock(&cas_lock, true);
 
Index: uspace/lib/c/arch/arm32/src/atomic.c
===================================================================
--- uspace/lib/c/arch/arm32/src/atomic.c	(revision e1d93e3014b1712d46f9669ed7c36a0950e30e1f)
+++ uspace/lib/c/arch/arm32/src/atomic.c	(revision 320762af2fd0add2c4226b0f3ad381fadacc7fb6)
@@ -38,5 +38,5 @@
 volatile unsigned *ras_page;
 
-bool __atomic_compare_exchange_4(volatile unsigned *mem, unsigned *expected, unsigned desired, bool weak, int success, int failure)
+bool __atomic_compare_exchange_4(volatile void *mem, void *expected, unsigned desired, bool weak, int success, int failure)
 {
 	(void) success;
@@ -44,5 +44,5 @@
 	(void) weak;
 
-	unsigned ov = *expected;
+	unsigned ov = *((unsigned *)expected);
 	unsigned ret;
 
@@ -66,5 +66,5 @@
 	      [rp0] "=m" (ras_page[0]),
 	      [rp1] "=m" (ras_page[1]),
-	      [addr] "+m" (*mem)
+	      [addr] "+m" (*((unsigned *)mem))
 	    : [ov] "r" (ov),
 	      [nv] "r" (desired)
@@ -78,9 +78,9 @@
 		return true;
 
-	*expected = ret;
+	*((unsigned *)expected) = ret;
 	return false;
 }
 
-unsigned short __atomic_fetch_add_2(volatile unsigned short *mem, unsigned short val, int model)
+unsigned short __atomic_fetch_add_2(volatile void *mem, unsigned short val, int model)
 {
 	(void) model;
@@ -106,5 +106,5 @@
 	      [rp0] "=m" (ras_page[0]),
 	      [rp1] "=m" (ras_page[1]),
-	      [addr] "+m" (*mem)
+	      [addr] "+m" (*((volatile unsigned short *)mem))
 	    : [imm] "r" (val)
 	);
@@ -116,5 +116,5 @@
 }
 
-unsigned __atomic_fetch_add_4(volatile unsigned *mem, unsigned val, int model)
+unsigned __atomic_fetch_add_4(volatile void *mem, unsigned val, int model)
 {
 	(void) model;
@@ -140,5 +140,5 @@
 	      [rp0] "=m" (ras_page[0]),
 	      [rp1] "=m" (ras_page[1]),
-	      [addr] "+m" (*mem)
+	      [addr] "+m" (*((volatile unsigned *)mem))
 	    : [imm] "r" (val)
 	);
@@ -150,5 +150,5 @@
 }
 
-unsigned __atomic_fetch_sub_4(volatile unsigned *mem, unsigned val, int model)
+unsigned __atomic_fetch_sub_4(volatile void *mem, unsigned val, int model)
 {
 	return __atomic_fetch_add_4(mem, -val, model);
