Index: uspace/app/trace/ipcp.c
===================================================================
--- uspace/app/trace/ipcp.c	(revision f7176b1293322fdb522ad15cf0b12cc91a719138)
+++ uspace/app/trace/ipcp.c	(revision a5c3f731be694ca7380c472c0336a1f3501e4e22)
@@ -45,9 +45,9 @@
 
 typedef struct {
-	int phone_hash;
+	ipcarg_t phone_hash;
 	ipc_call_t question;
 	oper_t *oper;
 
-	int call_hash;
+	ipc_callid_t call_hash;
 
 	link_t link;
@@ -98,4 +98,5 @@
 	hs = hash_table_get_instance(item, pending_call_t, link);
 
+	// FIXME: this will fail if sizeof(long) < sizeof(void *).
 	return key[0] == hs->call_hash;
 }
@@ -135,9 +136,9 @@
 
 	if (oper != NULL) {
-		printf("%s (%d)", oper->name, method);
+		printf("%s (%ld)", oper->name, method);
 		return;
 	}
 
-	printf("%d", method);
+	printf("%ld", method);
 }
 
@@ -199,8 +200,8 @@
 
 	if ((display_mask & DM_IPC) != 0) {
-		printf("Call ID: 0x%x, phone: %d, proto: %s, method: ", hash,
+		printf("Call ID: 0x%lx, phone: %d, proto: %s, method: ", hash,
 			phone, (proto ? proto->name : "n/a"));
 		ipc_m_print(proto, IPC_GET_METHOD(*call));
-		printf(" args: (%u, %u, %u, %u, %u)\n", args[1], args[2],
+		printf(" args: (%lu, %lu, %lu, %lu, %lu)\n", args[1], args[2],
 		    args[3], args[4], args[5]);
 	}
@@ -258,8 +259,8 @@
     ipc_call_t *answer)
 {
-	int phone;
+	ipcarg_t phone;
 	ipcarg_t method;
 	ipcarg_t service;
-	int retval;
+	ipcarg_t retval;
 	proto_t *proto;
 	int cphone;
@@ -278,5 +279,5 @@
 
 	if ((display_mask & DM_IPC) != 0) {
-		printf("Response to 0x%x: retval=%d, args = (%u, %u, %u, %u, %u)\n",
+		printf("Response to 0x%lx: retval=%ld, args = (%lu, %lu, %lu, %lu, %lu)\n",
 			hash, retval, IPC_GET_ARG1(*answer),
 			IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
@@ -333,5 +334,5 @@
 /*	printf("phone: %d, method: ", call->in_phone_hash);
 	ipc_m_print(IPC_GET_METHOD(*call));
-	printf(" args: (%u, %u, %u, %u, %u)\n",
+	printf(" args: (%lu, %lu, %lu, %lu, %lu)\n",
 	    IPC_GET_ARG1(*call),
 	    IPC_GET_ARG2(*call),
@@ -344,5 +345,5 @@
 		/* Not a response */
 		if ((display_mask & DM_IPC) != 0) {
-			printf("Not a response (hash %d)\n", hash);
+			printf("Not a response (hash 0x%lx)\n", hash);
 		}
 		return;
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision f7176b1293322fdb522ad15cf0b12cc91a719138)
+++ uspace/app/trace/trace.c	(revision a5c3f731be694ca7380c472c0336a1f3501e4e22)
@@ -56,6 +56,6 @@
 
 #define THBUF_SIZE 64
-unsigned thread_hash_buf[THBUF_SIZE];
-unsigned n_threads;
+uintptr_t thread_hash_buf[THBUF_SIZE];
+int n_threads;
 
 int next_thread_id;
@@ -64,8 +64,8 @@
 int abort_trace;
 
-unsigned thash;
+uintptr_t thash;
 volatile int paused;
 
-void thread_trace_start(unsigned thread_hash);
+void thread_trace_start(uintptr_t thread_hash);
 
 static proto_t *proto_console;
@@ -126,11 +126,11 @@
 	}
 
-	n_threads = tb_copied / sizeof(unsigned);
+	n_threads = tb_copied / sizeof(uintptr_t);
 
 	printf("Threads:");
 	for (i = 0; i < n_threads; i++) {
-		printf(" [%d] (hash 0x%x)", 1+i, thread_hash_buf[i]);
-	}
-	printf("\ntotal of %u threads\n", tb_needed/sizeof(unsigned));
+		printf(" [%d] (hash 0x%lx)", 1+i, thread_hash_buf[i]);
+	}
+	printf("\ntotal of %u threads\n", tb_needed / sizeof(uintptr_t));
 
 	return 0;
@@ -197,20 +197,20 @@
 }
 
-static void print_sc_args(unsigned *sc_args, int n)
+static void print_sc_args(sysarg_t *sc_args, int n)
 {
 	int i;
 
 	putchar('(');
-	if (n > 0) printf("%d", sc_args[0]);
+	if (n > 0) printf("%ld", sc_args[0]);
 	for (i = 1; i < n; i++) {
-		printf(", %d", sc_args[i]);
+		printf(", %ld", sc_args[i]);
 	}
 	putchar(')');
 }
 
-static void sc_ipc_call_async_fast(unsigned *sc_args, int sc_rc)
+static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc)
 {
 	ipc_call_t call;
-	int phoneid;
+	ipcarg_t phoneid;
 	
 	if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY)
