Index: uspace/lib/libc/arch/sparc64/src/stacktrace.S
===================================================================
--- uspace/lib/libc/arch/sparc64/src/stacktrace.S	(revision 40746016dd60dc0278f89c5e937d2ce9b7136365)
+++ uspace/lib/libc/arch/sparc64/src/stacktrace.S	(revision f0452536864f254d60b591dec3f5ce98a9645f1f)
@@ -27,4 +27,6 @@
 #
 
+#include <libarch/stack.h>
+
 .text
 
@@ -33,12 +35,13 @@
 .global frame_pointer_validate
 .global return_address_get
+.global program_counter_get
 
 frame_pointer_get:
 	# Add the stack bias to %sp to get the actual address.
 	retl
-	add %sp, 0x7ff, %o0
+	add %sp, STACK_BIAS, %o0
 
 frame_pointer_prev:
-	save %sp, -176, %sp
+	save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
 	# Flush all other windows to memory so that we can read their contents.
 	flushw
@@ -46,15 +49,14 @@
 	ldx [%i0 + 14 * 8], %i0
 	# Add the stack bias to the %fp read from the window save area.
-	add %i0, 0x7ff, %i0
+	add %i0, STACK_BIAS, %i0
 	ret
 	restore
 
 frame_pointer_validate:
-	#
-	# Fall through - we detect the last frame in the trace by zero %i7.
-	#
+	retl
+	nop
 
 return_address_get:
-	save %sp, -176, %sp
+	save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
 	# Flush all other windows to memory so that we can read their contents.
 	flushw
@@ -63,2 +65,7 @@
 	ret
 	restore
+
+program_counter_get:
+	retl
+	mov %o7, %o0
+
