Index: kernel/arch/sparc64/src/proc/thread.c
===================================================================
--- kernel/arch/sparc64/src/proc/thread.c	(revision cc85fb9f57fb5f9af22419eb0ee58d9548d3c7d1)
+++ kernel/arch/sparc64/src/proc/thread.c	(revision 00a8f1b5bbb2bdb8f3cac63fc23b4c833ae23f12)
@@ -35,7 +35,6 @@
 #include <proc/thread.h>
 #include <arch/proc/thread.h>
-#include <mm/frame.h>
-#include <mm/page.h>
-#include <arch/mm/page.h>
+#include <mm/slab.h>
+#include <arch/trap/regwin.h>
 #include <align.h>
 
@@ -51,10 +50,10 @@
 {
 	if (t->arch.uspace_window_buffer) {
+		uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer;
 		/*
 		 * Mind the possible alignment of the userspace window buffer
 		 * belonging to a killed thread.
 		 */
-		frame_free(KA2PA(ALIGN_DOWN((uintptr_t)
-		    t->arch.uspace_window_buffer, PAGE_SIZE)));
+		free((uint8_t *) ALIGN_DOWN(uw_buf, UWB_ALIGNMENT));
 	}
 }
@@ -68,5 +67,5 @@
 		 * returned from the slab allocator doesn't have any.
 		 */
-		t->arch.uspace_window_buffer = frame_alloc(ONE_FRAME, FRAME_KA);
+		t->arch.uspace_window_buffer = malloc(UWB_ASIZE, 0);
 	} else {
 		uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer;
@@ -77,5 +76,5 @@
 		 */
 		t->arch.uspace_window_buffer = (uint8_t *) ALIGN_DOWN(uw_buf,
-		    PAGE_SIZE);
+		    UWB_ASIZE);
 	}
 }