@@ -229,5 +229,5 @@
 }
 
-static void sc_ipc_call_async_slow(unsigned *sc_args, int sc_rc)
+static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc)
 {
 	ipc_call_t call;
@@ -245,5 +245,5 @@
 }
 
-static void sc_ipc_call_sync_fast(unsigned *sc_args)
+static void sc_ipc_call_sync_fast(sysarg_t *sc_args)
 {
 	ipc_call_t question, reply;
@@ -273,5 +273,5 @@
 }
 
-static void sc_ipc_call_sync_slow(unsigned *sc_args)
+static void sc_ipc_call_sync_slow(sysarg_t *sc_args)
 {
 	ipc_call_t question, reply;
@@ -291,5 +291,5 @@
 }
 
-static void sc_ipc_wait(unsigned *sc_args, int sc_rc)
+static void sc_ipc_wait(sysarg_t *sc_args, int sc_rc)
 {
 	ipc_call_t call;
@@ -308,7 +308,8 @@
 }
 
-static void event_syscall_b(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
-{
-	unsigned sc_args[6];
+static void event_syscall_b(unsigned thread_id, uintptr_t thread_hash,
+    unsigned sc_id, sysarg_t sc_rc)
+{
+	sysarg_t sc_args[6];
 	int rc;
 
@@ -335,7 +336,8 @@
 }
 
-static void event_syscall_e(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
-{
-	unsigned sc_args[6];
+static void event_syscall_e(unsigned thread_id, uintptr_t thread_hash,
+    unsigned sc_id, sysarg_t sc_rc)
+{
+	sysarg_t sc_args[6];
 	int rv_type;
 	int rc;
@@ -383,8 +385,8 @@
 }
 
-static void event_thread_b(unsigned hash)
+static void event_thread_b(uintptr_t hash)
 {
 	async_serialize_start();
-	printf("New thread, hash 0x%x\n", hash);
+	printf("New thread, hash 0x%lx\n", hash);
 	async_serialize_end();
 
@@ -396,12 +398,12 @@
 	int rc;
 	unsigned ev_type;
-	unsigned thread_hash;
+	uintptr_t thread_hash;
 	unsigned thread_id;
-	unsigned val0, val1;
-
-	thread_hash = (unsigned)thread_hash_arg;
+	sysarg_t val0, val1;
+
+	thread_hash = (uintptr_t)thread_hash_arg;
 	thread_id = next_thread_id++;
 
-	printf("Start tracing thread [%d] (hash 0x%x)\n", thread_id, thread_hash);
+	printf("Start tracing thread [%d] (hash 0x%lx)\n", thread_id, thread_hash);
 
 	while (!abort_trace) {
@@ -439,5 +441,5 @@
 				break;
 			case UDEBUG_EVENT_THREAD_E:
-				printf("Thread 0x%x exited\n", val0);
+				printf("Thread 0x%lx exited\n", val0);
 				abort_trace = 1;
 				break;
@@ -454,5 +456,5 @@
 }
 
-void thread_trace_start(unsigned thread_hash)
+void thread_trace_start(uintptr_t thread_hash)
 {
 	fid_t fid;
@@ -673,5 +675,5 @@
 
 	if (task_id != 0) {
-		if (argc == 0) return;
+		if (argc == 0) return 0;
 		printf("Extra arguments\n");
 		print_syntax();
