Index: boot/arch/ia64/src/asm.S
===================================================================
--- boot/arch/ia64/src/asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ boot/arch/ia64/src/asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -28,16 +28,14 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/arch.h>
 
 .text
 
-.global halt
-.global memcpy
-.global jump_to_kernel
+FUNCTION_BEGIN(halt)
+	br halt
+FUNCTION_END(halt)
 
-halt:
-	br halt
-
-jump_to_kernel:
+FUNCTION_BEGIN(jump_to_kernel)
 	alloc loc0 = ar.pfs, 1, 1, 0, 0
 	mov r2 = in0 ;;			# Pass bootinfo address
@@ -45,2 +43,4 @@
 	mov b1 = r8 ;;
 	br.call.sptk.many b0 = b1;;
+FUNCTION_END(jump_to_kernel)
+
Index: boot/arch/ia64/src/boot.S
===================================================================
--- boot/arch/ia64/src/boot.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ boot/arch/ia64/src/boot.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -28,10 +28,10 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/arch.h>
 
 .section BOOTSTRAP, "ax"
 
-.global start
-start:
+SYMBOL(start)
 	movl gp = __gp
 
@@ -69,6 +69,5 @@
 .bss
 
-.global bootpar
-bootpar:
+SYMBOL(bootpar)
 	.quad 0
 
Index: boot/arch/ia64/src/pal_asm.S
===================================================================
--- boot/arch/ia64/src/pal_asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ boot/arch/ia64/src/pal_asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,9 +27,9 @@
 #
 
+#include <abi/asmtool.h>
+
 .explicit
 
-.global pal_static_call
-
-pal_static_call:
+FUNCTION_BEGIN(pal_static_call)
 	alloc loc0 = ar.pfs, 7, 6, 0, 0
 
@@ -74,3 +74,4 @@
 	mov ar.pfs = loc0
 	br.ret.sptk.many rp
+FUNCTION_END(pal_static_call)
 
Index: boot/arch/ia64/src/sal_asm.S
===================================================================
--- boot/arch/ia64/src/sal_asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ boot/arch/ia64/src/sal_asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,4 +27,6 @@
 #
 
+#include <abi/asmtool.h>
+
 .explicit
 
@@ -33,6 +35,4 @@
 #define STACK_IN9		(8 + STACK_SCRATCH_AREA)
 #define STACK_IN10		(16 + STACK_SCRATCH_AREA)
-
-.global sal_call
 
 #
@@ -43,5 +43,5 @@
 # Assume PSR.bn is 1, as expected by SAL.
 #
-sal_call:
+FUNCTION_BEGIN(sal_call)
 	alloc loc0 = ar.pfs, 8, 8, 8, 0
 	
@@ -92,3 +92,4 @@
 	mov ar.pfs = loc0
 	br.ret.sptk.many rp
+FUNCTION_END(sal_call)
 
Index: kernel/arch/ia64/Makefile.inc
===================================================================
--- kernel/arch/ia64/Makefile.inc	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/Makefile.inc	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -43,5 +43,5 @@
 	arch/$(KARCH)/src/start.S \
 	arch/$(KARCH)/src/asm.S \
-	arch/$(KARCH)/src/dummy.s \
+	arch/$(KARCH)/src/dummy.S \
 	arch/$(KARCH)/src/ia64.c \
 	arch/$(KARCH)/src/fpu_context.c \
Index: kernel/arch/ia64/src/asm.S
===================================================================
--- kernel/arch/ia64/src/asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,11 +27,8 @@
  */
 
+#include <abi/asmtool.h>
 #include <arch/register.h>
 
 .text
-.global memcpy_from_uspace
-.global memcpy_to_uspace
-.global memcpy_from_uspace_failover_address
-.global memcpy_to_uspace_failover_address
 
 /** Copy memory from/to userspace.
@@ -46,6 +43,6 @@
  *
  */
-memcpy_from_uspace:
-memcpy_to_uspace:
+FUNCTION_BEGIN(memcpy_from_uspace)
+FUNCTION_BEGIN(memcpy_to_uspace)
 	alloc loc0 = ar.pfs, 3, 1, 0, 0
 	
@@ -132,7 +129,9 @@
 		mov ar.pfs = loc0
 		br.ret.sptk.many rp
