Index: uspace/lib/c/arch/sparc64/Makefile.inc
===================================================================
--- uspace/lib/c/arch/sparc64/Makefile.inc	(revision ae7bbfd0bcf872d80ac6f3f37faf7fa216782613)
+++ uspace/lib/c/arch/sparc64/Makefile.inc	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
@@ -28,7 +28,7 @@
 
 ARCH_SOURCES = \
-	arch/$(UARCH)/src/entry.s \
-	arch/$(UARCH)/src/entryjmp.s \
-	arch/$(UARCH)/src/thread_entry.s \
+	arch/$(UARCH)/src/entry.S \
+	arch/$(UARCH)/src/entryjmp.S \
+	arch/$(UARCH)/src/thread_entry.S \
 	arch/$(UARCH)/src/fibril.S \
 	arch/$(UARCH)/src/tls.c \
Index: uspace/lib/c/arch/sparc64/src/entry.S
===================================================================
--- uspace/lib/c/arch/sparc64/src/entry.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ uspace/lib/c/arch/sparc64/src/entry.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2006 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#include <abi/asmtool.h>
+
+.section .init, "ax"
+
+.org 0
+
+## User-space task entry point
+#
+# %o0 contains uarg
+# %o1 contains pcb_ptr
+#
+SYMBOL(__entry)
+	#
+	# Create the first stack frame.
+	#
+	save %sp, -176, %sp
+	flushw
+	add %g0, -0x7ff, %fp
+	
+	# Pass pcb_ptr as the first argument to __main()
+	mov %i1, %o0
+	sethi %hi(_gp), %l7
+	call __main
+	or %l7, %lo(_gp), %l7
Index: uspace/lib/c/arch/sparc64/src/entry.s
===================================================================
--- uspace/lib/c/arch/sparc64/src/entry.s	(revision ae7bbfd0bcf872d80ac6f3f37faf7fa216782613)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#
-# Copyright (c) 2006 Martin Decky
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-.section .init, "ax"
-
-.org 0
-
-.globl __entry
-
-## User-space task entry point
-#
-# %o0 contains uarg
-# %o1 contains pcb_ptr
-#
-__entry:
-	#
-	# Create the first stack frame.
-	#
-	save %sp, -176, %sp
-	flushw
-	add %g0, -0x7ff, %fp
-	
-	# Pass pcb_ptr as the first argument to __main()
-	mov %i1, %o0
-	sethi %hi(_gp), %l7
-	call __main
-	or %l7, %lo(_gp), %l7
Index: uspace/lib/c/arch/sparc64/src/entryjmp.S
===================================================================
--- uspace/lib/c/arch/sparc64/src/entryjmp.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ uspace/lib/c/arch/sparc64/src/entryjmp.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2008 Jiri Svoboda
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#include <abi/asmtool.h>
+
+## void entry_point_jmp(void *entry_point, void *pcb);
+#
+# %o0	contains entry_point
+# %o1	contains pcb
+#
+# Jump to program entry point
+SYMBOL(entry_point_jmp)
+	# Pass pcb pointer to entry point in %o1. As it is already
+	# there, no action is needed.
+	call %o0
+	nop
+	# fixme: use branch instead of call
Index: uspace/lib/c/arch/sparc64/src/entryjmp.s
===================================================================
--- uspace/lib/c/arch/sparc64/src/entryjmp.s	(revision ae7bbfd0bcf872d80ac6f3f37faf7fa216782613)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#
-# Copyright (c) 2008 Jiri Svoboda
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-.globl entry_point_jmp
-
-## void entry_point_jmp(void *entry_point, void *pcb);
-#
-# %o0	contains entry_point
-# %o1	contains pcb
-#
-# Jump to program entry point
-entry_point_jmp:
-	# Pass pcb pointer to entry point in %o1. As it is already
-	# there, no action is needed.
-	call %o0
-	nop
-	# fixme: use branch instead of call
Index: uspace/lib/c/arch/sparc64/src/fibril.S
===================================================================
--- uspace/lib/c/arch/sparc64/src/fibril.S	(revision ae7bbfd0bcf872d80ac6f3f37faf7fa216782613)
+++ uspace/lib/c/arch/sparc64/src/fibril.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
@@ -27,12 +27,10 @@
 #
 
