Index: kernel/arch/sparc64/src/proc/thread.c
===================================================================
--- kernel/arch/sparc64/src/proc/thread.c	(revision d19b3fcc8f46d58029778b0ba79ad3d796f39697)
+++ kernel/arch/sparc64/src/proc/thread.c	(revision 4f3aa7644f25e335cbce9f680ef7e5e6aa6032a5)
@@ -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;
 }
 