+FUNCTION_END(memcpy_from_uspace)
+FUNCTION_END(memcpy_to_uspace)
 
-memcpy_from_uspace_failover_address:
-memcpy_to_uspace_failover_address:
+SYMBOL(memcpy_from_uspace_failover_address)
+SYMBOL(memcpy_to_uspace_failover_address)
 	/* Return 0 on failure */
 	mov r8 = r0
@@ -140,7 +139,7 @@
 	br.ret.sptk.many rp
 
-.global cpu_halt
-cpu_halt:
+FUNCTION_BEGIN(cpu_halt)
 	br cpu_halt
+FUNCTION_END(cpu_halt)
 
 /** Switch to userspace - low level code.
@@ -154,6 +153,5 @@
  *
  */
-.global switch_to_userspace
-switch_to_userspace:
+FUNCTION_BEGIN(switch_to_userspace)
 	alloc loc0 = ar.pfs, 6, 3, 0, 0
 	
@@ -191,6 +189,7 @@
 	
 	rfi ;;
+FUNCTION_END(switch_to_userspace)
 
-.global early_putchar
-early_putchar:
+FUNCTION_BEGIN(early_putchar)
 	br.ret.sptk.many b0
+FUNCTION_END(early_putchar)
Index: kernel/arch/ia64/src/context.S
===================================================================
--- kernel/arch/ia64/src/context.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/context.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,12 +27,10 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/context_struct.h>
 
 .text
 
-.global context_save_arch
-.global context_restore_arch
-
-context_save_arch:
+FUNCTION_BEGIN(context_save_arch)
 	alloc loc0 = ar.pfs, 1, 49, 0, 0
 	mov loc1 = ar.unat ;;
@@ -182,6 +180,7 @@
 	add r8 = r0, r0, 1 	/* context_save returns 1 */
 	br.ret.sptk.many b0
-
-context_restore_arch:
+FUNCTION_END(context_save_arch)
+
+FUNCTION_BEGIN(context_restore_arch)
 	alloc loc0 = ar.pfs, 1, 50, 0, 0	;;
 
@@ -338,3 +337,4 @@
 	mov r8 = r0			/* context_restore returns 0 */
 	br.ret.sptk.many b0
-
+FUNCTION_END(context_restore_arch)
+
Index: kernel/arch/ia64/src/debug/stacktrace_asm.S
===================================================================
--- kernel/arch/ia64/src/debug/stacktrace_asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/debug/stacktrace_asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,14 +27,16 @@
 #
 
+#include <abi/asmtool.h>
+
 .text
 
-.global frame_pointer_get
-.global program_counter_get
-
-frame_pointer_get:
+FUNCTION_BEGIN(frame_pointer_get)
 	mov r8 = r0
 	br.ret.sptk.many b0
+FUNCTION_END(frame_pointer_get)
 
-program_counter_get:
+FUNCTION_BEGIN(program_counter_get)
 	mov r8 = r0
 	br.ret.sptk.many b0
+FUNCTION_END(program_counter_get)
+
Index: kernel/arch/ia64/src/dummy.S
===================================================================
--- kernel/arch/ia64/src/dummy.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
+++ kernel/arch/ia64/src/dummy.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2005 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
+
+FUNCTION_BEGIN(calibrate_delay_loop)
+FUNCTION_BEGIN(asm_delay_loop)
+FUNCTION_BEGIN(cpu_sleep)
+	br.ret.sptk.many b0
+FUNCTION_END(calibrate_delay_loop)
+FUNCTION_END(asm_delay_loop)
+FUNCTION_END(cpu_sleep)
+
Index: rnel/arch/ia64/src/dummy.s
===================================================================
--- kernel/arch/ia64/src/dummy.s	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#
-# Copyright (c) 2005 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
-
-.global calibrate_delay_loop
-.global asm_delay_loop
-.global cpu_sleep
-.global dummy
-
-calibrate_delay_loop:
-asm_delay_loop:
-cpu_sleep:
-
-dummy:
-	br.ret.sptk.many b0
-
Index: kernel/arch/ia64/src/ivt.S
===================================================================
--- kernel/arch/ia64/src/ivt.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/ivt.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -28,4 +28,5 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/stack.h>
 #include <arch/register.h>
@@ -101,6 +102,5 @@
 .endm
 
