Index: kernel/arch/abs32le/src/proc/thread.c
===================================================================
--- kernel/arch/abs32le/src/proc/thread.c	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/abs32le/src/proc/thread.c	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -35,6 +35,7 @@
 #include <proc/thread.h>
 
-void thread_create_arch(thread_t *t)
+errno_t thread_create_arch(thread_t *t, thread_flags_t flags)
 {
+	return EOK;
 }
 
Index: kernel/arch/amd64/src/proc/thread.c
===================================================================
--- kernel/arch/amd64/src/proc/thread.c	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/amd64/src/proc/thread.c	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -42,5 +42,5 @@
  *
  */
-void thread_create_arch(thread_t *thread)
+errno_t thread_create_arch(thread_t *thread, thread_flags_t flags)
 {
 	/*
@@ -49,4 +49,5 @@
 	thread->arch.kstack_rsp =
 	    (uintptr_t) &thread->kstack[PAGE_SIZE - sizeof(istate_t)];
+	return EOK;
 }
 
Index: kernel/arch/arm32/include/arch/proc/thread.h
===================================================================
--- kernel/arch/arm32/include/arch/proc/thread.h	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/arm32/include/arch/proc/thread.h	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -42,5 +42,5 @@
 #define thr_constructor_arch(t)
 #define thr_destructor_arch(t)
-#define thread_create_arch(t)
+#define thread_create_arch(t, flags) (EOK)
 
 #endif
Index: kernel/arch/ia32/src/proc/thread.c
===================================================================
--- kernel/arch/ia32/src/proc/thread.c	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/ia32/src/proc/thread.c	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -39,6 +39,7 @@
  * @param t Thread to be initialized.
  */
-void thread_create_arch(thread_t *t)
+errno_t thread_create_arch(thread_t *t, thread_flags_t flags)
 {
+	return EOK;
 }
 
Index: kernel/arch/ia64/include/arch/proc/thread.h
===================================================================
--- kernel/arch/ia64/include/arch/proc/thread.h	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/ia64/include/arch/proc/thread.h	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -41,5 +41,5 @@
 #define thr_constructor_arch(t)
 #define thr_destructor_arch(t)
-#define thread_create_arch(t)
+#define thread_create_arch(t, flags) (EOK)
 
 #endif
Index: kernel/arch/mips32/include/arch/proc/thread.h
===================================================================
--- kernel/arch/mips32/include/arch/proc/thread.h	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/mips32/include/arch/proc/thread.h	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -41,5 +41,5 @@
 #define thr_constructor_arch(t)
 #define thr_destructor_arch(t)
-#define thread_create_arch(t)
+#define thread_create_arch(t, flags) (EOK)
 
 #endif
Index: kernel/arch/ppc32/include/arch/proc/thread.h
===================================================================
--- kernel/arch/ppc32/include/arch/proc/thread.h	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/ppc32/include/arch/proc/thread.h	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -41,5 +41,5 @@
 #define thr_constructor_arch(t)
 #define thr_destructor_arch(t)
-#define thread_create_arch(t)
+#define thread_create_arch(t, flags) (EOK)
 
 #endif
Index: kernel/arch/riscv64/src/proc/thread.c
===================================================================
--- kernel/arch/riscv64/src/proc/thread.c	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/riscv64/src/proc/thread.c	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -35,6 +35,7 @@
 #include <proc/thread.h>
 
-void thread_create_arch(thread_t *t)
+errno_t thread_create_arch(thread_t *t, thread_flags_t flags)
 {
+	return EOK;
 }
 
Index: kernel/arch/sparc64/src/proc/thread.c
===================================================================
--- kernel/arch/sparc64/src/proc/thread.c	(revision 88e43bc385a97c7449a8a8bdd10a598a9497c134)
+++ kernel/arch/sparc64/src/proc/thread.c	(revision ba9a150799eb4761d670852aa4aa4df033ca853a)
@@ -62,12 +62,14 @@
 }
 
-void thread_create_arch(thread_t *t)
+errno_t thread_create_arch(thread_t *t, thread_flags_t flags)
 {
-	if ((t->uspace) && (!t->arch.uspace_window_buffer)) {
+	if ((flags & THREAD_FLAG_USPACE) && (!t->arch.uspace_window_buffer)) {
 		/*
 		 * The thread needs userspace window buffer and the object
 		 * returned from the slab allocator doesn't have any.
 		 */
-		t->arch.uspace_window_buffer = slab_alloc(uwb_cache, 0);
+		t->arch.uspace_window_buffer = slab_alloc(uwb_cache, FRAME_ATOMIC);
+		if (!t->arch.uspace_window_buffer)
+			return ENOMEM;
 	} else {
 		uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer;
@@ -80,4 +82,5 @@
 		    UWB_ALIGNMENT);
 	}
+	return EOK;
 }
 
