Index: kernel/generic/src/adt/hash_table.c
===================================================================
--- kernel/generic/src/adt/hash_table.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/adt/hash_table.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -51,5 +51,5 @@
 #include <adt/hash_table.h>
 #include <adt/list.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <assert.h>
 #include <str.h>
Index: kernel/generic/src/cap/cap.c
===================================================================
--- kernel/generic/src/cap/cap.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/cap/cap.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -86,4 +86,5 @@
 #include <limits.h>
 #include <stdint.h>
+#include <stdlib.h>
 
 #define CAPS_START	(CAP_NIL + 1)
Index: kernel/generic/src/console/cmd.c
===================================================================
--- kernel/generic/src/console/cmd.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/console/cmd.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -71,4 +71,5 @@
 #include <symtab.h>
 #include <errno.h>
+#include <stdlib.h>
 
 #ifdef CONFIG_TEST
Index: kernel/generic/src/console/console.c
===================================================================
--- kernel/generic/src/console/console.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/console/console.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -56,5 +56,5 @@
 #include <abi/kio.h>
 #include <mm/frame.h> /* SIZE2FRAMES */
-#include <mm/slab.h>  /* malloc */
+#include <stdlib.h>  /* malloc */
 
 #define KIO_PAGES    8
Index: kernel/generic/src/console/kconsole.c
===================================================================
--- kernel/generic/src/console/kconsole.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/console/kconsole.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -58,5 +58,5 @@
 #include <errno.h>
 #include <putchar.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 
 /** Simple kernel console.
Index: kernel/generic/src/cpu/cpu.c
===================================================================
--- kernel/generic/src/cpu/cpu.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/cpu/cpu.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -39,5 +39,5 @@
 #include <arch.h>
 #include <arch/cpu.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <mm/page.h>
 #include <mm/frame.h>
Index: kernel/generic/src/ipc/ipc.c
===================================================================
--- kernel/generic/src/ipc/ipc.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/ipc/ipc.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -61,4 +61,5 @@
 #include <ipc/irq.h>
 #include <cap/cap.h>
+#include <stdlib.h>
 
 static void ipc_forget_call(call_t *);
Index: kernel/generic/src/ipc/ipcrsc.c
===================================================================
--- kernel/generic/src/ipc/ipcrsc.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/ipc/ipcrsc.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -42,4 +42,5 @@
 #include <cap/cap.h>
 #include <mm/slab.h>
+#include <stdlib.h>
 
 static void phone_destroy(void *arg)
Index: kernel/generic/src/ipc/irq.c
===================================================================
--- kernel/generic/src/ipc/irq.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/ipc/irq.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -66,4 +66,5 @@
 #include <macros.h>
 #include <cap/cap.h>
+#include <stdlib.h>
 
 static void ranges_unmap(irq_pio_range_t *ranges, size_t rangecount)
Index: kernel/generic/src/ipc/ops/dataread.c
===================================================================
--- kernel/generic/src/ipc/ops/dataread.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/ipc/ops/dataread.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -36,5 +36,5 @@
 #include <ipc/sysipc_ops.h>
 #include <ipc/ipc.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <abi/errno.h>
 #include <syscall/copy.h>
Index: kernel/generic/src/ipc/ops/datawrite.c
===================================================================
--- kernel/generic/src/ipc/ops/datawrite.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/ipc/ops/datawrite.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -36,5 +36,5 @@
 #include <ipc/sysipc_ops.h>
 #include <ipc/ipc.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <abi/errno.h>
 #include <syscall/copy.h>
Index: kernel/generic/src/lib/gsort.c
===================================================================
--- kernel/generic/src/lib/gsort.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/lib/gsort.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -42,5 +42,5 @@
 #include <gsort.h>
 #include <mem.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 
 /** Immediate buffer size.
Index: kernel/generic/src/lib/ra.c
===================================================================
--- kernel/generic/src/lib/ra.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/lib/ra.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -55,4 +55,5 @@
 #include <macros.h>
 #include <synch/spinlock.h>
+#include <stdlib.h>
 
 static slab_cache_t *ra_segment_cache;
Index: kernel/generic/src/lib/str.c
===================================================================
--- kernel/generic/src/lib/str.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/lib/str.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -110,5 +110,5 @@
 #include <assert.h>
 #include <macros.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 
 /** Check the condition if wchar_t is signed */