-.global heavyweight_handler
-heavyweight_handler:
+SYMBOL(heavyweight_handler)
     /* 1. copy interrupt registers into bank 0 */
     
@@ -297,6 +297,5 @@
 	rfi ;;
 
-.global heavyweight_handler_inner
-heavyweight_handler_inner:
+FUNCTION_BEGIN(heavyweight_handler_inner)
 	/*
 	 * From this point, the rest of the interrupted context
@@ -538,8 +537,8 @@
 	mov ar.pfs = loc0
 	br.ret.sptk.many b0
-
-.global ivt
+FUNCTION_END(heavyweight_handler_inner)
+
 .align 32768
-ivt:
+SYMBOL(ivt)
 	HEAVYWEIGHT_HANDLER 0x00
 	HEAVYWEIGHT_HANDLER 0x04
Index: kernel/arch/ia64/src/start.S
===================================================================
--- kernel/arch/ia64/src/start.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ kernel/arch/ia64/src/start.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,4 +27,5 @@
 #
 
+#include <abi/asmtool.h>
 #include <arch/register.h>
 #include <arch/mm/page.h>
@@ -41,6 +42,4 @@
 .section K_TEXT_START, "ax"
 
-.global kernel_image_start
-
 stack0:
 
@@ -53,5 +52,5 @@
 #	r2	Address of the boot code's bootinfo structure.
 #
-kernel_image_start:
+SYMBOL(kernel_image_start)
 	.auto
 	
@@ -113,5 +112,4 @@
 	rfi ;;
 
-.global paging_start
 paging_start:
 	
Index: uspace/lib/c/arch/ia64/Makefile.inc
===================================================================
--- uspace/lib/c/arch/ia64/Makefile.inc	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ uspace/lib/c/arch/ia64/Makefile.inc	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -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/syscall.S \
 	arch/$(UARCH)/src/fibril.S \
Index: uspace/lib/c/arch/ia64/src/entry.S
===================================================================
--- uspace/lib/c/arch/ia64/src/entry.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
+++ uspace/lib/c/arch/ia64/src/entry.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -0,0 +1,46 @@
+#
+# 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>
+
+.section .init, "ax"
+
+.org 0
+
+## User-space task entry point
+#
+# r2 contains the PCB pointer
+#
+SYMBOL(__entry)
+	alloc loc0 = ar.pfs, 0, 1, 2, 0
+	movl gp = __gp
+	
+	# Pass PCB pointer as the first argument to __main
+	mov out0 = r2
+	br.call.sptk.many b0 = __main
+
Index: pace/lib/c/arch/ia64/src/entry.s
===================================================================
--- uspace/lib/c/arch/ia64/src/entry.s	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ 	(revision )
@@ -1,45 +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.
-#
-
-.section .init, "ax"
-
-.org 0
-
-.globl __entry
-
-## User-space task entry point
-#
-# r2 contains the PCB pointer
-#
-__entry:
-	alloc loc0 = ar.pfs, 0, 1, 2, 0
-	movl gp = __gp
-	
-	# Pass PCB pointer as the first argument to __main
-	mov out0 = r2
-	br.call.sptk.many b0 = __main
Index: uspace/lib/c/arch/ia64/src/entryjmp.S
===================================================================
--- uspace/lib/c/arch/ia64/src/entryjmp.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
+++ uspace/lib/c/arch/ia64/src/entryjmp.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -0,0 +1,45 @@
+#
+# 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>
+
+.text
+.explicit
+
+## void entry_point_jmp(void *entry_point, void *pcb);
+#
+# in0 (r32)	contains entry_point
+# in1 (r33)	contains pcb
+#
+# Jump to program entry point
+SYMBOL(entry_point_jmp)
+	# Pass pcb to the entry point in r2
+
+	mov b6 = r32
+	mov r2 = r33 ;;
+	br b6 ;;
Index: pace/lib/c/arch/ia64/src/entryjmp.s
===================================================================
--- uspace/lib/c/arch/ia64/src/entryjmp.s	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ 	(revision )
@@ -1,44 +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.
-#
-
-.text
-.explicit
-.globl entry_point_jmp
-
-## void entry_point_jmp(void *entry_point, void *pcb);
-#
-# in0 (r32)	contains entry_point
-# in1 (r33)	contains pcb
-#
-# Jump to program entry point
-entry_point_jmp:
-	# Pass pcb to the entry point in r2
-
-	mov b6 = r32
-	mov r2 = r33 ;;
-	br b6 ;;
Index: uspace/lib/c/arch/ia64/src/fibril.S
===================================================================
--- uspace/lib/c/arch/ia64/src/fibril.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ uspace/lib/c/arch/ia64/src/fibril.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -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)
 	alloc loc0 = ar.pfs, 1, 49, 0, 0
 	mov loc1 = ar.unat ;;
@@ -182,6 +180,7 @@
 	add r8 = r0, r0, 1 	/* context_save returns 1 */
 	br.ret.sptk.many b0