+#include <abi/asmtool.h>
 #include <libarch/fibril_context.h>
 
 .text
 
-.global context_save
-.global context_restore
-
-context_save:
+FUNCTION_BEGIN(context_save)
 	#
 	# We rely on the kernel to flush our active register windows to memory
@@ -60,6 +58,7 @@
 	retl
 	mov 1, %o0		! context_save_arch returns 1
+FUNCTION_END(context_save)
 
-context_restore:
+FUNCTION_BEGIN(context_restore)
 	#
 	# Flush all active windows.
@@ -91,2 +90,3 @@
 	retl
 	xor %o0, %o0, %o0	! context_restore_arch returns 0
+FUNCTION_END(context_restore)
Index: uspace/lib/c/arch/sparc64/src/stacktrace_asm.S
===================================================================
--- uspace/lib/c/arch/sparc64/src/stacktrace_asm.S	(revision ae7bbfd0bcf872d80ac6f3f37faf7fa216782613)
+++ uspace/lib/c/arch/sparc64/src/stacktrace_asm.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
@@ -27,13 +27,10 @@
 #
 
+#include <abi/asmtool.h>
 #include <libarch/stack.h>
 
 .text
 
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
-
-stacktrace_prepare:
+FUNCTION_BEGIN(stacktrace_prepare)
 	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.
@@ -41,11 +38,14 @@
 	ret
 	restore
+FUNCTION_END(stacktrace_prepare)
 
-stacktrace_fp_get:
+FUNCTION_BEGIN(stacktrace_fp_get)
 	# Add the stack bias to %sp to get the actual address.
 	retl
 	add %sp, STACK_BIAS, %o0
+FUNCTION_END(stacktrace_fp_get)
 
-stacktrace_pc_get:
+FUNCTION_BEGIN(stacktrace_pc_get)
 	retl
 	mov %o7, %o0
+FUNCTION_END(stacktrace_pc_get)
Index: uspace/lib/c/arch/sparc64/src/thread_entry.S
===================================================================
--- uspace/lib/c/arch/sparc64/src/thread_entry.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ uspace/lib/c/arch/sparc64/src/thread_entry.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2006 Jakub Jermar
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#include <abi/asmtool.h>
+
+.text
+	
+## User-space thread entry point for all but the first threads.
+#
+#
+SYMBOL(__thread_entry)
+	#
+	# Create the first stack frame.
+	#
+	save %sp, -176, %sp
+	flushw
+	add %g0, -0x7ff, %fp
+
+	#
+	# Propagate the input arguments to the new window.
+	#
+	mov %i0, %o0
+
+	sethi %hi(_gp), %l7
+	call __thread_main		! %o0 contains address of uarg
+	or %l7, %lo(_gp), %l7
+	
+	! not reached
Index: uspace/lib/c/arch/sparc64/src/thread_entry.s
===================================================================
--- uspace/lib/c/arch/sparc64/src/thread_entry.s	(revision ae7bbfd0bcf872d80ac6f3f37faf7fa216782613)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#
-# Copyright (c) 2006 Jakub Jermar
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-.text
-	
-.globl __thread_entry
-
-## User-space thread entry point for all but the first threads.
-#
-#
-__thread_entry:
-	#
-	# Create the first stack frame.
-	#
-	save %sp, -176, %sp
-	flushw
-	add %g0, -0x7ff, %fp
-
-	#
-	# Propagate the input arguments to the new window.
-	#
-	mov %i0, %o0
-
-	sethi %hi(_gp), %l7
-	call __thread_main		! %o0 contains address of uarg
-	or %l7, %lo(_gp), %l7
-	
-	! not reached
-	
-.end __thread_entry
