Index: uspace/lib/c/arch/sparc32/Makefile.inc
===================================================================
--- uspace/lib/c/arch/sparc32/Makefile.inc	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ uspace/lib/c/arch/sparc32/Makefile.inc	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
@@ -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/sparc32/src/entry.S
===================================================================
--- uspace/lib/c/arch/sparc32/src/entry.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
+++ uspace/lib/c/arch/sparc32/src/entry.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
@@ -0,0 +1,67 @@
+#
+# 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
+	## XXX	flushw
+	mov 7, %g1
+	1:
+		subcc %g1, 1, %g1
+		bg 1b
+		save %sp, -64, %sp
+	
+	mov 7, %g1
+	1:
+		subcc %g1, 1, %g1
+		bg 1b
+		restore
+	
+	## XXX end flush
+	## add %g0, -0x7ff, %fp
+	set 0x80000000, %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/sparc32/src/entry.s
===================================================================
--- uspace/lib/c/arch/sparc32/src/entry.s	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ 	(revision )
@@ -1,67 +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
-	## XXX	flushw
-	mov 7, %g1
-	1:
-		subcc %g1, 1, %g1
-		bg 1b
-		save %sp, -64, %sp
-	
-	mov 7, %g1
-	1:
-		subcc %g1, 1, %g1
-		bg 1b
-		restore
-	
-	## XXX end flush
-	## add %g0, -0x7ff, %fp
-	set 0x80000000, %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/sparc32/src/entryjmp.S
===================================================================
--- uspace/lib/c/arch/sparc32/src/entryjmp.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
+++ uspace/lib/c/arch/sparc32/src/entryjmp.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
@@ -0,0 +1,43 @@
+#
+# 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
+FUNCTION_BEGIN(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
+FUNCTION_END(entry_point_jmp)
Index: uspace/lib/c/arch/sparc32/src/entryjmp.s
===================================================================
--- uspace/lib/c/arch/sparc32/src/entryjmp.s	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ 	(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/sparc32/src/fibril.S
===================================================================
--- uspace/lib/c/arch/sparc32/src/fibril.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ uspace/lib/c/arch/sparc32/src/fibril.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
@@ -27,13 +27,10 @@
 #
 
+#include <abi/asmtool.h>
 #include <libarch/context_offset.h>
 
 .text
 
-.global flush_windows
-.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
@@ -56,6 +53,7 @@
 	retl
 	mov 1, %o0              ! context_save_arch returns 1
+FUNCTION_END(context_save)
 
-context_restore:
+FUNCTION_BEGIN(context_restore)
 	#
 	# Flush all active windows.
@@ -84,2 +82,3 @@
 	retl
 	xor %o0, %o0, %o0       ! context_restore_arch returns 0
+FUNCTION_END(context_restore)
Index: uspace/lib/c/arch/sparc32/src/stacktrace_asm.S
===================================================================
--- uspace/lib/c/arch/sparc32/src/stacktrace_asm.S	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ uspace/lib/c/arch/sparc32/src/stacktrace_asm.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
@@ -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
 	
@@ -53,11 +50,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
 	mov %sp,  %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/sparc32/src/thread_entry.S
===================================================================
--- uspace/lib/c/arch/sparc32/src/thread_entry.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
+++ uspace/lib/c/arch/sparc32/src/thread_entry.S	(revision 8a36bc1e508c3a617d71ab53048d228b31d763c9)
@@ -0,0 +1,67 @@
+#
+# 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
+	## XXX flushw
+	mov 7, %g1
+	1:
+		subcc %g1, 1, %g1
+		bg 1b
+		save %sp, -64, %sp
+	
+	mov 7, %g1
+	1:
+		subcc %g1, 1, %g1
+		bg 1b
+	
+	## XXX end flushw
+	set 0x80000000, %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/sparc32/src/thread_entry.s
===================================================================
--- uspace/lib/c/arch/sparc32/src/thread_entry.s	(revision b66cc977e145eaa74a7e9fe52a4a2e995c81ad02)
+++ 	(revision )
@@ -1,69 +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
-	## XXX flushw
-	mov 7, %g1
-	1:
-		subcc %g1, 1, %g1
-		bg 1b
-		save %sp, -64, %sp
-	
-	mov 7, %g1
-	1:
-		subcc %g1, 1, %g1
-		bg 1b
-	
-	## XXX end flushw
-	set 0x80000000, %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