Index: kernel/generic/src/log/log.c
===================================================================
--- kernel/generic/src/log/log.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/log/log.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -53,5 +53,5 @@
 #include <console/console.h>
 #include <abi/log.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 
 #define LOG_PAGES    8
Index: kernel/generic/src/main/kinit.c
===================================================================
--- kernel/generic/src/main/kinit.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/main/kinit.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -72,4 +72,5 @@
 #include <sysinfo/sysinfo.h>
 #include <align.h>
+#include <stdlib.h>
 
 #ifdef CONFIG_SMP
Index: kernel/generic/src/main/uinit.c
===================================================================
--- kernel/generic/src/main/uinit.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/main/uinit.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -45,5 +45,5 @@
 #include <proc/thread.h>
 #include <userspace.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <arch.h>
 #include <udebug/udebug.h>
Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/mm/as.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -81,4 +81,5 @@
 #include <arch/interrupt.h>
 #include <interrupt.h>
+#include <stdlib.h>
 
 /**
Index: kernel/generic/src/mm/backend_phys.c
===================================================================
--- kernel/generic/src/mm/backend_phys.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/mm/backend_phys.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -42,5 +42,5 @@
 #include <mm/page.h>
 #include <mm/frame.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <macros.h>
 #include <arch.h>
Index: kernel/generic/src/mm/slab.c
===================================================================
--- kernel/generic/src/mm/slab.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/mm/slab.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -116,4 +116,5 @@
 #include <macros.h>
 #include <cpu.h>
+#include <stdlib.h>
 
 IRQ_SPINLOCK_STATIC_INITIALIZE(slab_cache_lock);
Index: kernel/generic/src/proc/program.c
===================================================================
--- kernel/generic/src/proc/program.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/proc/program.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -41,5 +41,5 @@
 #include <proc/task.h>
 #include <mm/as.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <arch.h>
 #include <adt/list.h>
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/proc/thread.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -63,5 +63,5 @@
 #include <mem.h>
 #include <stdio.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <main/uinit.h>
 #include <syscall/copy.h>
Index: kernel/generic/src/synch/futex.c
===================================================================
--- kernel/generic/src/synch/futex.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/synch/futex.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -59,5 +59,5 @@
 #include <mm/frame.h>
 #include <mm/page.h>
-#include <mm/slab.h>
+#include <stdlib.h>
 #include <proc/thread.h>
 #include <proc/task.h>
Index: kernel/generic/src/sysinfo/stats.c
===================================================================
--- kernel/generic/src/sysinfo/stats.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/sysinfo/stats.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -52,4 +52,5 @@
 #include <cpu.h>
 #include <arch.h>
+#include <stdlib.h>
 
 /** Bits of fixed-point precision for load */
Index: kernel/generic/src/sysinfo/sysinfo.c
===================================================================
--- kernel/generic/src/sysinfo/sysinfo.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/sysinfo/sysinfo.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -43,4 +43,5 @@
 #include <errno.h>
 #include <macros.h>
+#include <stdlib.h>
 
 /** Maximal sysinfo path length */
Index: kernel/generic/src/udebug/udebug_ops.c
===================================================================
--- kernel/generic/src/udebug/udebug_ops.c	(revision cc0121401fb2406d51e053431640b6b174f56568)
+++ kernel/generic/src/udebug/udebug_ops.c	(revision aafed151536405cdb1390b88b7e4ac7c285dd53e)
@@ -52,4 +52,5 @@
 #include <udebug/udebug_ops.h>
 #include <mem.h>
+#include <stdlib.h>
 
 /** Prepare a thread for a debugging operation.
