Index: uspace/lib/libc/arch/ia64/src/entry.s
===================================================================
--- uspace/lib/libc/arch/ia64/src/entry.s	(revision 3abe472f1a4f6b786d6b42b5f714cad40e76457f)
+++ uspace/lib/libc/arch/ia64/src/entry.s	(revision 4541ae41d7ce895a89a42a784040f0156fb8e79d)
@@ -35,11 +35,13 @@
 ## User-space task entry point
 #
+# r2 contains the PCB pointer
 #
 __entry:
 	alloc loc0 = ar.pfs, 0, 1, 2, 0
-	mov r1 = _gp 
+	mov r1 = _gp
+
+	# Pass PCB pointer as the first argument to __main
+	mov out0 = r2
 	br.call.sptk.many b0 = __main
 0:
-	br.call.sptk.many b0 = main
-1:
 	br.call.sptk.many b0 = __exit