-
-context_restore:
+FUNCTION_END(context_save)
+
+FUNCTION_BEGIN(context_restore)
 	alloc loc0 = ar.pfs, 1, 50, 0, 0	;;
 
@@ -338,2 +337,4 @@
 	mov r8 = r0			/* context_restore returns 0 */
 	br.ret.sptk.many b0
+FUNCTION_END(context_restore)
+
Index: uspace/lib/c/arch/ia64/src/stacktrace_asm.S
===================================================================
--- uspace/lib/c/arch/ia64/src/stacktrace_asm.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ uspace/lib/c/arch/ia64/src/stacktrace_asm.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,15 +27,17 @@
 #
 
+#include <abi/asmtool.h>
+
 .text
 
-.global stacktrace_prepare
-.global stacktrace_fp_get
-.global stacktrace_pc_get
+FUNCTION_BEGIN(stacktrace_prepare)
+	br.ret.sptk.many b0
+FUNCTION_END(stacktrace_prepare)
 
-stacktrace_prepare:
-	br.ret.sptk.many b0
-
-stacktrace_fp_get:
-stacktrace_pc_get:
+FUNCTION_BEGIN(stacktrace_fp_get)
+FUNCTION_BEGIN(stacktrace_pc_get)
 	mov r8 = r0
 	br.ret.sptk.many b0
+FUNCTION_END(stacktrace_fp_get)
+FUNCTION_END(stacktrace_pc_get)
+
Index: uspace/lib/c/arch/ia64/src/syscall.S
===================================================================
--- uspace/lib/c/arch/ia64/src/syscall.S	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ uspace/lib/c/arch/ia64/src/syscall.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -27,4 +27,6 @@
 #
 
+#include <abi/asmtool.h>
+
 /**
  * Immediate operand for break instruction.
@@ -37,8 +39,9 @@
 #define SYSCALL_IMM	1
 
-.global __syscall
-__syscall:
+FUNCTION_BEGIN(__syscall)
 	alloc r14 = ar.pfs, 7, 0, 0, 0 ;;
 	break SYSCALL_IMM
 	mov ar.pfs = r14 ;;
 	br.ret.sptk.many b0
+FUNCTION_END(__syscall)
+
Index: uspace/lib/c/arch/ia64/src/thread_entry.S
===================================================================
--- uspace/lib/c/arch/ia64/src/thread_entry.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
+++ uspace/lib/c/arch/ia64/src/thread_entry.S	(revision 27f67f53b292b6b11b45be192ec9f6146a87fd85)
@@ -0,0 +1,51 @@
+#
+# 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)
+	alloc loc0 = ar.pfs, 0, 1, 1, 0
+
+	movl gp = __gp
+	
+	#
+	# r8 contains address of uarg structure.
+	#
+	
+	mov out0 = r8
+	br.call.sptk.many b0 = __thread_main
+	
+	#
+	# Not reached.
+	#
+
Index: pace/lib/c/arch/ia64/src/thread_entry.s
===================================================================
--- uspace/lib/c/arch/ia64/src/thread_entry.s	(revision 054476d01aca9bd28135fce64c7c46d84fe7398c)
+++ 	(revision )
@@ -1,52 +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:
-	alloc loc0 = ar.pfs, 0, 1, 1, 0
-
-	movl gp = __gp
-	
-	#
-	# r8 contains address of uarg structure.
-	#
-	
-	mov out0 = r8
-	br.call.sptk.many b0 = __thread_main
-	
-	#
-	# Not reached.
-	#
-	
-.end __thread_entry
