Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ HelenOS.config	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -545,2 +545,6 @@
 % Line debugging information
 ! [CONFIG_STRIP_BINARIES!=y] CONFIG_LINE_DEBUG (n/y)
+
+% Launch (devman) test drivers
+! [CONFIG_DEBUG=y] CONFIG_TEST_DRIVERS (y/n)
+
Index: Makefile
===================================================================
--- Makefile	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -28,4 +28,5 @@
 
 CSCOPE = cscope
+CHECK = tools/check.sh
 CONFIG = tools/config.py
 AUTOTOOL = tools/autotool.py
@@ -41,5 +42,5 @@
 CONFIG_HEADER = config.h
 
-.PHONY: all precheck cscope autotool config_default config distclean clean
+.PHONY: all precheck cscope autotool config_auto config_default config distclean clean check
 
 all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
@@ -55,4 +56,12 @@
 	find kernel boot uspace -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE).out
 
+# Pre-integration build check
+check: $(CHECK)
+ifdef JOBS 
+	$(CHECK) -j $(JOBS)
+else
+	$(CHECK)
+endif
+
 $(COMMON_MAKEFILE): autotool
 $(COMMON_HEADER): autotool
@@ -66,5 +75,9 @@
 
 config_default: $(CONFIG_RULES)
-	$(CONFIG) $< default
+ifeq ($(HANDS_OFF),y)
+	$(CONFIG) $< hands-off $(PROFILE)
+else
+	$(CONFIG) $< default $(PROFILE)
+endif
 
 config: $(CONFIG_RULES)
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/Makefile.common	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -109,5 +109,8 @@
 	
 RD_DRVS = \
-	root
+	root \
+	rootvirt \
+	test1 \
+	test2
 
 RD_DRV_CFG = 
Index: boot/arch/amd64/Makefile.inc
===================================================================
--- boot/arch/amd64/Makefile.inc	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/arch/amd64/Makefile.inc	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -37,5 +37,5 @@
 
 RD_DRVS += \
-	rootia32 \
+	rootpc \
 	pciintel \
 	isa \
Index: boot/arch/ia64/include/types.h
===================================================================
--- boot/arch/ia64/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/arch/ia64/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -35,5 +35,5 @@
 
 typedef uint64_t size_t;
-typedef uint64_t unative_t;
+typedef uint64_t sysarg_t;
 typedef uint64_t uintptr_t;
 
@@ -61,5 +61,5 @@
 	unsigned int memmap_items;
 
-	unative_t *sapic;
+	sysarg_t *sapic;
 	unsigned long sys_freq;
 	unsigned long freq_scale;
Index: boot/arch/mips32/src/Makefile
===================================================================
--- boot/arch/mips32/src/Makefile	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/arch/mips32/src/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -32,9 +32,13 @@
 .PHONY: all clean
 
-all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
+all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
 	-[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
 	$(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
 
 clean:
+	rm -f $(USPACEDIR)/dist/srv/*
+	rm -f $(USPACEDIR)/dist/app/*
+	rm -f $(USPACEDIR)/dist/cfg/net/*
+
 	for file in $(RD_SRVS) ; do \
 		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
@@ -43,4 +47,7 @@
 		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
 	done
+	for file in $(NET_CFG) ; do \
+		rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \
+	done
 	rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(RAW) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs
 	find . -name '*.o' -follow -exec rm \{\} \;
Index: boot/arch/mips32/src/Makefile.build
===================================================================
--- boot/arch/mips32/src/Makefile.build	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/arch/mips32/src/Makefile.build	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -32,6 +32,6 @@
 
 include ../../../../version
+include ../../../../Makefile.common
 include ../../../../Makefile.config
-include ../../../../config.defs
 include Makefile.common
 include Makefile.toolchain
@@ -77,4 +77,8 @@
 
 $(DEPEND):
+	rm -f $(USPACEDIR)/dist/srv/*
+	rm -f $(USPACEDIR)/dist/app/*
+	rm -f $(USPACEDIR)/dist/cfg/net/*
+
 	for file in $(RD_SRVS) ; do \
 		cp $$file $(USPACEDIR)/dist/srv/ ; \
@@ -82,4 +86,7 @@
 	for file in $(RD_APPS) ; do \
 		cp $$file $(USPACEDIR)/dist/app/ ; \
+	done
+	for file in $(NET_CFG) ; do \
+		cp $$file $(USPACEDIR)/dist/cfg/net/ ; \
 	done
 ifeq ($(RDFMT),tmpfs)
Index: boot/arch/mips32/src/Makefile.toolchain
===================================================================
--- boot/arch/mips32/src/Makefile.toolchain	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/arch/mips32/src/Makefile.toolchain	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -27,14 +27,5 @@
 #
 
-## Toolchain configuration
-#
-
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 BFD_ARCH = mips
-TARGET = mipsel-linux-gnu
-TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin
 
 JOBFILE = ../../../../tools/jobfile.py
@@ -48,6 +39,4 @@
 	BFD_NAME = elf32-tradbigmips
 	BFD = ecoff-bigmips
-	TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin
-	TARGET = mips-linux-gnu
 endif
 
@@ -55,20 +44,4 @@
 	BFD_NAME = elf32-tradlittlemips
 	BFD = binary
-endif
-
-ifeq ($(COMPILER),gcc_native)
-	CC = gcc
-	AS = as
-	LD = ld
-	OBJCOPY = objcopy
-	OBJDUMP = objdump
-endif
-
-ifeq ($(COMPILER),gcc_cross)
-	CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
-	AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
-	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
-	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
-	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
 endif
 
Index: boot/arch/ppc32/include/types.h
===================================================================
--- boot/arch/ppc32/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/arch/ppc32/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -35,5 +35,5 @@
 typedef uint32_t size_t;
 typedef uint32_t uintptr_t;
-typedef uint32_t unative_t;
+typedef uint32_t sysarg_t;
 typedef int32_t native_t;
 
Index: boot/arch/sparc64/include/types.h
===================================================================
--- boot/arch/sparc64/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/arch/sparc64/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -35,5 +35,5 @@
 typedef uint64_t size_t;
 typedef uint64_t uintptr_t;
-typedef uint64_t unative_t;
+typedef uint64_t sysarg_t;
 typedef int64_t native_t;
 
Index: boot/genarch/include/ofw.h
===================================================================
--- boot/genarch/include/ofw.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ boot/genarch/include/ofw.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -40,5 +40,5 @@
 #define OFW_TREE_PROPERTY_MAX_VALUELEN  64
 
-typedef unative_t ofw_arg_t;
+typedef sysarg_t ofw_arg_t;
 typedef native_t ofw_ret_t;
 typedef uint32_t ofw_prop_t;
Index: contrib/arch/hadlbppp.py
===================================================================
--- contrib/arch/hadlbppp.py	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/hadlbppp.py	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1151,5 +1151,5 @@
 					continue
 				
-				if ((token == "ipcarg_t") or (token == "unative_t")):
+				if (token == "sysarg_t"):
 					output += "\n%s%s " % (tabs(indent), token)
 					context.add(PROTOTYPE)
Index: contrib/arch/kernel/kernel.adl
===================================================================
--- contrib/arch/kernel/kernel.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/kernel/kernel.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -5,5 +5,5 @@
 interface sys_klog {
 		/* Print using kernel facility */
-		unative_t sys_klog(int fd, const void *buf, size_t size);
+		sysarg_t sys_klog(int fd, const void *buf, size_t size);
 	protocol:
 		?sys_klog*
@@ -12,8 +12,8 @@
 interface sys_console {
 		/* Enable kernel console */
-		unative_t sys_debug_enable_console(void);
+		sysarg_t sys_debug_enable_console(void);
 		
 		/* Disable kernel console */
-		unative_t sys_debug_disable_console(void);
+		sysarg_t sys_debug_disable_console(void);
 	protocol:
 		(
@@ -25,5 +25,5 @@
 interface sys_tls {
 		/* Set thread-local storage pointer (on architectures where kernel mode is required) */
-		unative_t sys_tls_set(unative_t addr);
+		sysarg_t sys_tls_set(sysarg_t addr);
 	protocol:
 		?sys_tls_set*
@@ -32,11 +32,11 @@
 interface sys_thread {
 		/* Create new thread */
-		unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, size_t name_len, thread_id_t *uspace_thread_id);
+		sysarg_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, size_t name_len, thread_id_t *uspace_thread_id);
 		
 		/* Terminate current thread */
-		unative_t sys_thread_exit(int uspace_status);
+		sysarg_t sys_thread_exit(int uspace_status);
 		
 		/* Get current thread id */
-		unative_t sys_thread_get_id(thread_id_t *uspace_thread_id);
+		sysarg_t sys_thread_get_id(thread_id_t *uspace_thread_id);
 	protocol:
 		(
@@ -49,8 +49,8 @@
 interface sys_task {
 		/* Set name fo the current task */
-		unative_t sys_task_set_name(const char *uspace_name, size_t name_len);
+		sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len);
 		
 		/* Get current task id */
-		unative_t sys_task_get_id(task_id_t *uspace_task_id);
+		sysarg_t sys_task_get_id(task_id_t *uspace_task_id);
 	protocol:
 		(
@@ -62,5 +62,5 @@
 interface sys_program {
 		/* Spawn a new instance of clonable loader service */
-		unative_t sys_program_spawn_loader(char *uspace_name, size_t name_len);
+		sysarg_t sys_program_spawn_loader(char *uspace_name, size_t name_len);
 	protocol:
 		?sys_program_spawn_loader*
@@ -69,8 +69,8 @@
 interface sys_futex {
 		/* Sleep in a futex wait queue */
-		unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags);
+		sysarg_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags);
 		
 		/* Wakeup one thread waiting in futex wait queue */
-		unative_t sys_futex_wakeup(uintptr_t uaddr);
+		sysarg_t sys_futex_wakeup(uintptr_t uaddr);
 	protocol:
 		(
@@ -82,5 +82,5 @@
 interface sys_smc {
 		/* Enforce self-modifying code cache coherency */
-		unative_t sys_smc_coherence(uintptr_t va, size_t size);
+		sysarg_t sys_smc_coherence(uintptr_t va, size_t size);
 	protocol:
 		?sys_smc_coherence*
@@ -89,14 +89,14 @@
 interface sys_as {
 		/* Create new address space area */
-		unative_t sys_as_area_create(uintptr_t address, size_t size, int flags);
+		sysarg_t sys_as_area_create(uintptr_t address, size_t size, int flags);
 		
 		/* Resize an address space area */
-		unative_t sys_as_area_resize(uinptr_t address, size_t size, int flags);
+		sysarg_t sys_as_area_resize(uinptr_t address, size_t size, int flags);
 		
 		/* Change flags of an address space area */
-		unative_t sys_as_area_change_flags(uintptr_t address, int flags);
+		sysarg_t sys_as_area_change_flags(uintptr_t address, int flags);
 		
 		/* Destroy an address space area */
-		unative_t sys_as_area_destroy(uintptr_t address);
+		sysarg_t sys_as_area_destroy(uintptr_t address);
 	protocol:
 		(
@@ -110,35 +110,35 @@
 interface sys_ipc {
 		/* Fast synchronous IPC call */
-		unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data);
+		sysarg_t sys_ipc_call_sync_fast(sysarg_t phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, ipc_data_t *data);
 		
 		/* Slow synchronous IPC call */
-		unative_t sys_ipc_call_sync_slow(unative_t phoneid, ipc_data_t *question, ipc_data_t *answer);
+		sysarg_t sys_ipc_call_sync_slow(sysarg_t phoneid, ipc_data_t *question, ipc_data_t *answer);
 		
 		/* Fast asynchronous IPC call */
-		unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4);
+		sysarg_t sys_ipc_call_async_fast(sysarg_t phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4);
 		
 		/* Slow asynchronous IPC call */
-		unative_t sys_ipc_call_async_slow(unative_t phoneid, ipc_data_t *data);
+		sysarg_t sys_ipc_call_async_slow(sysarg_t phoneid, ipc_data_t *data);
 		
 		/* Fast forward a received IPC call to another destination */
-		unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid, unative_t method, unative_t arg1, unative_t arg2, int mode);
+		sysarg_t sys_ipc_forward_fast(sysarg_t callid, sysarg_t phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, int mode);
 		
 		/* Slow forward a received IPC call to another destination */
-		unative_t sys_ipc_forward_slow(unative_t callid, unative_t phoneid, ipc_data_t *data, int mode);
+		sysarg_t sys_ipc_forward_slow(sysarg_t callid, sysarg_t phoneid, ipc_data_t *data, int mode);
 		
 		/* Fast answer an IPC call */
-		unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval, unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4);
+		sysarg_t sys_ipc_answer_fast(sysarg_t callid, sysarg_t retval, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4);
 		
 		/* Slow answer an IPC call */
-		unative_t sys_ipc_answer_slow(unative_t callid, ipc_data_t *data);
+		sysarg_t sys_ipc_answer_slow(sysarg_t callid, ipc_data_t *data);
 		
 		/* Hang up a phone */
-		unative_t sys_ipc_hangup(int phoneid);
+		sysarg_t sys_ipc_hangup(int phoneid);
 		
 		/* Wait for an incoming IPC call or answer */
-		unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int flags);
+		sysarg_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int flags);
 		
 		/* Interrupt one thread of the current task from waiting on IPC call */
-		unative_t sys_ipc_poke(void);
+		sysarg_t sys_ipc_poke(void);
 	protocol:
 		(
@@ -159,5 +159,5 @@
 interface sys_event {
 		/* Subscribe to kernel event notifications */
-		unative_t sys_event_subscribe(unative_t evno, unative_t method);
+		sysarg_t sys_event_subscribe(sysarg_t evno, sysarg_t method);
 	protocol:
 		?sys_event_subscribe*
@@ -166,8 +166,20 @@
 interface sys_cap {
 		/* Grant capabilities to a task */
-		unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps);
+#ifdef __32_BITS__
+		sysarg_t sys_cap_grant(sysarg64_t *uspace_taskid, cap_t caps);
+#endif
+		
+#ifdef __64_BITS__
+		sysarg_t sys_cap_grant(sysarg_t taskid, cap_t caps);
+#endif
 		
 		/* Revoke capabilities from a task */
-		unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps);
+#ifdef __32_BITS__
+		sysarg_t sys_cap_revoke(sysarg64_t *uspace_taskid, cap_t caps);
+#endif
+		
+#ifdef __64_BITS__
+		sysarg_t sys_cap_revoke(sysarg_t taskid, cap_t caps);
+#endif
 	protocol:
 		(
@@ -179,20 +191,20 @@
 interface sys_ddi {
 		/* Enable access I/O address space for the current task */
-		unative_t sys_enable_iospace(ddi_ioarg_t *uspace_io_arg);
+		sysarg_t sys_enable_iospace(ddi_ioarg_t *uspace_io_arg);
 		
 		/* Map physical memory to the current task's address space */
-		unative_t sys_physmem_map(unative_t phys_base, unative_t virt_base, unative_t pages, unative_t flags);
+		sysarg_t sys_physmem_map(sysarg_t phys_base, sysarg_t virt_base, sysarg_t pages, sysarg_t flags);
 		
 		/* Enable or disable preemption */
-		unative_t sys_preempt_control(int enable);
+		sysarg_t sys_preempt_control(int enable);
 		
 		/* Assign unique device number */
-		unative_t sys_device_assign_devno(void);
+		sysarg_t sys_device_assign_devno(void);
 		
 		/* Connect an IRQ handler to the current task */
-		unative_t sys_ipc_register_irq(inr_t inr, devno_t devno, unative_t method, irq_code_t *ucode);
+		sysarg_t sys_ipc_register_irq(inr_t inr, devno_t devno, sysarg_t method, irq_code_t *ucode);
 		
 		/* Disconnect an IRQ handler from the current task */
-		unative_t sys_ipc_unregister_irq(inr_t inr, devno_t devno);
+		sysarg_t sys_ipc_unregister_irq(inr_t inr, devno_t devno);
 	protocol:
 		(
@@ -208,8 +220,8 @@
 interface sys_sysinfo {
 		/* Check for sysinfo key validity */
-		unative_t sys_sysinfo_valid(unative_t ptr, unative_t len);
+		sysarg_t sys_sysinfo_valid(sysarg_t ptr, sysarg_t len);
 		
 		/* Get sysinfo key value */
-		unative_t sys_sysinfo_value(unatice_t ptr, unative_t len);
+		sysarg_t sys_sysinfo_value(unatice_t ptr, sysarg_t len);
 	protocol:
 		(
@@ -221,5 +233,11 @@
 interface sys_debug {
 		/* Connect to the kernel debugging answerbox of a given task */
-		unative_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid_arg);
+#ifdef __32_BITS__
+		sysarg_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid);
+#endif
+		
+#ifdef __64_BITS__
+		sysarg_t sys_ipc_connect_kbox(sysarg_t taskid);
+#endif
 	protocol:
 		?sys_ipc_connect_kbox*
Index: contrib/arch/uspace/srv/bd/bd.adl
===================================================================
--- contrib/arch/uspace/srv/bd/bd.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/bd/bd.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,14 +1,14 @@
 interface bd extends service {
 		/* Share out data buffer */
-		ipcarg_t ipc_m_share_out(in ipcarg_t as_area_base, in ipcarg_t as_area_size, in ipcarg_t flags, out ipcarg_t dst_as_area_base);
+		sysarg_t ipc_m_share_out(in sysarg_t as_area_base, in sysarg_t as_area_size, in sysarg_t flags, out sysarg_t dst_as_area_base);
 		
 		/* Get block size */
-		ipcarg_t get_block_size(out ipcarg_t block_size);
+		sysarg_t get_block_size(out sysarg_t block_size);
 		
 		/* Read blocks via shared data buffer */
-		ipcarg_t read_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
+		sysarg_t read_blocks(in sysarg_t index_lower, in sysarg_t index_upper, in sysarg_t count);
 		
 		/* Write blocks via shared data buffer */
-		ipcarg_t write_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
+		sysarg_t write_blocks(in sysarg_t index_lower, in sysarg_t index_upper, in sysarg_t count);
 	protocol:
 		[bd.bp]
Index: contrib/arch/uspace/srv/console/console.adl
===================================================================
--- contrib/arch/uspace/srv/console/console.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/console/console.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,41 +1,41 @@
 interface console extends service {
 		/* Read characters from console */
-		ipcarg_t read(out_copy stream data);
+		sysarg_t read(out_copy stream data);
 		
 		/* Write characters to console */
-		ipcarg_t write(in_copy stream data);
+		sysarg_t write(in_copy stream data);
 		
 		/* Get last event from event queue */
-		ipcarg_t get_event(out ipcarg_t type, out ipcarg_t key, out ipcarg_t mods, out ipcarg_t char);
+		sysarg_t get_event(out sysarg_t type, out sysarg_t key, out sysarg_t mods, out sysarg_t char);
 		
 		/* Flush output buffer */
-		ipcarg_t sync(void);
+		sysarg_t sync(void);
 		
 		/* Clear console */
-		ipcarg_t clear(void);
+		sysarg_t clear(void);
 		
 		/* Move cursor to given position */
-		ipcarg_t goto(in ipcarg_t col, in ipcarg_t row);
+		sysarg_t goto(in sysarg_t col, in sysarg_t row);
 		
 		/* Get console dimensions (in character cells) */
-		ipcarg_t get_size(out ipcarg_t cols, in ipcarg_t rows);
+		sysarg_t get_size(out sysarg_t cols, in sysarg_t rows);
 		
 		/* Get color capabilities */
-		ipcarg_t get_color_cap(void);
+		sysarg_t get_color_cap(void);
 		
 		/* Set abstract text style */
-		ipcarg_t set_style(in ipcarg_t style);
+		sysarg_t set_style(in sysarg_t style);
 		
 		/* Set EGA-based text color */
-		ipcarg_t set_color(in ipcarg_t fb_color, in ipcarg_t bg_color, in ipcarg_t attr);
+		sysarg_t set_color(in sysarg_t fb_color, in sysarg_t bg_color, in sysarg_t attr);
 		
 		/* Set RGB-based text color */
-		ipcarg_t set_rgb_color(in ipcarg_t fb_color, in ipcarg_t bg_color);
+		sysarg_t set_rgb_color(in sysarg_t fb_color, in sysarg_t bg_color);
 		
 		/* Set cursor visibility */
-		ipcarg_t cursor_visibility(in ipcarg_t visible);
+		sysarg_t cursor_visibility(in sysarg_t visible);
 		
 		/* Switch to kernel debugging console (if available) */
-		ipcarg_t kcon_enable(void);
+		sysarg_t kcon_enable(void);
 	protocol:
 		[console.bp]
Index: contrib/arch/uspace/srv/devmap/devmap.adl
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/devmap/devmap.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,26 +1,26 @@
 interface devmap_driver {
 		/* Establish connection (iface is DEVMAP_DRIVER) */
-		ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface);
+		sysarg_t ipc_m_connect_me_to(in sysarg_t iface);
 		
 		/* Register as a new driver */
-		ipcarg_t driver_register(in_copy string name);
+		sysarg_t driver_register(in_copy string name);
 		
 		/* Unregister all devices and the driver itself */
-		ipcarg_t driver_unregister(void);
+		sysarg_t driver_unregister(void);
 		
 		/* Register new device and return handle */
-		ipcarg_t device_register(in_copy string name, out ipcarg_t handle);
+		sysarg_t device_register(in_copy string name, out sysarg_t handle);
 		
 		/* Unregister device */
-		ipcarg_t device_unregister(in ipcarg_t handle);
+		sysarg_t device_unregister(in sysarg_t handle);
 		
 		/* Resolve device name to handle */
-		ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
+		sysarg_t device_get_handle(in sysarg_t flags, in_copy string name);
 		
 		/* Get device name for a given handle */
-		ipcarg_t device_get_name(in ipcarg_t handle);
+		sysarg_t device_get_name(in sysarg_t handle);
 		
 		/* Close connection */
-		ipcarg_t ipc_m_phone_hungup(void);
+		sysarg_t ipc_m_phone_hungup(void);
 	protocol:
 		[devmap_driver.bp]
@@ -29,26 +29,26 @@
 interface devmap_client {
 		/* Establish connection (iface is DEVMAP_CLIENT) or forward to device (iface is DEVMAP_CONNECT_TO_DEVICE) */
-		ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface, in ipcarg_t handle);
+		sysarg_t ipc_m_connect_me_to(in sysarg_t iface, in sysarg_t handle);
 		
 		/* Resolve device name to handle */
-		ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
+		sysarg_t device_get_handle(in sysarg_t flags, in_copy string name);
 		
 		/* Get device name for a given handle */
-		ipcarg_t device_get_name(in ipcarg_t handle);
+		sysarg_t device_get_name(in sysarg_t handle);
 		
 		/* Clone NULL device */
-		ipcarg_t device_null_create(out ipcarg_t index);
+		sysarg_t device_null_create(out sysarg_t index);
 		
 		/* Destroy NULL device */
-		ipcarg_t device_null_destroy(in ipcarg_t index);
+		sysarg_t device_null_destroy(in sysarg_t index);
 		
 		/* Get number of devices */
-		ipcarg_t device_get_count(out ipcarg_t count);
+		sysarg_t device_get_count(out sysarg_t count);
 		
 		/* Get an array of (device_name, handle) pairs */
-		ipcarg_t device_get_devices(out_copy stream data);
+		sysarg_t device_get_devices(out_copy stream data);
 		
 		/* Close connection */
-		ipcarg_t ipc_m_phone_hungup(void);
+		sysarg_t ipc_m_phone_hungup(void);
 	protocol:
 		[devmap_client.bp]
Index: contrib/arch/uspace/srv/fb/fb.adl
===================================================================
--- contrib/arch/uspace/srv/fb/fb.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/fb/fb.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,98 +1,98 @@
 interface fb extends service {
 		/* Get screen resolution */
-		ipcarg_t get_resolution(out ipcarg_t width, out ipcarg_t height);
+		sysarg_t get_resolution(out sysarg_t width, out sysarg_t height);
 		
 		/* Yield screen */
-		ipcarg_t screen_yield(void);
+		sysarg_t screen_yield(void);
 		
 		/* Reclaim screen */
-		ipcarg_t screen_reclaim(void);
+		sysarg_t screen_reclaim(void);
 		
 		/* Set mouse cursor position on screen */
-		ipcarg_t pointer_move(in ipcarg_t x, in ipcarg_t y);
+		sysarg_t pointer_move(in sysarg_t x, in sysarg_t y);
 		
 		/* Create new viewport */
-		ipcarg_t viewport_create(in ipcarg_t origin, in ipcarg_t dimension);
+		sysarg_t viewport_create(in sysarg_t origin, in sysarg_t dimension);
 		
 		/* Get viewport size in character cells */
-		ipcarg_t get_csize(out ipcarg_t width, out ipcarg_t height);
+		sysarg_t get_csize(out sysarg_t width, out sysarg_t height);
 		
 		/* Clear viewport character buffer */
-		ipcarg_t clear(void);
+		sysarg_t clear(void);
 		
 		/* Scroll viewport character buffer */
-		ipcarg_t scroll(in ipcarg_t lines);
+		sysarg_t scroll(in sysarg_t lines);
 		
 		/* Set active viewport */
-		ipcarg_t viewport_switch(in ipcarg_t index);
+		sysarg_t viewport_switch(in sysarg_t index);
 		
 		/* Delete viewport */
-		ipcarg_t viewport_delete(in ipcarg_t index);
+		sysarg_t viewport_delete(in sysarg_t index);
 		
 		/* Get color capabilities of the screen */
-		ipcarg_t get_color_cap(void);
+		sysarg_t get_color_cap(void);
 		
 		/* Set abstract text style */
-		ipcarg_t set_style(in ipcarg_t style);
+		sysarg_t set_style(in sysarg_t style);
 		
 		/* Set EGA-based text color */
-		ipcarg_t set_color(in ipcarg_t fg_color, in ipcarg_t bg_color, in ipcarg_t atrr);
+		sysarg_t set_color(in sysarg_t fg_color, in sysarg_t bg_color, in sysarg_t atrr);
 		
 		/* Set RGB-based text color */
-		ipcarg_t set_rgb_color(in ipcarg_t fg_color, in ipcarg_t bg_color);
+		sysarg_t set_rgb_color(in sysarg_t fg_color, in sysarg_t bg_color);
 		
 		/* Put a character to a given position in viewport character buffer */
-		ipcarg_t putchar(in ipcarg_t char, in ipcarg_t col, in ipcarg_t row);
+		sysarg_t putchar(in sysarg_t char, in sysarg_t col, in sysarg_t row);
 		
 		/* Set character cursor visibility in viewport */
-		ipcarg_t cursor_visibility(in ipcarg_t visible);
+		sysarg_t cursor_visibility(in sysarg_t visible);
 		
 		/* Set character cursor position in viewport */
-		ipcarg_t cursor_goto(in ipcarg_t col, in ipcarg_t row);
+		sysarg_t cursor_goto(in sysarg_t col, in sysarg_t row);
 		
 		/* Prepare memory sharing of bitmaps */
-		ipcarg_t prepare_shm(in ipcarg_t as_area_base);
+		sysarg_t prepare_shm(in sysarg_t as_area_base);
 		
 		/* Share bitmap or text data */
-		ipcarg_t ipc_m_share_out(in ipcarg_t as_area_base, in ipcarg_t as_area_size, out ipcarg_t dst_as_area);
+		sysarg_t ipc_m_share_out(in sysarg_t as_area_base, in sysarg_t as_area_size, out sysarg_t dst_as_area);
 		
 		/* Drop memory sharing */
-		ipcarg_t drop_shm(void);
+		sysarg_t drop_shm(void);
 		
 		/* Draw PPM data from shared memory to viewport */
-		ipcarg_t draw_ppm(in ipcarg_t x, in ipcarg_t y);
+		sysarg_t draw_ppm(in sysarg_t x, in sysarg_t y);
 		
 		/* Put characters from shared memory to viewport */
-		ipcarg_t draw_text_data(in ipcarg_t x, in ipcarg_t y, in ipcarg_t width, in ipcarg_t height);
+		sysarg_t draw_text_data(in sysarg_t x, in sysarg_t y, in sysarg_t width, in sysarg_t height);
 		
 		/* Convert PPM data from shared memory to pixmap */
-		ipcarg_t shm2pixmap(void);
+		sysarg_t shm2pixmap(void);
 		
 		/* Save viewport contents to a pixmap */
-		ipcarg_t vp2pixmap(in ipcarg_t vp_index);
+		sysarg_t vp2pixmap(in sysarg_t vp_index);
 		
 		/* Draw pixmap to viewport */
-		ipcarg_t vp_draw_pixmap(in ipcarg_t vp_index, in ipcarg_t pm_index);
+		sysarg_t vp_draw_pixmap(in sysarg_t vp_index, in sysarg_t pm_index);
 		
 		/* Discard pixmap */
-		ipcarg_t drop_pixmap(in ipcarg_t pm_index);
+		sysarg_t drop_pixmap(in sysarg_t pm_index);
 		
 		/* Create new (empty) animation for a viewport */
-		ipcarg_t anim_create(in ipcarg_t vp_index);
+		sysarg_t anim_create(in sysarg_t vp_index);
 		
 		/* Append a pixmap to an animation */
-		ipcarg_t anim_addpixmap(in ipcarg_t anim_index, in ipcarg_t pm_index);
+		sysarg_t anim_addpixmap(in sysarg_t anim_index, in sysarg_t pm_index);
 		
 		/* Change a viewport associated with an animation */
-		ipcarg_t anim_chgvp(in ipcarg_t anim_index, in ipcarg_t vp_index);
+		sysarg_t anim_chgvp(in sysarg_t anim_index, in sysarg_t vp_index);
 		
 		/* Start animation playback */
-		ipcarg_t anim_start(in ipcarg_t anim_index);
+		sysarg_t anim_start(in sysarg_t anim_index);
 		
 		/* Stop animation playback */
-		ipcarg_t anim_stop(in ipcarg_t anim_index);
+		sysarg_t anim_stop(in sysarg_t anim_index);
 		
 		/* Delete animation */
-		ipcarg_t anim_drop(in ipcarg_t anim_index);
+		sysarg_t anim_drop(in sysarg_t anim_index);
 	protocol:
 		[fb.bp]
Index: contrib/arch/uspace/srv/kbd/kbd.adl
===================================================================
--- contrib/arch/uspace/srv/kbd/kbd.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/kbd/kbd.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,11 +1,11 @@
 interface kbd extends service {
 		/* Callback connection */
-		ipcarg_t ipc_m_connect_to_me(void);
+		sysarg_t ipc_m_connect_to_me(void);
 		
 		/* Yield hardware */
-		ipcarg_t yield(void);
+		sysarg_t yield(void);
 		
 		/* Reclaim hardware */
-		ipcarg_t reclaim(void);
+		sysarg_t reclaim(void);
 	protocol:
 		[kbd.bp]
@@ -14,5 +14,5 @@
 interface event {
 		/* Send keyboard event */
-		ipcarg_t event(in ipcarg_t type, in ipcarg_t key, in ipcarg_t mods, in ipcarg_t char);
+		sysarg_t event(in sysarg_t type, in sysarg_t key, in sysarg_t mods, in sysarg_t char);
 	protocol:
 		[event.bp]
Index: contrib/arch/uspace/srv/loader/loader.adl
===================================================================
--- contrib/arch/uspace/srv/loader/loader.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/loader/loader.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,20 +1,20 @@
 interface loader extends service {
 		/* Set task pathname */
-		ipcarg_t set_pathname(in_copy string pathname);
+		sysarg_t set_pathname(in_copy string pathname);
 		
 		/* Set task arguments */
-		ipcarg_t set_args(in_copy stream args);
+		sysarg_t set_args(in_copy stream args);
 		
 		/* Set task initial files */
-		ipcarg_t set_files(in_copy stream files);
+		sysarg_t set_files(in_copy stream files);
 		
 		/* Get task ID */
-		ipcarg_t get_taskid(out_copy stream id);
+		sysarg_t get_taskid(out_copy stream id);
 		
 		/* Load binary */
-		ipcarg_t load(void);
+		sysarg_t load(void);
 		
 		/* Run binary */
-		ipcarg_t run(void);
+		sysarg_t run(void);
 	protocol:
 		[loader.bp]
Index: contrib/arch/uspace/srv/ns/ns.adl
===================================================================
--- contrib/arch/uspace/srv/ns/ns.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/ns/ns.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,26 +1,26 @@
 interface ns {
 		/* Register a clonable service or a generic service */
-		ipcarg_t ipc_m_connect_to_me(in ipcarg_t service);
+		sysarg_t ipc_m_connect_to_me(in sysarg_t service);
 		
 		/* Connect to a clonable service or a generic service */
-		ipcarg_t ipc_m_connect_me_to(in ipcarg_t service, in ipcarg_t arg2, in ipcarg_t arg3, in ipcarg_t flags);
+		sysarg_t ipc_m_connect_me_to(in sysarg_t service, in sysarg_t arg2, in sysarg_t arg3, in sysarg_t flags);
 		
 		/* Share real-time clock page or klog page */
-		ipcarg_t ipc_m_share_in(in ipcarg_t as_area_base, in ipcarg_t as_area_size, in ipcarg_t service);
+		sysarg_t ipc_m_share_in(in sysarg_t as_area_base, in sysarg_t as_area_size, in sysarg_t service);
 		
 		/* For IPC testing purposes */
-		ipcarg_t ping(void);
+		sysarg_t ping(void);
 		
 		/* Wait for task exit and get exit status and return value */
-		ipcarg_t task_wait(in ipcarg_t id_lower, in ipcarg_t id_upper, out ipcarg_t status, out ipcarg_t retval);
+		sysarg_t task_wait(in sysarg_t id_lower, in sysarg_t id_upper, out sysarg_t status, out sysarg_t retval);
 		
 		/* Introduce a new loader task id in such a way it cannot be spoofed */
-		ipcarg_t id_intro(in ipcarg_t id_lower, in ipcarg_t id_upper);
+		sysarg_t id_intro(in sysarg_t id_lower, in sysarg_t id_upper);
 		
 		/* Set task return value */
-		ipcarg_t retval(in ipcarg_t retval);
+		sysarg_t retval(in sysarg_t retval);
 		
 		/* Implicit connection close */
-		ipcarg_t ipc_m_phone_hungup(void);
+		sysarg_t ipc_m_phone_hungup(void);
 	protocol:
 		[ns.bp]
Index: contrib/arch/uspace/srv/ns/service.adl
===================================================================
--- contrib/arch/uspace/srv/ns/service.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/ns/service.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -2,7 +2,7 @@
 		/* Establish connection with the service
 		   (this call is forwarded from Naming Service or Device Mapper) */
-		ipcarg_t ipc_m_connect_me_to(void);
+		sysarg_t ipc_m_connect_me_to(void);
 		
 		/* Close connection */
-		ipcarg_t ipc_m_phone_hungup(void);
+		sysarg_t ipc_m_phone_hungup(void);
 };
Index: contrib/arch/uspace/srv/vfs/vfs.adl
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs.adl	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/arch/uspace/srv/vfs/vfs.adl	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,50 +1,50 @@
 interface vfs extends service {
 		/* Register a filesystem driver */
-		ipcarg_t register(in_copy string name);
+		sysarg_t register(in_copy string name);
 		
 		/* Mount filesystem */
-		ipcarg_t mount(in ipcarg_t device, in ipcarg_t flags, in_copy string point, in_copy string opts, in_copy string fs);
+		sysarg_t mount(in sysarg_t device, in sysarg_t flags, in_copy string point, in_copy string opts, in_copy string fs);
 		
 		/* Open file */
-		ipcarg_t open(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, in_copy string path, out ipcarg_t fd);
+		sysarg_t open(in sysarg_t lflag, in sysarg_t oflag, in sysarg_t mode, in_copy string path, out sysarg_t fd);
 		
 		/* Open file using node */
-		ipcarg_t open_node(in ipcarg_t fs_handle, in ipcarg_t dev_handle, in ipcarg_t index, in ipcarg_t oflag, out ipcarg_t fd);
+		sysarg_t open_node(in sysarg_t fs_handle, in sysarg_t dev_handle, in sysarg_t index, in sysarg_t oflag, out sysarg_t fd);
 		
 		/* Read data from file */
-		ipcarg_t read(in ipcarg_t fd, out_copy stream data);
+		sysarg_t read(in sysarg_t fd, out_copy stream data);
 		
 		/* Write data to file */
-		ipcarg_t write(in ipcarg_t fd, in_copy stream data);
+		sysarg_t write(in sysarg_t fd, in_copy stream data);
 		
 		/* Seek in file */
-		ipcarg_t seek(in ipcarg_t fd, in ipcarg_t offset, in ipcarg_t whence);
+		sysarg_t seek(in sysarg_t fd, in sysarg_t offset, in sysarg_t whence);
 		
 		/* Truncate file */
-		ipcarg_t truncate(in ipcarg_t fd, in ipcarg_t size);
+		sysarg_t truncate(in sysarg_t fd, in sysarg_t size);
 		
 		/* Get file metadata */
-		ipcarg_t fstat(in ipcarg_t fd, out_copy stream stat);
+		sysarg_t fstat(in sysarg_t fd, out_copy stream stat);
 		
 		/* Get directory entry metadata */
-		ipcarg_t stat(in_copy string path, out_copy stream stat);
+		sysarg_t stat(in_copy string path, out_copy stream stat);
 		
 		/* Create directory */
-		ipcarg_t mkdir(in ipcarg_t mode, in_copy string path);
+		sysarg_t mkdir(in sysarg_t mode, in_copy string path);
 		
 		/* Delete directory entry */
-		ipcarg_t unlink(in ipcarg_t lflag, in_copy string path);
+		sysarg_t unlink(in sysarg_t lflag, in_copy string path);
 		
 		/* Rename directory entry */
-		ipcarg_t rename(in_copy string old, in_copy string new);
+		sysarg_t rename(in_copy string old, in_copy string new);
 		
 		/* Flush file buffers */
-		ipcarg_t sync(in ipcarg_t fd);
+		sysarg_t sync(in sysarg_t fd);
 		
 		/* In-protocol status value */
-		ipcarg_t ipc_m_ping(void);
+		sysarg_t ipc_m_ping(void);
 		
 		/* Close connection */
-		ipcarg_t ipc_m_phone_hungup(void);
+		sysarg_t ipc_m_phone_hungup(void);
 	protocol:
 		[vfs.bp]
@@ -53,32 +53,32 @@
 interface fs extends service {
 		/* Notify filesystem that it was mounted */
-		ipcarg_t mounted(in ipcarg_t dev_handle, in_copy string opts);
+		sysarg_t mounted(in sysarg_t dev_handle, in_copy string opts);
 		
 		/* Mount filesystem */
-		ipcarg_t mount(in ipcarg_t device, in ipcarg_t flags, in_copy string point, in_copy string opts, ...);
+		sysarg_t mount(in sysarg_t device, in sysarg_t flags, in_copy string point, in_copy string opts, ...);
 		
 		/* Open file by node */
-		ipcarg_t open_node(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, ...);
+		sysarg_t open_node(in sysarg_t lflag, in sysarg_t oflag, in sysarg_t mode, ...);
 		
 		/* Lookup file */
-		ipcarg_t lookup(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, ...);
+		sysarg_t lookup(in sysarg_t lflag, in sysarg_t oflag, in sysarg_t mode, ...);
 		
 		/* Read data from file */
-		ipcarg_t read(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t offset, out_copy stream data);
+		sysarg_t read(in sysarg_t dev_handle, in sysarg_t fs_index, in sysarg_t offset, out_copy stream data);
 		
 		/* Write data to file */
-		ipcarg_t write(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t offset, in_copy stream data);
+		sysarg_t write(in sysarg_t dev_handle, in sysarg_t fs_index, in sysarg_t offset, in_copy stream data);
 		
 		/* Truncate file */
-		ipcarg_t truncate(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t size);
+		sysarg_t truncate(in sysarg_t dev_handle, in sysarg_t fs_index, in sysarg_t size);
 		
 		/* Get directory entry metadata */
-		ipcarg_t stat(in ipcarg_t dev_handle, in ipcarg_t fs_index, out_copy stream stat);
+		sysarg_t stat(in sysarg_t dev_handle, in sysarg_t fs_index, out_copy stream stat);
 		
 		/* Flush file buffers */
-		ipcarg_t sync(in ipcarg_t dev_handle, in ipcarg_t fs_index);
+		sysarg_t sync(in sysarg_t dev_handle, in sysarg_t fs_index);
 		
 		/* Notify on file close */
-		ipcarg_t close(in ipcarg_t dev_handle, in ipcarg_t fs_index);
+		sysarg_t close(in sysarg_t dev_handle, in sysarg_t fs_index);
 };
 
Index: contrib/highlight/adl.syntax
===================================================================
--- contrib/highlight/adl.syntax	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ contrib/highlight/adl.syntax	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -17,5 +17,5 @@
 	keyword whole delegate yellow
 	
-	keyword whole ipcarg_t yellow
+	keyword whole sysarg_t yellow
 	keyword whole string yellow
 	keyword whole stream yellow
Index: kernel/arch/abs32le/include/types.h
===================================================================
--- kernel/arch/abs32le/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/abs32le/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -46,5 +46,5 @@
 typedef uint32_t ipl_t;
 
-typedef uint32_t unative_t;
+typedef uint32_t sysarg_t;
 typedef int32_t native_t;
 typedef uint32_t atomic_count_t;
@@ -57,6 +57,6 @@
 
 #define PRIdn  PRId32  /**< Format for native_t. */
-#define PRIun  PRIu32  /**< Format for unative_t. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: kernel/arch/abs32le/src/abs32le.c
===================================================================
--- kernel/arch/abs32le/src/abs32le.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/abs32le/src/abs32le.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -86,5 +86,5 @@
 }
 
-unative_t sys_tls_set(unative_t addr)
+sysarg_t sys_tls_set(sysarg_t addr)
 {
 	return EOK;
Index: kernel/arch/amd64/include/asm.h
===================================================================
--- kernel/arch/amd64/include/asm.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/amd64/include/asm.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -304,5 +304,5 @@
 }
 
-NO_TRACE static inline unative_t read_msr(uint32_t msr)
+NO_TRACE static inline sysarg_t read_msr(uint32_t msr)
 {
 	uint32_t ax, dx;
@@ -343,5 +343,5 @@
 	asm volatile (
 		"invlpg %[addr]\n"
-		:: [addr] "m" (*((unative_t *) addr))
+		:: [addr] "m" (*((sysarg_t *) addr))
 	);
 }
@@ -398,7 +398,7 @@
 }
 
-#define GEN_READ_REG(reg) NO_TRACE static inline unative_t read_ ##reg (void) \
+#define GEN_READ_REG(reg) NO_TRACE static inline sysarg_t read_ ##reg (void) \
 	{ \
-		unative_t res; \
+		sysarg_t res; \
 		asm volatile ( \
 			"movq %%" #reg ", %[res]" \
@@ -408,5 +408,5 @@
 	}
 
-#define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (unative_t regn) \
+#define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (sysarg_t regn) \
 	{ \
 		asm volatile ( \
Index: kernel/arch/amd64/include/proc/thread.h
===================================================================
--- kernel/arch/amd64/include/proc/thread.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/amd64/include/proc/thread.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -41,5 +41,5 @@
 
 typedef struct {
-	unative_t tls;
+	sysarg_t tls;
 	/** User and kernel RSP for syscalls. */
 	uint64_t syscall_rsp[2];
Index: kernel/arch/amd64/include/types.h
===================================================================
--- kernel/arch/amd64/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/amd64/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,5 +43,5 @@
 typedef uint64_t ipl_t;
 
-typedef uint64_t unative_t;
+typedef uint64_t sysarg_t;
 typedef int64_t native_t;
 typedef uint64_t atomic_count_t;
@@ -54,6 +54,6 @@
 
 #define PRIdn  PRId64  /**< Format for native_t. */
-#define PRIun  PRIu64  /**< Format for unative_t. */
-#define PRIxn  PRIx64  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu64  /**< Format for sysarg_t. */
+#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu64  /**< Format for atomic_count_t. */
 
Index: kernel/arch/amd64/src/amd64.c
===================================================================
--- kernel/arch/amd64/src/amd64.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/amd64/src/amd64.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -256,5 +256,5 @@
  * we need not to go to CPL0 to read it.
  */
-unative_t sys_tls_set(unative_t addr)
+sysarg_t sys_tls_set(sysarg_t addr)
 {
 	THREAD->arch.tls = addr;
Index: kernel/arch/amd64/src/debugger.c
===================================================================
--- kernel/arch/amd64/src/debugger.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/amd64/src/debugger.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -125,5 +125,5 @@
 	
 	/* Disable breakpoint in DR7 */
-	unative_t dr7 = read_dr7();
+	sysarg_t dr7 = read_dr7();
 	dr7 &= ~(0x02U << (curidx * 2));
 	
@@ -152,15 +152,15 @@
 		if (!(flags & BKPOINT_INSTR)) {
 #ifdef __32_BITS__
-			dr7 |= ((unative_t) 0x03U) << (18 + 4 * curidx);
+			dr7 |= ((sysarg_t) 0x03U) << (18 + 4 * curidx);
 #endif
 			
 #ifdef __64_BITS__
-			dr7 |= ((unative_t) 0x02U) << (18 + 4 * curidx);
+			dr7 |= ((sysarg_t) 0x02U) << (18 + 4 * curidx);
 #endif
 			
 			if ((flags & BKPOINT_WRITE))
-				dr7 |= ((unative_t) 0x01U) << (16 + 4 * curidx);
+				dr7 |= ((sysarg_t) 0x01U) << (16 + 4 * curidx);
 			else if ((flags & BKPOINT_READ_WRITE))
-				dr7 |= ((unative_t) 0x03U) << (16 + 4 * curidx);
+				dr7 |= ((sysarg_t) 0x03U) << (16 + 4 * curidx);
 		}
 		
@@ -227,5 +227,5 @@
 	if (!(breakpoints[slot].flags & BKPOINT_INSTR)) {
 		if ((breakpoints[slot].flags & BKPOINT_CHECK_ZERO)) {
-			if (*((unative_t *) breakpoints[slot].address) != 0)
+			if (*((sysarg_t *) breakpoints[slot].address) != 0)
 				return;
 			
@@ -234,5 +234,5 @@
 		} else {
 			printf("Data watchpoint - new data: %#" PRIxn "\n",
-			    *((unative_t *) breakpoints[slot].address));
+			    *((sysarg_t *) breakpoints[slot].address));
 		}
 	}
@@ -279,5 +279,5 @@
 #endif
 	
-	unative_t dr6 = read_dr6();
+	sysarg_t dr6 = read_dr6();
 	
 	unsigned int i;
@@ -384,5 +384,5 @@
 int cmd_del_breakpoint(cmd_arg_t *argv)
 {
-	unative_t bpno = argv->intval;
+	sysarg_t bpno = argv->intval;
 	if (bpno > BKPOINTS_MAX) {
 		printf("Invalid breakpoint number.\n");
Index: kernel/arch/arm32/include/types.h
===================================================================
--- kernel/arch/arm32/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/arm32/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -50,5 +50,5 @@
 typedef uint32_t ipl_t;
 
-typedef uint32_t unative_t;
+typedef uint32_t sysarg_t;
 typedef int32_t native_t;
 typedef uint32_t atomic_count_t;
@@ -61,6 +61,6 @@
 
 #define PRIdn  PRId32  /**< Format for native_t. */
-#define PRIun  PRIu32  /**< Format for unative_t. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: kernel/arch/arm32/src/mach/testarm/testarm.c
===================================================================
--- kernel/arch/arm32/src/mach/testarm/testarm.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/arm32/src/mach/testarm/testarm.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -123,5 +123,5 @@
 	sysinfo_set_item_val("kbd", NULL, true);
 	sysinfo_set_item_val("kbd.inr", NULL, GXEMUL_KBD_IRQ);
-	sysinfo_set_item_val("kbd.address.virtual", NULL, (unative_t) gxemul_kbd);
+	sysinfo_set_item_val("kbd.address.virtual", NULL, (sysarg_t) gxemul_kbd);
 #endif
 }
Index: kernel/arch/ia32/include/asm.h
===================================================================
--- kernel/arch/ia32/include/asm.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ia32/include/asm.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -64,7 +64,7 @@
 }
 
-#define GEN_READ_REG(reg) NO_TRACE static inline unative_t read_ ##reg (void) \
+#define GEN_READ_REG(reg) NO_TRACE static inline sysarg_t read_ ##reg (void) \
 	{ \
-		unative_t res; \
+		sysarg_t res; \
 		asm volatile ( \
 			"movl %%" #reg ", %[res]" \
@@ -74,5 +74,5 @@
 	}
 
-#define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (unative_t regn) \
+#define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (sysarg_t regn) \
 	{ \
 		asm volatile ( \
@@ -366,5 +366,5 @@
 	asm volatile (
 		"invlpg %[addr]\n"
-		:: [addr] "m" (*(unative_t *) addr)
+		:: [addr] "m" (*(sysarg_t *) addr)
 	);
 }
Index: kernel/arch/ia32/include/proc/thread.h
===================================================================
--- kernel/arch/ia32/include/proc/thread.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ia32/include/proc/thread.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -39,5 +39,5 @@
 
 typedef struct {
-	unative_t tls;
+	sysarg_t tls;
 } thread_arch_t;
 
Index: kernel/arch/ia32/include/types.h
===================================================================
--- kernel/arch/ia32/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ia32/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,5 +43,5 @@
 typedef uint32_t ipl_t;
 
-typedef uint32_t unative_t;
+typedef uint32_t sysarg_t;
 typedef int32_t native_t;
 typedef uint32_t atomic_count_t;
@@ -54,6 +54,6 @@
 
 #define PRIdn  PRId32  /**< Format for native_t. */
-#define PRIun  PRIu32  /**< Format for unative_t. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: kernel/arch/ia32/src/ia32.c
===================================================================
--- kernel/arch/ia32/src/ia32.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ia32/src/ia32.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -211,5 +211,5 @@
  * selector, and the descriptor->base is the correct address.
  */
-unative_t sys_tls_set(unative_t addr)
+sysarg_t sys_tls_set(sysarg_t addr)
 {
 	THREAD->arch.tls = addr;
Index: kernel/arch/ia64/include/bootinfo.h
===================================================================
--- kernel/arch/ia64/include/bootinfo.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ia64/include/bootinfo.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -62,5 +62,5 @@
 	unsigned int memmap_items;
 	
-	unative_t *sapic;
+	sysarg_t *sapic;
 	unsigned long sys_freq;
 	unsigned long freq_scale;
Index: kernel/arch/ia64/include/types.h
===================================================================
--- kernel/arch/ia64/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ia64/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,11 +43,11 @@
 typedef uint64_t ipl_t;
 
-typedef uint64_t unative_t;
+typedef uint64_t sysarg_t;
 typedef int64_t native_t;
 typedef uint64_t atomic_count_t;
 
 typedef struct {
-	unative_t fnc;
-	unative_t gp;
+	sysarg_t fnc;
+	sysarg_t gp;
 } __attribute__((may_alias)) fncptr_t;
 
@@ -56,6 +56,6 @@
 
 #define PRIdn  PRId64  /**< Format for native_t. */
-#define PRIun  PRIu64  /**< Format for unative_t. */
-#define PRIxn  PRIx64  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu64  /**< Format for sysarg_t. */
+#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu64  /**< Format for atomic_count_t. */
 
Index: kernel/arch/ia64/src/ia64.c
===================================================================
--- kernel/arch/ia64/src/ia64.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ia64/src/ia64.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -104,5 +104,5 @@
 static void iosapic_init(void)
 {
-	uint64_t IOSAPIC = PA2KA((unative_t)(iosapic_base)) | FW_OFFSET;
+	uint64_t IOSAPIC = PA2KA((sysarg_t)(iosapic_base)) | FW_OFFSET;
 	int i;
 	
@@ -251,5 +251,5 @@
  * We use r13 (a.k.a. tp) for this purpose.
  */
-unative_t sys_tls_set(unative_t addr)
+sysarg_t sys_tls_set(sysarg_t addr)
 {
 	return 0;
@@ -274,6 +274,6 @@
 void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller)
 {
-	fptr->fnc = (unative_t) addr;
-	fptr->gp = ((unative_t *) caller)[1];
+	fptr->fnc = (sysarg_t) addr;
+	fptr->gp = ((sysarg_t *) caller)[1];
 	
 	return (void *) fptr;
Index: kernel/arch/mips32/include/debugger.h
===================================================================
--- kernel/arch/mips32/include/debugger.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/mips32/include/debugger.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -58,8 +58,8 @@
 
 typedef struct  {
-	uintptr_t address;          /**< Breakpoint address */
-	unative_t instruction;      /**< Original instruction */
-	unative_t nextinstruction;  /**< Original instruction following break */
-	unsigned int flags;         /**< Flags regarding breakpoint */
+	uintptr_t address;         /**< Breakpoint address */
+	sysarg_t instruction;      /**< Original instruction */
+	sysarg_t nextinstruction;  /**< Original instruction following break */
+	unsigned int flags;        /**< Flags regarding breakpoint */
 	size_t counter;
 	void (*bkfunc)(void *, istate_t *);
@@ -68,5 +68,5 @@
 extern bpinfo_t breakpoints[BKPOINTS_MAX];
 
-extern bool is_jump(unative_t);
+extern bool is_jump(sysarg_t);
 
 extern void debugger_init(void);
Index: kernel/arch/mips32/include/fpu_context.h
===================================================================
--- kernel/arch/mips32/include/fpu_context.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/mips32/include/fpu_context.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -38,9 +38,9 @@
 #include <typedefs.h>
 
-#define FPU_CONTEXT_ALIGN    sizeof(unative_t)
+#define FPU_CONTEXT_ALIGN    sizeof(sysarg_t)
 
 typedef struct {
-	unative_t dregs[32];
-	unative_t cregs[32];
+	sysarg_t dregs[32];
+	sysarg_t cregs[32];
 } fpu_context_t;
 
Index: kernel/arch/mips32/include/types.h
===================================================================
--- kernel/arch/mips32/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/mips32/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,5 +43,5 @@
 typedef uint32_t ipl_t;
 
-typedef uint32_t unative_t;
+typedef uint32_t sysarg_t;
 typedef int32_t native_t;
 typedef uint32_t atomic_count_t;
@@ -54,6 +54,6 @@
 
 #define PRIdn  PRId32  /**< Format for native_t. */
-#define PRIun  PRIu32  /**< Format for unative_t. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: kernel/arch/mips32/src/debugger.c
===================================================================
--- kernel/arch/mips32/src/debugger.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/mips32/src/debugger.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -134,5 +134,5 @@
  *
  */
-bool is_jump(unative_t instr)
+bool is_jump(sysarg_t instr)
 {
 	unsigned int i;
@@ -166,6 +166,6 @@
 			return 0;
 		} else if ((breakpoints[i].address == (uintptr_t) argv->intval +
-		    sizeof(unative_t)) || (breakpoints[i].address ==
-		    (uintptr_t) argv->intval - sizeof(unative_t))) {
+		    sizeof(sysarg_t)) || (breakpoints[i].address ==
+		    (uintptr_t) argv->intval - sizeof(sysarg_t))) {
 			printf("Adjacent breakpoints not supported, conflict "
 			    "with %d.\n", i);
@@ -194,6 +194,6 @@
 	
 	cur->address = (uintptr_t) argv->intval;
-	cur->instruction = ((unative_t *) cur->address)[0];
-	cur->nextinstruction = ((unative_t *) cur->address)[1];
+	cur->instruction = ((sysarg_t *) cur->address)[0];
+	cur->nextinstruction = ((sysarg_t *) cur->address)[1];
 	if (argv == &add_argv) {
 		cur->flags = 0;
@@ -209,5 +209,5 @@
 	
 	/* Set breakpoint */
-	*((unative_t *) cur->address) = 0x0d;
+	*((sysarg_t *) cur->address) = 0x0d;
 	smc_coherence(cur->address);
 	
@@ -341,5 +341,5 @@
 		/* Reinst only breakpoint */
 		if ((breakpoints[i].flags & BKPOINT_REINST) &&
-		    (fireaddr == breakpoints[i].address + sizeof(unative_t))) {
+		    (fireaddr == breakpoints[i].address + sizeof(sysarg_t))) {
 			cur = &breakpoints[i];
 			break;
Index: kernel/arch/mips32/src/mips32.c
===================================================================
--- kernel/arch/mips32/src/mips32.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/mips32/src/mips32.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -233,5 +233,5 @@
  * possible to have it separately in the future.
  */
-unative_t sys_tls_set(unative_t addr)
+sysarg_t sys_tls_set(sysarg_t addr)
 {
 	return 0;
Index: kernel/arch/ppc32/include/exception.h
===================================================================
--- kernel/arch/ppc32/include/exception.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ppc32/include/exception.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -98,10 +98,10 @@
 }
 
-NO_TRACE static inline unative_t istate_get_pc(istate_t *istate)
+NO_TRACE static inline sysarg_t istate_get_pc(istate_t *istate)
 {
 	return istate->pc;
 }
 
-NO_TRACE static inline unative_t istate_get_fp(istate_t *istate)
+NO_TRACE static inline sysarg_t istate_get_fp(istate_t *istate)
 {
 	return istate->sp;
Index: kernel/arch/ppc32/include/types.h
===================================================================
--- kernel/arch/ppc32/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/ppc32/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,5 +43,5 @@
 typedef uint32_t ipl_t;
 
-typedef uint32_t unative_t;
+typedef uint32_t sysarg_t;
 typedef int32_t native_t;
 typedef uint32_t atomic_count_t;
@@ -54,6 +54,6 @@
 
 #define PRIdn  PRId32  /**< Format for native_t. */
-#define PRIun  PRIu32  /**< Format for unative_t. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: kernel/arch/sparc64/include/mm/sun4u/tlb.h
===================================================================
--- kernel/arch/sparc64/include/mm/sun4u/tlb.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/sparc64/include/mm/sun4u/tlb.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -678,5 +678,5 @@
 }
 
-extern void fast_instruction_access_mmu_miss(unative_t, istate_t *);
+extern void fast_instruction_access_mmu_miss(sysarg_t, istate_t *);
 extern void fast_data_access_mmu_miss(tlb_tag_access_reg_t, istate_t *);
 extern void fast_data_access_protection(tlb_tag_access_reg_t , istate_t *);
Index: kernel/arch/sparc64/include/mm/sun4v/tlb.h
===================================================================
--- kernel/arch/sparc64/include/mm/sun4v/tlb.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/sparc64/include/mm/sun4v/tlb.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -141,7 +141,7 @@
 }
 
-extern void fast_instruction_access_mmu_miss(unative_t, istate_t *);
-extern void fast_data_access_mmu_miss(unative_t, istate_t *);
-extern void fast_data_access_protection(unative_t, istate_t *);
+extern void fast_instruction_access_mmu_miss(sysarg_t, istate_t *);
+extern void fast_data_access_mmu_miss(sysarg_t, istate_t *);
+extern void fast_data_access_protection(sysarg_t, istate_t *);
 
 extern void dtlb_insert_mapping(uintptr_t, uintptr_t, int, bool, bool);
Index: kernel/arch/sparc64/include/types.h
===================================================================
--- kernel/arch/sparc64/include/types.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/sparc64/include/types.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,5 +43,5 @@
 typedef uint64_t ipl_t;
 
-typedef uint64_t unative_t;
+typedef uint64_t sysarg_t;
 typedef int64_t native_t;
 typedef uint64_t atomic_count_t;
@@ -56,6 +56,6 @@
 
 #define PRIdn  PRId64  /**< Format for native_t. */
-#define PRIun  PRIu64  /**< Format for unative_t. */
-#define PRIxn  PRIx64  /**< Format for hexadecimal unative_t. */
+#define PRIun  PRIu64  /**< Format for sysarg_t. */
+#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu64  /**< Format for atomic_count_t. */
 
Index: kernel/arch/sparc64/src/mm/sun4u/tlb.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4u/tlb.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/sparc64/src/mm/sun4u/tlb.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -200,5 +200,5 @@
 
 /** ITLB miss handler. */
-void fast_instruction_access_mmu_miss(unative_t unused, istate_t *istate)
+void fast_instruction_access_mmu_miss(sysarg_t unused, istate_t *istate)
 {
 	uintptr_t page_16k = ALIGN_DOWN(istate->tpc, PAGE_SIZE);
Index: kernel/arch/sparc64/src/mm/sun4v/tlb.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4v/tlb.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/arch/sparc64/src/mm/sun4v/tlb.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -213,5 +213,5 @@
 
 /** ITLB miss handler. */
-void fast_instruction_access_mmu_miss(unative_t unused, istate_t *istate)
+void fast_instruction_access_mmu_miss(sysarg_t unused, istate_t *istate)
 {
 	uintptr_t va = ALIGN_DOWN(istate->tpc, PAGE_SIZE);
Index: kernel/genarch/src/acpi/acpi.c
===================================================================
--- kernel/genarch/src/acpi/acpi.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/genarch/src/acpi/acpi.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -116,5 +116,5 @@
 		    / sizeof(struct acpi_signature_map); j++) {
 			struct acpi_sdt_header *hdr =
-			    (struct acpi_sdt_header *) (unative_t) acpi_rsdt->entry[i];
+			    (struct acpi_sdt_header *) (sysarg_t) acpi_rsdt->entry[i];
 			
 			map_sdt(hdr);
Index: kernel/genarch/src/acpi/madt.c
===================================================================
--- kernel/genarch/src/acpi/madt.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/genarch/src/acpi/madt.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -165,5 +165,5 @@
 		/* Remember index of the first io apic entry */
 		madt_io_apic_entry_index = i;
-		io_apic = (uint32_t *) (unative_t) ioa->io_apic_address;
+		io_apic = (uint32_t *) (sysarg_t) ioa->io_apic_address;
 	} else {
 		/* Currently not supported */
@@ -190,5 +190,5 @@
 	struct madt_apic_header *hdr;
 	
-	l_apic = (uint32_t *) (unative_t) acpi_madt->l_apic_address;
+	l_apic = (uint32_t *) (sysarg_t) acpi_madt->l_apic_address;
 	
 	/* Count MADT entries */
Index: kernel/genarch/src/mm/page_ht.c
===================================================================
--- kernel/genarch/src/mm/page_ht.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/genarch/src/mm/page_ht.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -52,6 +52,6 @@
 #include <align.h>
 
-static size_t hash(unative_t[]);
-static bool compare(unative_t[], size_t, link_t *);
+static size_t hash(sysarg_t[]);
+static bool compare(sysarg_t[], size_t, link_t *);
 static void remove_callback(link_t *);
 
@@ -96,5 +96,5 @@
  *
  */
-size_t hash(unative_t key[])
+size_t hash(sysarg_t key[])
 {
 	as_t *as = (as_t *) key[KEY_AS];
@@ -115,5 +115,5 @@
 	 *
 	 */
-	index |= ((unative_t) as) & (PAGE_HT_ENTRIES - 1);
+	index |= ((sysarg_t) as) & (PAGE_HT_ENTRIES - 1);
 	
 	return index;
@@ -129,5 +129,5 @@
  *
  */
-bool compare(unative_t key[], size_t keys, link_t *item)
+bool compare(sysarg_t key[], size_t keys, link_t *item)
 {
 	ASSERT(item);
@@ -180,5 +180,5 @@
     unsigned int flags)
 {
-	unative_t key[2] = {
+	sysarg_t key[2] = {
 		(uintptr_t) as,
 		page = ALIGN_DOWN(page, PAGE_SIZE)
@@ -220,5 +220,5 @@
 void ht_mapping_remove(as_t *as, uintptr_t page)
 {
-	unative_t key[2] = {
+	sysarg_t key[2] = {
 		(uintptr_t) as,
 		page = ALIGN_DOWN(page, PAGE_SIZE)
@@ -247,5 +247,5 @@
 pte_t *ht_mapping_find(as_t *as, uintptr_t page)
 {
-	unative_t key[2] = {
+	sysarg_t key[2] = {
 		(uintptr_t) as,
 		page = ALIGN_DOWN(page, PAGE_SIZE)
Index: kernel/generic/include/adt/hash_table.h
===================================================================
--- kernel/generic/include/adt/hash_table.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/adt/hash_table.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -48,5 +48,5 @@
 	 * @return Index into hash table.
 	 */
-	size_t (* hash)(unative_t key[]);
+	size_t (* hash)(sysarg_t key[]);
 	
 	/** Hash table item comparison function.
@@ -57,5 +57,5 @@
 	 * @return true if the keys match, false otherwise.
 	 */
-	bool (*compare)(unative_t key[], size_t keys, link_t *item);
+	bool (*compare)(sysarg_t key[], size_t keys, link_t *item);
 
 	/** Hash table item removal callback.
@@ -79,7 +79,7 @@
 extern void hash_table_create(hash_table_t *h, size_t m, size_t max_keys,
     hash_table_operations_t *op);
-extern void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item);
-extern link_t *hash_table_find(hash_table_t *h, unative_t key[]);
-extern void hash_table_remove(hash_table_t *h, unative_t key[], size_t keys);
+extern void hash_table_insert(hash_table_t *h, sysarg_t key[], link_t *item);
+extern link_t *hash_table_find(hash_table_t *h, sysarg_t key[]);
+extern void hash_table_remove(hash_table_t *h, sysarg_t key[], size_t keys);
 
 #endif
Index: kernel/generic/include/console/console.h
===================================================================
--- kernel/generic/include/console/console.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/console/console.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -67,11 +67,11 @@
 extern wchar_t getc(indev_t *indev);
 extern size_t gets(indev_t *indev, char *buf, size_t buflen);
-extern unative_t sys_klog(int fd, const void *buf, size_t size);
+extern sysarg_t sys_klog(int fd, const void *buf, size_t size);
 
 extern void grab_console(void);
 extern void release_console(void);
 
-extern unative_t sys_debug_enable_console(void);
-extern unative_t sys_debug_disable_console(void);
+extern sysarg_t sys_debug_enable_console(void);
+extern sysarg_t sys_debug_disable_console(void);
 
 #endif /* KERN_CONSOLE_H_ */
Index: kernel/generic/include/console/kconsole.h
===================================================================
--- kernel/generic/include/console/kconsole.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/console/kconsole.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -62,5 +62,5 @@
 	size_t len;
 	/** Integer value. */
-	unative_t intval;
+	sysarg_t intval;
 	/** Resulting type of variable arg */
 	cmd_arg_type_t vartype;
Index: kernel/generic/include/ddi/ddi.h
===================================================================
--- kernel/generic/include/ddi/ddi.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ddi/ddi.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -52,7 +52,7 @@
 extern void ddi_parea_register(parea_t *);
 
-extern unative_t sys_physmem_map(unative_t, unative_t, unative_t, unative_t);
-extern unative_t sys_iospace_enable(ddi_ioarg_t *);
-extern unative_t sys_interrupt_enable(int irq, int enable);
+extern sysarg_t sys_physmem_map(sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+extern sysarg_t sys_iospace_enable(ddi_ioarg_t *);
+extern sysarg_t sys_interrupt_enable(int irq, int enable);
 
 /*
Index: kernel/generic/include/ddi/device.h
===================================================================
--- kernel/generic/include/ddi/device.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ddi/device.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -39,5 +39,5 @@
 
 extern devno_t device_assign_devno(void);
-extern unative_t sys_device_assign_devno(void);
+extern sysarg_t sys_device_assign_devno(void);
 
 #endif
Index: kernel/generic/include/ddi/irq.h
===================================================================
--- kernel/generic/include/ddi/irq.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ddi/irq.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -122,6 +122,6 @@
 	/** Answerbox for notifications. */
 	answerbox_t *answerbox;
-	/** Method to be used for the notification. */
-	unative_t method;
+	/** Interface and method to be used for the notification. */
+	sysarg_t imethod;
 	/** Arguments that will be sent if the IRQ is claimed. */
 	uint32_t scratch[IPC_CALL_LEN];
@@ -189,4 +189,6 @@
 extern hash_table_t irq_uspace_hash_table;
 
+extern inr_t last_inr;
+
 extern void irq_init(size_t, size_t);
 extern void irq_initialize(irq_t *);
Index: kernel/generic/include/ipc/event.h
===================================================================
--- kernel/generic/include/ipc/event.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ipc/event.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -47,6 +47,6 @@
 	/** Answerbox for notifications. */
 	answerbox_t *answerbox;
-	/** Method to be used for the notification. */
-	unative_t method;
+	/** Interface and method to be used for the notification. */
+	sysarg_t imethod;
 	/** Counter. */
 	size_t counter;
@@ -54,5 +54,5 @@
 
 extern void event_init(void);
-extern unative_t sys_event_subscribe(unative_t, unative_t);
+extern sysarg_t sys_event_subscribe(sysarg_t, sysarg_t);
 extern bool event_is_subscribed(event_type_t);
 extern void event_cleanup_answerbox(answerbox_t *);
@@ -71,6 +71,6 @@
 	event_notify((e), (a1), (a2), (a3), (a4), (a5))
 
-extern void event_notify(event_type_t, unative_t, unative_t, unative_t,
-    unative_t, unative_t);
+extern void event_notify(event_type_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t);
 
 #endif
Index: kernel/generic/include/ipc/ipc.h
===================================================================
--- kernel/generic/include/ipc/ipc.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ipc/ipc.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,10 +43,6 @@
 #define IPC_CALL_LEN  6
 
-/** Maximum active async calls per thread */
-#ifdef CONFIG_DEBUG
-	#define IPC_MAX_ASYNC_CALLS  4
-#else
-	#define IPC_MAX_ASYNC_CALLS  4000
-#endif
+/** Maximum active async calls per phone */
+#define IPC_MAX_ASYNC_CALLS  4
 
 /* Flags for calls */
@@ -88,5 +84,5 @@
 /* Macros for manipulating calling data */
 #define IPC_SET_RETVAL(data, retval)  ((data).args[0] = (retval))
-#define IPC_SET_METHOD(data, val)     ((data).args[0] = (val))
+#define IPC_SET_IMETHOD(data, val)    ((data).args[0] = (val))
 #define IPC_SET_ARG1(data, val)       ((data).args[1] = (val))
 #define IPC_SET_ARG2(data, val)       ((data).args[2] = (val))
@@ -95,6 +91,6 @@
 #define IPC_SET_ARG5(data, val)       ((data).args[5] = (val))
 
-#define IPC_GET_METHOD(data)  ((data).args[0])
-#define IPC_GET_RETVAL(data)  ((data).args[0])
+#define IPC_GET_IMETHOD(data)  ((data).args[0])
+#define IPC_GET_RETVAL(data)   ((data).args[0])
 
 #define IPC_GET_ARG1(data)  ((data).args[1])
@@ -120,6 +116,13 @@
 #define IPC_FF_ROUTE_FROM_ME  (1 << 0)
 
+/** Kernel IPC interfaces
+ *
+ */
+#define IPC_IF_KERNEL  0
+
 /** System-specific methods - only through special syscalls
- * These methods have special behaviour
+ *
+ * These methods have special behaviour. These methods also
+ * have the implicit kernel interface 0.
  *
  */
@@ -315,5 +318,5 @@
 
 typedef struct {
-	unative_t args[IPC_CALL_LEN];
+	sysarg_t args[IPC_CALL_LEN];
 	phone_t *phone;
 } ipc_data_t;
@@ -335,5 +338,5 @@
 	
 	/** Private data to internal IPC. */
-	unative_t priv;
+	sysarg_t priv;
 	
 	/** Data passed from/to userspace. */
@@ -372,5 +375,5 @@
 
 extern void ipc_cleanup(void);
-extern void ipc_backsend_err(phone_t *, call_t *, unative_t);
+extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t);
 extern void ipc_answerbox_slam_phones(answerbox_t *, bool);
 extern void ipc_cleanup_call_list(link_t *);
Index: kernel/generic/include/ipc/ipcrsc.h
===================================================================
--- kernel/generic/include/ipc/ipcrsc.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ipc/ipcrsc.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -39,5 +39,5 @@
 #include <ipc/ipc.h>
 
-extern call_t * get_call(unative_t callid);
+extern call_t * get_call(sysarg_t callid);
 extern int phone_alloc(task_t *t);
 extern void phone_connect(int phoneid, answerbox_t *box);
Index: kernel/generic/include/ipc/irq.h
===================================================================
--- kernel/generic/include/ipc/irq.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ipc/irq.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -44,5 +44,5 @@
 #include <adt/list.h>
 
-extern int ipc_irq_register(answerbox_t *, inr_t, devno_t, unative_t,
+extern int ipc_irq_register(answerbox_t *, inr_t, devno_t, sysarg_t,
     irq_code_t *);
 
@@ -75,6 +75,6 @@
 	ipc_irq_send_msg((irq), (a1), (a2), (a3), (a4), (a5))
 
-extern void ipc_irq_send_msg(irq_t *, unative_t, unative_t, unative_t, unative_t,
-    unative_t);
+extern void ipc_irq_send_msg(irq_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t);
 
 #endif
Index: kernel/generic/include/ipc/sysipc.h
===================================================================
--- kernel/generic/include/ipc/sysipc.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/ipc/sysipc.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -40,26 +40,34 @@
 #include <typedefs.h>
 
-extern unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, 
-    unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data);
-extern unative_t sys_ipc_call_sync_slow(unative_t phoneid, ipc_data_t *question,
-    ipc_data_t *reply);
-extern unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, 
-    unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4);
-extern unative_t sys_ipc_call_async_slow(unative_t phoneid, ipc_data_t *data);
-extern unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval, 
-    unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4);
-extern unative_t sys_ipc_answer_slow(unative_t callid, ipc_data_t *data);
-extern unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,
-    unsigned int nonblocking);
-extern unative_t sys_ipc_poke(void);
-extern unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid,
-    unative_t method, unative_t arg1, unative_t arg2, unsigned int mode);
-extern unative_t sys_ipc_forward_slow(unative_t callid, unative_t phoneid,
-    ipc_data_t *data, unsigned int mode);
-extern unative_t sys_ipc_hangup(unative_t phoneid);
-extern unative_t sys_ipc_register_irq(inr_t inr, devno_t devno, unative_t method,
-    irq_code_t *ucode);
-extern unative_t sys_ipc_unregister_irq(inr_t inr, devno_t devno);
-extern unative_t sys_ipc_connect_kbox(sysarg64_t *task_id);
+extern sysarg_t sys_ipc_call_sync_fast(sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, ipc_data_t *);
+extern sysarg_t sys_ipc_call_sync_slow(sysarg_t, ipc_data_t *, ipc_data_t *);
+extern sysarg_t sys_ipc_call_async_fast(sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t);
+extern sysarg_t sys_ipc_call_async_slow(sysarg_t, ipc_data_t *);
+extern sysarg_t sys_ipc_answer_fast(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t);
+extern sysarg_t sys_ipc_answer_slow(sysarg_t, ipc_data_t *);
+extern sysarg_t sys_ipc_wait_for_call(ipc_data_t *, uint32_t, unsigned int);
+extern sysarg_t sys_ipc_poke(void);
+extern sysarg_t sys_ipc_forward_fast(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, unsigned int);
+extern sysarg_t sys_ipc_forward_slow(sysarg_t, sysarg_t, ipc_data_t *,
+    unsigned int);
+extern sysarg_t sys_ipc_hangup(sysarg_t);
+extern sysarg_t sys_ipc_register_irq(inr_t, devno_t, sysarg_t, irq_code_t *);
+extern sysarg_t sys_ipc_unregister_irq(inr_t, devno_t);
+
+#ifdef __32_BITS__
+
+extern sysarg_t sys_ipc_connect_kbox(sysarg64_t *);
+
+#endif  /* __32_BITS__ */
+
+#ifdef __64_BITS__
+
+extern sysarg_t sys_ipc_connect_kbox(sysarg_t);
+
+#endif  /* __64_BITS__ */
 
 #endif
Index: kernel/generic/include/mm/as.h
===================================================================
--- kernel/generic/include/mm/as.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/mm/as.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -303,8 +303,8 @@
 
 /* Address space area related syscalls. */
-extern unative_t sys_as_area_create(uintptr_t, size_t, unsigned int);
-extern unative_t sys_as_area_resize(uintptr_t, size_t, unsigned int);
-extern unative_t sys_as_area_change_flags(uintptr_t, unsigned int);
-extern unative_t sys_as_area_destroy(uintptr_t);
+extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int);
+extern sysarg_t sys_as_area_resize(uintptr_t, size_t, unsigned int);
+extern sysarg_t sys_as_area_change_flags(uintptr_t, unsigned int);
+extern sysarg_t sys_as_area_destroy(uintptr_t);
 
 /* Introspection functions. */
Index: kernel/generic/include/mm/frame.h
===================================================================
--- kernel/generic/include/mm/frame.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/mm/frame.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -144,5 +144,5 @@
 
 #define IS_BUDDY_ORDER_OK(index, order) \
-    ((~(((unative_t) -1) << (order)) & (index)) == 0)
+    ((~(((sysarg_t) -1) << (order)) & (index)) == 0)
 #define IS_BUDDY_LEFT_BLOCK(zone, frame) \
     (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x01) == 0)
Index: kernel/generic/include/proc/program.h
===================================================================
--- kernel/generic/include/proc/program.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/proc/program.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -59,5 +59,5 @@
 extern void program_ready(program_t *);
 
-extern unative_t sys_program_spawn_loader(char *, size_t);
+extern sysarg_t sys_program_spawn_loader(char *, size_t);
 
 #endif
Index: kernel/generic/include/proc/task.h
===================================================================
--- kernel/generic/include/proc/task.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/proc/task.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -93,9 +93,4 @@
 	phone_t phones[IPC_MAX_PHONES];
 	stats_ipc_t ipc_info;   /**< IPC statistics */
-	/**
-	 * Active asynchronous messages. It is used for limiting uspace to
-	 * certain extent.
-	 */
-	atomic_t active_calls;
 	/** List of synchronous answerboxes. */
 	link_t sync_box_head;
@@ -150,6 +145,13 @@
 #endif
 
-extern unative_t sys_task_get_id(task_id_t *);
-extern unative_t sys_task_set_name(const char *, size_t);
+#ifdef __32_BITS__
+extern sysarg_t sys_task_get_id(sysarg64_t *);
+#endif
+
+#ifdef __64_BITS__
+extern sysarg_t sys_task_get_id(void);
+#endif
+
+extern sysarg_t sys_task_set_name(const char *, size_t);
 
 #endif
Index: kernel/generic/include/proc/thread.h
===================================================================
--- kernel/generic/include/proc/thread.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/proc/thread.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -241,9 +241,9 @@
 
 /* Thread syscall prototypes. */
-extern unative_t sys_thread_create(uspace_arg_t *, char *, size_t,
+extern sysarg_t sys_thread_create(uspace_arg_t *, char *, size_t,
     thread_id_t *);
-extern unative_t sys_thread_exit(int);
-extern unative_t sys_thread_get_id(thread_id_t *);
-extern unative_t sys_thread_usleep(uint32_t);
+extern sysarg_t sys_thread_exit(int);
+extern sysarg_t sys_thread_get_id(thread_id_t *);
+extern sysarg_t sys_thread_usleep(uint32_t);
 
 #endif
Index: kernel/generic/include/security/cap.h
===================================================================
--- kernel/generic/include/security/cap.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/security/cap.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -48,5 +48,4 @@
 #define __CAP_H__
 
-#include <syscall/sysarg64.h>
 #include <typedefs.h>
 
@@ -55,5 +54,5 @@
  * privilege to/from other tasks.
  */
-#define CAP_CAP			(1<<0)
+#define CAP_CAP  (1 << 0)
 
 /**
@@ -61,5 +60,5 @@
  * to other tasks.
  */
-#define CAP_MEM_MANAGER		(1<<1)
+#define CAP_MEM_MANAGER  (1 << 1)
 
 /**
@@ -67,15 +66,26 @@
  * to other tasks.
  */
-#define CAP_IO_MANAGER		(1<<2)
+#define CAP_IO_MANAGER  (1 << 2)
 
 /**
  * CAP_IRQ_REG entitles its holder to register IRQ handlers.
  */
-#define CAP_IRQ_REG		(1<<3) 
+#define CAP_IRQ_REG  (1 << 3)
 
 typedef uint32_t cap_t;
 
-extern unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps);
-extern unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps);
+#ifdef __32_BITS__
+
+extern sysarg_t sys_cap_grant(sysarg64_t *, cap_t);
+extern sysarg_t sys_cap_revoke(sysarg64_t *, cap_t);
+
+#endif  /* __32_BITS__ */
+
+#ifdef __64_BITS__
+
+extern sysarg_t sys_cap_grant(sysarg_t, cap_t);
+extern sysarg_t sys_cap_revoke(sysarg_t, cap_t);
+
+#endif  /* __64_BITS__ */
 
 #endif
Index: kernel/generic/include/synch/futex.h
===================================================================
--- kernel/generic/include/synch/futex.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/synch/futex.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -52,6 +52,6 @@
 
 extern void futex_init(void);
-extern unative_t sys_futex_sleep(uintptr_t);
-extern unative_t sys_futex_wakeup(uintptr_t);
+extern sysarg_t sys_futex_sleep(uintptr_t);
+extern sysarg_t sys_futex_wakeup(uintptr_t);
 
 extern void futex_cleanup(void);
Index: kernel/generic/include/synch/smc.h
===================================================================
--- kernel/generic/include/synch/smc.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/synch/smc.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -36,5 +36,5 @@
 #define KERN_SMC_H_
 
-extern unative_t sys_smc_coherence(uintptr_t va, size_t size);
+extern sysarg_t sys_smc_coherence(uintptr_t va, size_t size);
 
 #endif
Index: rnel/generic/include/syscall/sysarg64.h
===================================================================
--- kernel/generic/include/syscall/sysarg64.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,48 +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.
- */
-
-/** @addtogroup generic
- * @{
- */
-
-/**
- * @file
- * @brief Wrapper for explicit 64-bit arguments passed to syscalls.
- */
-
-#ifndef KERN_SYSARG64_H_
-#define KERN_SYSARG64_H_
-
-typedef struct {
-	unsigned long long value;
-} sysarg64_t;
-
-#endif
-
-/** @}
- */
Index: kernel/generic/include/syscall/syscall.h
===================================================================
--- kernel/generic/include/syscall/syscall.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/syscall/syscall.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -38,5 +38,5 @@
 typedef enum {
 	SYS_KLOG = 0,
-	SYS_TLS_SET = 1, /* Hardcoded in AMD64, IA32 uspace - fibril.S */
+	SYS_TLS_SET = 1,  /* Hardcoded for AMD64, IA-32 (fibril.S in uspace) */
 	
 	SYS_THREAD_CREATE,
@@ -71,4 +71,5 @@
 	SYS_IPC_REGISTER_IRQ,
 	SYS_IPC_UNREGISTER_IRQ,
+	SYS_IPC_CONNECT_KBOX,
 	
 	SYS_EVENT_SUBSCRIBE,
@@ -90,5 +91,4 @@
 	SYS_DEBUG_DISABLE_CONSOLE,
 	
-	SYS_IPC_CONNECT_KBOX,
 	SYSCALL_END
 } syscall_t;
@@ -98,11 +98,11 @@
 #include <typedefs.h>
 
-typedef unative_t (*syshandler_t)(unative_t, unative_t, unative_t, unative_t,
-    unative_t, unative_t);
+typedef sysarg_t (*syshandler_t)(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t);
 
 extern syshandler_t syscall_table[SYSCALL_END];
-extern unative_t syscall_handler(unative_t, unative_t, unative_t, unative_t,
-    unative_t, unative_t, unative_t);
-extern unative_t sys_tls_set(unative_t);
+extern sysarg_t syscall_handler(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t);
+extern sysarg_t sys_tls_set(sysarg_t);
 
 #endif
Index: kernel/generic/include/sysinfo/sysinfo.h
===================================================================
--- kernel/generic/include/sysinfo/sysinfo.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/sysinfo/sysinfo.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -65,5 +65,5 @@
 
 /** Gerated numeric value function */
-typedef unative_t (*sysinfo_fn_val_t)(struct sysinfo_item *);
+typedef sysarg_t (*sysinfo_fn_val_t)(struct sysinfo_item *);
 
 /** Generated binary data function */
@@ -82,5 +82,5 @@
  */
 typedef union {
-	unative_t val;              /**< Constant numberic value */
+	sysarg_t val;               /**< Constant numberic value */
 	sysinfo_fn_val_t fn_val;    /**< Generated numeric value function */
 	sysinfo_fn_data_t fn_data;  /**< Generated binary data function */
@@ -99,5 +99,5 @@
 	sysinfo_item_val_type_t tag;  /**< Return value type */
 	union {
-		unative_t val;            /**< Numberic value */
+		sysarg_t val;             /**< Numberic value */
 		sysinfo_data_t data;      /**< Binary data */
 	};
@@ -130,5 +130,5 @@
 } sysinfo_item_t;
 
-extern void sysinfo_set_item_val(const char *, sysinfo_item_t **, unative_t);
+extern void sysinfo_set_item_val(const char *, sysinfo_item_t **, sysarg_t);
 extern void sysinfo_set_item_data(const char *, sysinfo_item_t **, void *,
     size_t);
@@ -145,8 +145,8 @@
 extern void sysinfo_dump(sysinfo_item_t *);
 
-extern unative_t sys_sysinfo_get_tag(void *, size_t);
-extern unative_t sys_sysinfo_get_value(void *, size_t, void *);
-extern unative_t sys_sysinfo_get_data_size(void *, size_t, void *);
-extern unative_t sys_sysinfo_get_data(void *, size_t, void *, size_t);
+extern sysarg_t sys_sysinfo_get_tag(void *, size_t);
+extern sysarg_t sys_sysinfo_get_value(void *, size_t, void *);
+extern sysarg_t sys_sysinfo_get_data_size(void *, size_t, void *);
+extern sysarg_t sys_sysinfo_get_data(void *, size_t, void *, size_t);
 
 #endif
Index: kernel/generic/include/time/clock.h
===================================================================
--- kernel/generic/include/time/clock.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/time/clock.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -42,7 +42,7 @@
 /** Uptime structure */
 typedef struct {
-	unative_t seconds1;
-	unative_t useconds;
-	unative_t seconds2;
+	sysarg_t seconds1;
+	sysarg_t useconds;
+	sysarg_t seconds2;
 } uptime_t;
 
Index: kernel/generic/include/typedefs.h
===================================================================
--- kernel/generic/include/typedefs.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/typedefs.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -73,4 +73,11 @@
 typedef volatile uint32_t ioport32_t;
 
+#ifdef __32_BITS__
+
+/** Explicit 64-bit arguments passed to syscalls. */
+typedef uint64_t sysarg64_t;
+
+#endif /* __32_BITS__ */
+
 #endif
 
Index: kernel/generic/include/udebug/udebug.h
===================================================================
--- kernel/generic/include/udebug/udebug.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/udebug/udebug.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -212,5 +212,5 @@
 	waitq_t go_wq;
 	call_t *go_call;
-	unative_t syscall_args[6];
+	sysarg_t syscall_args[6];
 	istate_t *uspace_state;
 
@@ -229,6 +229,6 @@
 void udebug_thread_initialize(udebug_thread_t *ut);
 
-void udebug_syscall_event(unative_t a1, unative_t a2, unative_t a3,
-    unative_t a4, unative_t a5, unative_t a6, unative_t id, unative_t rc,
+void udebug_syscall_event(sysarg_t a1, sysarg_t a2, sysarg_t a3,
+    sysarg_t a4, sysarg_t a5, sysarg_t a6, sysarg_t id, sysarg_t rc,
     bool end_variant);
 
Index: kernel/generic/include/udebug/udebug_ops.h
===================================================================
--- kernel/generic/include/udebug/udebug_ops.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/include/udebug/udebug_ops.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -52,5 +52,5 @@
 int udebug_regs_read(thread_t *t, void **buffer);
 
-int udebug_mem_read(unative_t uspace_addr, size_t n, void **buffer);
+int udebug_mem_read(sysarg_t uspace_addr, size_t n, void **buffer);
 
 #endif
Index: kernel/generic/src/adt/hash_table.c
===================================================================
--- kernel/generic/src/adt/hash_table.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/adt/hash_table.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -82,5 +82,5 @@
  * @param item Item to be inserted into the hash table.
  */
-void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item)
+void hash_table_insert(hash_table_t *h, sysarg_t key[], link_t *item)
 {
 	size_t chain;
@@ -105,5 +105,5 @@
  * @return Matching item on success, NULL if there is no such item.
  */
-link_t *hash_table_find(hash_table_t *h, unative_t key[])
+link_t *hash_table_find(hash_table_t *h, sysarg_t key[])
 {
 	link_t *cur;
@@ -138,5 +138,5 @@
  * @param keys Number of keys in the key array.
  */
-void hash_table_remove(hash_table_t *h, unative_t key[], size_t keys)
+void hash_table_remove(hash_table_t *h, sysarg_t key[], size_t keys)
 {
 	size_t chain;
Index: kernel/generic/src/console/cmd.c
===================================================================
--- kernel/generic/src/console/cmd.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/console/cmd.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -601,5 +601,5 @@
 	
 	/* This doesn't have to be very accurate */
-	unative_t sec = uptime->seconds1;
+	sysarg_t sec = uptime->seconds1;
 	
 	printf("Up %" PRIun " days, %" PRIun " hours, %" PRIun " minutes, %" PRIun " seconds\n",
@@ -656,5 +656,5 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*fnc)(void);
+	sysarg_t (*fnc)(void);
 	fncptr_t fptr;
 	int rc;
@@ -672,5 +672,5 @@
 
 		ipl = interrupts_disable();
-		fnc = (unative_t (*)(void)) arch_construct_function(&fptr,
+		fnc = (sysarg_t (*)(void)) arch_construct_function(&fptr,
 		    (void *) symaddr, (void *) cmd_call0);
 		printf("Calling %s() (%p)\n", symbol, (void *) symaddr);
@@ -720,6 +720,6 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*fnc)(unative_t, ...);
-	unative_t arg1 = argv[1].intval;
+	sysarg_t (*fnc)(sysarg_t, ...);
+	sysarg_t arg1 = argv[1].intval;
 	fncptr_t fptr;
 	int rc;
@@ -737,5 +737,5 @@
 
 		ipl = interrupts_disable();
-		fnc = (unative_t (*)(unative_t, ...))
+		fnc = (sysarg_t (*)(sysarg_t, ...))
 		    arch_construct_function(&fptr, (void *) symaddr,
 		    (void *) cmd_call1);
@@ -756,7 +756,7 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*fnc)(unative_t, unative_t, ...);
-	unative_t arg1 = argv[1].intval;
-	unative_t arg2 = argv[2].intval;
+	sysarg_t (*fnc)(sysarg_t, sysarg_t, ...);
+	sysarg_t arg1 = argv[1].intval;
+	sysarg_t arg2 = argv[2].intval;
 	fncptr_t fptr;
 	int rc;
@@ -774,5 +774,5 @@
 
 		ipl = interrupts_disable();
-		fnc = (unative_t (*)(unative_t, unative_t, ...))
+		fnc = (sysarg_t (*)(sysarg_t, sysarg_t, ...))
 		    arch_construct_function(&fptr, (void *) symaddr,
 		    (void *) cmd_call2);
@@ -792,8 +792,8 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*fnc)(unative_t, unative_t, unative_t, ...);
-	unative_t arg1 = argv[1].intval;
-	unative_t arg2 = argv[2].intval;
-	unative_t arg3 = argv[3].intval;
+	sysarg_t (*fnc)(sysarg_t, sysarg_t, sysarg_t, ...);
+	sysarg_t arg1 = argv[1].intval;
+	sysarg_t arg2 = argv[2].intval;
+	sysarg_t arg3 = argv[3].intval;
 	fncptr_t fptr;
 	int rc;
@@ -811,5 +811,5 @@
 
 		ipl = interrupts_disable();
-		fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...))
+		fnc = (sysarg_t (*)(sysarg_t, sysarg_t, sysarg_t, ...))
 		    arch_construct_function(&fptr, (void *) symaddr,
 		    (void *) cmd_call3);
Index: kernel/generic/src/console/console.c
===================================================================
--- kernel/generic/src/console/console.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/console/console.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -162,5 +162,5 @@
 	ddi_parea_register(&klog_parea);
 	
-	sysinfo_set_item_val("klog.faddr", NULL, (unative_t) faddr);
+	sysinfo_set_item_val("klog.faddr", NULL, (sysarg_t) faddr);
 	sysinfo_set_item_val("klog.pages", NULL, KLOG_PAGES);
 	
@@ -193,5 +193,5 @@
 
 /** Tell kernel to get keyboard/console access again */
-unative_t sys_debug_enable_console(void)
+sysarg_t sys_debug_enable_console(void)
 {
 #ifdef CONFIG_KCONSOLE
@@ -204,5 +204,5 @@
 
 /** Tell kernel to relinquish keyboard/console access */
-unative_t sys_debug_disable_console(void)
+sysarg_t sys_debug_disable_console(void)
 {
 	release_console();
@@ -333,5 +333,5 @@
  *
  */
-unative_t sys_klog(int fd, const void *buf, size_t size)
+sysarg_t sys_klog(int fd, const void *buf, size_t size)
 {
 	char *data;
@@ -339,15 +339,15 @@
 	
 	if (size > PAGE_SIZE)
-		return (unative_t) ELIMIT;
+		return (sysarg_t) ELIMIT;
 	
 	if (size > 0) {
 		data = (char *) malloc(size + 1, 0);
 		if (!data)
-			return (unative_t) ENOMEM;
+			return (sysarg_t) ENOMEM;
 		
 		rc = copy_from_uspace(data, buf, size);
 		if (rc) {
 			free(data);
-			return (unative_t) rc;
+			return (sysarg_t) rc;
 		}
 		data[size] = 0;
Index: kernel/generic/src/console/kconsole.c
===================================================================
--- kernel/generic/src/console/kconsole.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/console/kconsole.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -426,5 +426,5 @@
 
 NO_TRACE static bool parse_int_arg(const char *text, size_t len,
-    unative_t *result)
+    sysarg_t *result)
 {
 	bool isaddr = false;
@@ -461,9 +461,9 @@
 		case EOK:
 			if (isaddr)
-				*result = (unative_t) symaddr;
+				*result = (sysarg_t) symaddr;
 			else if (isptr)
-				*result = **((unative_t **) symaddr);
+				*result = **((sysarg_t **) symaddr);
 			else
-				*result = *((unative_t *) symaddr);
+				*result = *((sysarg_t *) symaddr);
 			break;
 		default:
@@ -483,7 +483,7 @@
 			return false;
 		case EOK:
-			*result = (unative_t) value;
+			*result = (sysarg_t) value;
 			if (isptr)
-				*result = *((unative_t *) *result);
+				*result = *((sysarg_t *) *result);
 			break;
 		default:
@@ -629,5 +629,5 @@
 					    cmdline + start + 1,
 					    (end - start) - 1);
-					cmd->argv[i].intval = (unative_t) buf;
+					cmd->argv[i].intval = (sysarg_t) buf;
 					cmd->argv[i].vartype = ARG_TYPE_STRING;
 				} else {
Index: kernel/generic/src/ddi/ddi.c
===================================================================
--- kernel/generic/src/ddi/ddi.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ddi/ddi.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -232,8 +232,8 @@
  *
  */
-unative_t sys_physmem_map(unative_t phys_base, unative_t virt_base,
-    unative_t pages, unative_t flags)
-{
-	return (unative_t) ddi_physmem_map(ALIGN_DOWN((uintptr_t) phys_base,
+sysarg_t sys_physmem_map(sysarg_t phys_base, sysarg_t virt_base,
+    sysarg_t pages, sysarg_t flags)
+{
+	return (sysarg_t) ddi_physmem_map(ALIGN_DOWN((uintptr_t) phys_base,
 	    FRAME_SIZE), ALIGN_DOWN((uintptr_t) virt_base, PAGE_SIZE),
 	    (size_t) pages, (int) flags);
@@ -247,12 +247,12 @@
  *
  */
-unative_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg)
+sysarg_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg)
 {
 	ddi_ioarg_t arg;
 	int rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
 	if (rc != 0)
-		return (unative_t) rc;
-	
-	return (unative_t) ddi_iospace_enable((task_id_t) arg.task_id,
+		return (sysarg_t) rc;
+	
+	return (sysarg_t) ddi_iospace_enable((task_id_t) arg.task_id,
 	    (uintptr_t) arg.ioaddr, (size_t) arg.size);
 }
@@ -265,5 +265,5 @@
  * @retutn Zero on success, error code otherwise.
  */
-unative_t sys_interrupt_enable(int irq, int enable)
+sysarg_t sys_interrupt_enable(int irq, int enable)
 {
 /* FIXME: this needs to be generic code, or better not be in kernel at all. */
Index: kernel/generic/src/ddi/device.c
===================================================================
--- kernel/generic/src/ddi/device.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ddi/device.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -54,7 +54,7 @@
 }
 
-unative_t sys_device_assign_devno(void)
+sysarg_t sys_device_assign_devno(void)
 {
-	return (unative_t) device_assign_devno();
+	return (sysarg_t) device_assign_devno();
 }
 
Index: kernel/generic/src/ddi/irq.c
===================================================================
--- kernel/generic/src/ddi/irq.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ddi/irq.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -106,6 +106,6 @@
  *
  */
-static size_t irq_ht_hash(unative_t *key);
-static bool irq_ht_compare(unative_t *key, size_t keys, link_t *item);
+static size_t irq_ht_hash(sysarg_t *key);
+static bool irq_ht_compare(sysarg_t *key, size_t keys, link_t *item);
 static void irq_ht_remove(link_t *item);
 
@@ -123,6 +123,6 @@
  *
  */
-static size_t irq_lin_hash(unative_t *key);
-static bool irq_lin_compare(unative_t *key, size_t keys, link_t *item);
+static size_t irq_lin_hash(sysarg_t *key);
+static bool irq_lin_compare(sysarg_t *key, size_t keys, link_t *item);
 static void irq_lin_remove(link_t *item);
 
@@ -136,4 +136,7 @@
 static size_t buckets;
 
+/** Last valid INR. */
+inr_t last_inr = 0;
+
 /** Initialize IRQ subsystem.
  *
@@ -145,4 +148,6 @@
 {
 	buckets = chains;
+	last_inr = inrs - 1;
+
 	/*
 	 * Be smart about the choice of the hash table operations.
@@ -194,7 +199,7 @@
 void irq_register(irq_t *irq)
 {
-	unative_t key[] = {
-		(unative_t) irq->inr,
-		(unative_t) irq->devno
+	sysarg_t key[] = {
+		(sysarg_t) irq->inr,
+		(sysarg_t) irq->devno
 	};
 	
@@ -212,7 +217,7 @@
 {
 	link_t *lnk;
-	unative_t key[] = {
-		(unative_t) inr,
-		(unative_t) -1    /* Search will use claim() instead of devno */
+	sysarg_t key[] = {
+		(sysarg_t) inr,
+		(sysarg_t) -1    /* Search will use claim() instead of devno */
 	};
 	
@@ -235,7 +240,7 @@
 {
 	link_t *lnk;
-	unative_t key[] = {
-		(unative_t) inr,
-		(unative_t) -1    /* Search will use claim() instead of devno */
+	sysarg_t key[] = {
+		(sysarg_t) inr,
+		(sysarg_t) -1    /* Search will use claim() instead of devno */
 	};
 	
@@ -306,5 +311,5 @@
  *
  */
-size_t irq_ht_hash(unative_t key[])
+size_t irq_ht_hash(sysarg_t key[])
 {
 	inr_t inr = (inr_t) key[KEY_INR];
@@ -333,5 +338,5 @@
  *
  */
-bool irq_ht_compare(unative_t key[], size_t keys, link_t *item)
+bool irq_ht_compare(sysarg_t key[], size_t keys, link_t *item)
 {
 	irq_t *irq = hash_table_get_instance(item, irq_t, link);
@@ -381,5 +386,5 @@
  *
  */
-size_t irq_lin_hash(unative_t key[])
+size_t irq_lin_hash(sysarg_t key[])
 {
 	inr_t inr = (inr_t) key[KEY_INR];
@@ -408,5 +413,5 @@
  *
  */
-bool irq_lin_compare(unative_t key[], size_t keys, link_t *item)
+bool irq_lin_compare(sysarg_t key[], size_t keys, link_t *item)
 {
 	irq_t *irq = list_get_instance(item, irq_t, link);
Index: kernel/generic/src/interrupt/interrupt.c
===================================================================
--- kernel/generic/src/interrupt/interrupt.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/interrupt/interrupt.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -197,5 +197,5 @@
 		/* Notify the subscriber that a fault occurred. */
 		event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid),
-		    UPPER32(TASK->taskid), (unative_t) THREAD);
+		    UPPER32(TASK->taskid), (sysarg_t) THREAD);
 		
 #ifdef CONFIG_UDEBUG
@@ -263,5 +263,5 @@
 		
 		const char *symbol =
-		    symtab_fmt_name_lookup((unative_t) exc_table[i].handler);
+		    symtab_fmt_name_lookup((sysarg_t) exc_table[i].handler);
 		
 #ifdef __32_BITS__
Index: kernel/generic/src/ipc/event.c
===================================================================
--- kernel/generic/src/ipc/event.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ipc/event.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -57,9 +57,9 @@
 		events[i].answerbox = NULL;
 		events[i].counter = 0;
-		events[i].method = 0;
+		events[i].imethod = 0;
 	}
 }
 
-static int event_subscribe(event_type_t evno, unative_t method,
+static int event_subscribe(event_type_t evno, sysarg_t imethod,
     answerbox_t *answerbox)
 {
@@ -73,5 +73,5 @@
 	if (events[evno].answerbox == NULL) {
 		events[evno].answerbox = answerbox;
-		events[evno].method = method;
+		events[evno].imethod = imethod;
 		events[evno].counter = 0;
 		res = EOK;
@@ -84,8 +84,8 @@
 }
 
-unative_t sys_event_subscribe(unative_t evno, unative_t method)
+sysarg_t sys_event_subscribe(sysarg_t evno, sysarg_t imethod)
 {
-	return (unative_t) event_subscribe((event_type_t) evno, (unative_t)
-	    method, &TASK->answerbox);
+	return (sysarg_t) event_subscribe((event_type_t) evno, (sysarg_t)
+	    imethod, &TASK->answerbox);
 }
 
@@ -113,5 +113,5 @@
 			events[i].answerbox = NULL;
 			events[i].counter = 0;
-			events[i].method = 0;
+			events[i].imethod = 0;
 		}
 		spinlock_unlock(&events[i].lock);
@@ -119,6 +119,6 @@
 }
 
-void event_notify(event_type_t evno, unative_t a1, unative_t a2, unative_t a3,
-    unative_t a4, unative_t a5)
+void event_notify(event_type_t evno, sysarg_t a1, sysarg_t a2, sysarg_t a3,
+    sysarg_t a4, sysarg_t a5)
 {
 	ASSERT(evno < EVENT_END);
@@ -130,5 +130,5 @@
 			call->flags |= IPC_CALL_NOTIF;
 			call->priv = ++events[evno].counter;
-			IPC_SET_METHOD(call->data, events[evno].method);
+			IPC_SET_IMETHOD(call->data, events[evno].imethod);
 			IPC_SET_ARG1(call->data, a1);
 			IPC_SET_ARG2(call->data, a2);
Index: kernel/generic/src/ipc/ipc.c
===================================================================
--- kernel/generic/src/ipc/ipc.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ipc/ipc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -270,5 +270,5 @@
  *
  */
-void ipc_backsend_err(phone_t *phone, call_t *call, unative_t err)
+void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
 {
 	call->data.phone = phone;
@@ -367,5 +367,5 @@
 		
 		call_t *call = ipc_call_alloc(0);
-		IPC_SET_METHOD(call->data, IPC_M_PHONE_HUNGUP);
+		IPC_SET_IMETHOD(call->data, IPC_M_PHONE_HUNGUP);
 		call->flags |= IPC_CALL_DISCARD_ANSWER;
 		_ipc_call(phone, box, call);
@@ -547,5 +547,5 @@
 			 * disconnected.
 			 */
-			IPC_SET_METHOD(call->data, IPC_M_PHONE_HUNGUP);
+			IPC_SET_IMETHOD(call->data, IPC_M_PHONE_HUNGUP);
 			call->flags |= IPC_CALL_DISCARD_ANSWER;
 			_ipc_call(phone, box, call);
@@ -655,12 +655,4 @@
 		    (call->flags & IPC_CALL_NOTIF));
 		
-		/*
-		 * Record the receipt of this call in the current task's counter
-		 * of active calls. IPC_M_PHONE_HUNGUP calls do not contribute
-		 * to this counter so do not record answers to them either.
-		 */
-		if (!(call->flags & IPC_CALL_DISCARD_ANSWER))
-			atomic_dec(&TASK->active_calls);
-		
 		ipc_call_free(call);
 	}
@@ -749,5 +741,5 @@
 		    " A4:%" PRIun " A5:%" PRIun " Flags:%x\n", call,
 		    call->sender->taskid,
-		    IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
+		    IPC_GET_IMETHOD(call->data), IPC_GET_ARG1(call->data),
 		    IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
 		    IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data),
@@ -765,5 +757,5 @@
 		    " A4:%" PRIun " A5:%" PRIun " Flags:%x\n", call,
 		    call->sender->taskid,
-		    IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
+		    IPC_GET_IMETHOD(call->data), IPC_GET_ARG1(call->data),
 		    IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
 		    IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data),
@@ -779,5 +771,5 @@
 		printf("Callid:%p M:%" PRIun " A1:%" PRIun " A2:%" PRIun
 		    " A3:%" PRIun " A4:%" PRIun " A5:%" PRIun " Flags:%x\n",
-		    call, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
+		    call, IPC_GET_IMETHOD(call->data), IPC_GET_ARG1(call->data),
 		    IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
 		    IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data),
Index: kernel/generic/src/ipc/ipcrsc.c
===================================================================
--- kernel/generic/src/ipc/ipcrsc.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ipc/ipcrsc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -144,5 +144,5 @@
  *
  */
-call_t *get_call(unative_t callid)
+call_t *get_call(sysarg_t callid)
 {
 	link_t *lst;
@@ -153,5 +153,5 @@
 	    lst != &TASK->answerbox.dispatched_calls; lst = lst->next) {
 		call_t *call = list_get_instance(lst, call_t, link);
-		if ((unative_t) call == callid) {
+		if ((sysarg_t) call == callid) {
 			result = call;
 			break;
Index: kernel/generic/src/ipc/irq.c
===================================================================
--- kernel/generic/src/ipc/irq.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ipc/irq.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -42,5 +42,6 @@
  *
  * The structure of a notification message is as follows:
- * - METHOD: method as registered by the SYS_IPC_REGISTER_IRQ syscall
+ * - IMETHOD: interface and method as registered by the SYS_IPC_REGISTER_IRQ
+ *            syscall
  * - ARG1: payload modified by a 'top-half' handler
  * - ARG2: payload modified by a 'top-half' handler
@@ -49,5 +50,5 @@
  * - ARG5: payload modified by a 'top-half' handler
  * - in_phone_hash: interrupt counter (may be needed to assure correct order
- *         in multithreaded drivers)
+ *                  in multithreaded drivers)
  *
  * Note on synchronization for ipc_irq_register(), ipc_irq_unregister(),
@@ -130,20 +131,23 @@
 /** Register an answerbox as a receiving end for IRQ notifications.
  *
- * @param box    Receiving answerbox.
- * @param inr    IRQ number.
- * @param devno  Device number.
- * @param method Method to be associated with the notification.
- * @param ucode  Uspace pointer to top-half pseudocode.
- *
- * @return EBADMEM, ENOENT or EEXISTS on failure or 0 on success.
+ * @param box		Receiving answerbox.
+ * @param inr		IRQ number.
+ * @param devno		Device number.
+ * @param imethod	Interface and method to be associated with the
+ *			notification.
+ * @param ucode		Uspace pointer to top-half pseudocode.
+ * @return		EOK on success or a negative error code.
  *
  */
 int ipc_irq_register(answerbox_t *box, inr_t inr, devno_t devno,
-    unative_t method, irq_code_t *ucode)
-{
-	unative_t key[] = {
-		(unative_t) inr,
-		(unative_t) devno
+    sysarg_t imethod, irq_code_t *ucode)
+{
+	sysarg_t key[] = {
+		(sysarg_t) inr,
+		(sysarg_t) devno
 	};
+
+	if ((inr < 0) || (inr > last_inr))
+		return ELIMIT;
 	
 	irq_code_t *code;
@@ -167,5 +171,5 @@
 	irq->notif_cfg.notify = true;
 	irq->notif_cfg.answerbox = box;
-	irq->notif_cfg.method = method;
+	irq->notif_cfg.imethod = imethod;
 	irq->notif_cfg.code = code;
 	irq->notif_cfg.counter = 0;
@@ -206,15 +210,18 @@
 /** Unregister task from IRQ notification.
  *
- * @param box   Answerbox associated with the notification.
- * @param inr   IRQ number.
- * @param devno Device number.
- *
+ * @param box		Answerbox associated with the notification.
+ * @param inr		IRQ number.
+ * @param devno		Device number.
+ * @return		EOK on success or a negative error code.
  */
 int ipc_irq_unregister(answerbox_t *box, inr_t inr, devno_t devno)
 {
-	unative_t key[] = {
-		(unative_t) inr,
-		(unative_t) devno
+	sysarg_t key[] = {
+		(sysarg_t) inr,
+		(sysarg_t) devno
 	};
+
+	if ((inr < 0) || (inr > last_inr))
+		return ELIMIT;
 	
 	irq_spinlock_lock(&irq_uspace_hash_table_lock, true);
@@ -290,5 +297,5 @@
 		}
 		
-		unative_t key[2];
+		sysarg_t key[2];
 		key[0] = irq->inr;
 		key[1] = irq->devno;
@@ -444,5 +451,5 @@
 		
 		/* Set up args */
-		IPC_SET_METHOD(call->data, irq->notif_cfg.method);
+		IPC_SET_IMETHOD(call->data, irq->notif_cfg.imethod);
 		IPC_SET_ARG1(call->data, irq->notif_cfg.scratch[1]);
 		IPC_SET_ARG2(call->data, irq->notif_cfg.scratch[2]);
@@ -465,6 +472,6 @@
  *
  */
-void ipc_irq_send_msg(irq_t *irq, unative_t a1, unative_t a2, unative_t a3,
-    unative_t a4, unative_t a5)
+void ipc_irq_send_msg(irq_t *irq, sysarg_t a1, sysarg_t a2, sysarg_t a3,
+    sysarg_t a4, sysarg_t a5)
 {
 	irq_spinlock_lock(&irq->lock, true);
@@ -481,5 +488,5 @@
 		call->priv = ++irq->notif_cfg.counter;
 		
-		IPC_SET_METHOD(call->data, irq->notif_cfg.method);
+		IPC_SET_IMETHOD(call->data, irq->notif_cfg.imethod);
 		IPC_SET_ARG1(call->data, a1);
 		IPC_SET_ARG2(call->data, a2);
Index: kernel/generic/src/ipc/kbox.c
===================================================================
--- kernel/generic/src/ipc/kbox.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ipc/kbox.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -167,5 +167,5 @@
 			continue;  /* Try again. */
 		
-		switch (IPC_GET_METHOD(call->data)) {
+		switch (IPC_GET_IMETHOD(call->data)) {
 		
 		case IPC_M_DEBUG_ALL:
@@ -192,5 +192,4 @@
 }
 
-
 /** Connect phone to a task kernel-box specified by id.
  *
Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/ipc/sysipc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -49,4 +49,5 @@
 #include <syscall/copy.h>
 #include <security/cap.h>
+#include <console/console.h>
 #include <mm/as.h>
 #include <print.h>
@@ -68,5 +69,5 @@
  *
  */
-static int phone_get(unative_t phoneid, phone_t **phone)
+static int phone_get(sysarg_t phoneid, phone_t **phone)
 {
 	if (phoneid >= IPC_MAX_PHONES)
@@ -77,14 +78,15 @@
 }
 
-/** Decide if the method is a system method.
- *
- * @param method Method to be decided.
- *
- * @return true if the method is a system method.
- *
- */
-static inline bool method_is_system(unative_t method)
-{
-	if (method <= IPC_M_LAST_SYSTEM)
+/** Decide if the interface and method is a system method.
+ *
+ * @param imethod Interface and method to be decided.
+ *
+ * @return True if the interface and method is a system
+ *         interface and method.
+ *
+ */
+static inline bool method_is_system(sysarg_t imethod)
+{
+	if (imethod <= IPC_M_LAST_SYSTEM)
 		return true;
 	
@@ -92,17 +94,17 @@
 }
 
-/** Decide if the message with this method is forwardable.
- *
- * - some system messages may be forwarded, for some of them
- *   it is useless
- *
- * @param method Method to be decided.
- *
- * @return true if the method is forwardable.
- *
- */
-static inline bool method_is_forwardable(unative_t method)
-{
-	switch (method) {
+/** Decide if the message with this interface and method is forwardable.
+ *
+ * Some system messages may be forwarded, for some of them
+ * it is useless.
+ *
+ * @param imethod Interface and method to be decided.
+ *
+ * @return True if the interface and method is forwardable.
+ *
+ */
+static inline bool method_is_forwardable(sysarg_t imethod)
+{
+	switch (imethod) {
 	case IPC_M_CONNECTION_CLONE:
 	case IPC_M_CONNECT_ME:
@@ -115,16 +117,16 @@
 }
 
-/** Decide if the message with this method is immutable on forward.
- *
- * - some system messages may be forwarded but their content cannot be altered
- *
- * @param method Method to be decided.
- *
- * @return true if the method is immutable on forward.
- *
- */
-static inline bool method_is_immutable(unative_t method)
-{
-	switch (method) {
+/** Decide if the message with this interface and method is immutable on forward.
+ *
+ * Some system messages may be forwarded but their content cannot be altered.
+ *
+ * @param imethod Interface and method to be decided.
+ *
+ * @return True if the interface and method is immutable on forward.
+ *
+ */
+static inline bool method_is_immutable(sysarg_t imethod)
+{
+	switch (imethod) {
 	case IPC_M_SHARE_OUT:
 	case IPC_M_SHARE_IN:
@@ -152,5 +154,5 @@
 static inline bool answer_need_old(call_t *call)
 {
-	switch (IPC_GET_METHOD(call->data)) {
+	switch (IPC_GET_IMETHOD(call->data)) {
 	case IPC_M_CONNECTION_CLONE:
 	case IPC_M_CONNECT_ME:
@@ -196,5 +198,5 @@
 		return 0;
 	
-	if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECTION_CLONE) {
+	if (IPC_GET_IMETHOD(*olddata) == IPC_M_CONNECTION_CLONE) {
 		int phoneid = IPC_GET_ARG1(*olddata);
 		phone_t *phone = &TASK->phones[phoneid];
@@ -218,5 +220,5 @@
 			mutex_unlock(&phone->lock);
 		}
-	} else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME) {
+	} else if (IPC_GET_IMETHOD(*olddata) == IPC_M_CONNECT_ME) {
 		phone_t *phone = (phone_t *) IPC_GET_ARG5(*olddata);
 		
@@ -237,5 +239,5 @@
 			mutex_unlock(&phone->lock);
 		}
-	} else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_TO_ME) {
+	} else if (IPC_GET_IMETHOD(*olddata) == IPC_M_CONNECT_TO_ME) {
 		int phoneid = IPC_GET_ARG5(*olddata);
 		
@@ -248,7 +250,7 @@
 			/* Set 'phone hash' as arg5 of response */
 			IPC_SET_ARG5(answer->data,
-			    (unative_t) &TASK->phones[phoneid]);
-		}
-	} else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) {
+			    (sysarg_t) &TASK->phones[phoneid]);
+		}
+	} else if (IPC_GET_IMETHOD(*olddata) == IPC_M_CONNECT_ME_TO) {
 		/* If the users accepted call, connect */
 		if (IPC_GET_RETVAL(answer->data) == EOK) {
@@ -256,5 +258,5 @@
 			    &TASK->answerbox);
 		}
-	} else if (IPC_GET_METHOD(*olddata) == IPC_M_SHARE_OUT) {
+	} else if (IPC_GET_IMETHOD(*olddata) == IPC_M_SHARE_OUT) {
 		if (!IPC_GET_RETVAL(answer->data)) {
 			/* Accepted, handle as_area receipt */
@@ -270,5 +272,5 @@
 			return rc;
 		}
-	} else if (IPC_GET_METHOD(*olddata) == IPC_M_SHARE_IN) {
+	} else if (IPC_GET_IMETHOD(*olddata) == IPC_M_SHARE_IN) {
 		if (!IPC_GET_RETVAL(answer->data)) { 
 			irq_spinlock_lock(&answer->sender->lock, true);
@@ -281,5 +283,5 @@
 			IPC_SET_RETVAL(answer->data, rc);
 		}
-	} else if (IPC_GET_METHOD(*olddata) == IPC_M_DATA_READ) {
+	} else if (IPC_GET_IMETHOD(*olddata) == IPC_M_DATA_READ) {
 		ASSERT(!answer->buffer);
 		if (!IPC_GET_RETVAL(answer->data)) {
@@ -310,5 +312,5 @@
 			}
 		}
-	} else if (IPC_GET_METHOD(*olddata) == IPC_M_DATA_WRITE) {
+	} else if (IPC_GET_IMETHOD(*olddata) == IPC_M_DATA_WRITE) {
 		ASSERT(answer->buffer);
 		if (!IPC_GET_RETVAL(answer->data)) {
@@ -363,5 +365,5 @@
 static int request_preprocess(call_t *call, phone_t *phone)
 {
-	switch (IPC_GET_METHOD(call->data)) {
+	switch (IPC_GET_IMETHOD(call->data)) {
 	case IPC_M_CONNECTION_CLONE: {
 		phone_t *cloned_phone;
@@ -399,5 +401,5 @@
 	}
 	case IPC_M_CONNECT_ME:
-		IPC_SET_ARG5(call->data, (unative_t) phone);
+		IPC_SET_ARG5(call->data, (sysarg_t) phone);
 		break;
 	case IPC_M_CONNECT_ME_TO: {
@@ -407,5 +409,5 @@
 		
 		/* Set arg5 for server */
-		IPC_SET_ARG5(call->data, (unative_t) &TASK->phones[newphid]);
+		IPC_SET_ARG5(call->data, (sysarg_t) &TASK->phones[newphid]);
 		call->flags |= IPC_CALL_CONN_ME_TO;
 		call->priv = newphid;
@@ -503,5 +505,5 @@
 static int process_request(answerbox_t *box, call_t *call)
 {
-	if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) {
+	if (IPC_GET_IMETHOD(call->data) == IPC_M_CONNECT_TO_ME) {
 		int phoneid = phone_alloc(TASK);
 		if (phoneid < 0) { /* Failed to allocate phone */
@@ -514,5 +516,5 @@
 	}
 	
-	switch (IPC_GET_METHOD(call->data)) {
+	switch (IPC_GET_IMETHOD(call->data)) {
 	case IPC_M_DEBUG_ALL:
 		return -1;
@@ -530,9 +532,9 @@
  *
  * @param phoneid Phone handle for the call.
- * @param method  Method of the call.
+ * @param imethod Interface and method of the call.
  * @param arg1    Service-defined payload argument.
  * @param arg2    Service-defined payload argument.
  * @param arg3    Service-defined payload argument.
- * @param data    Address of userspace structure where the reply call will
+ * @param data    Address of user-space structure where the reply call will
  *                be stored.
  *
@@ -541,13 +543,13 @@
  *
  */
-unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method,
-    unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data)
+sysarg_t sys_ipc_call_sync_fast(sysarg_t phoneid, sysarg_t imethod,
+    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, ipc_data_t *data)
 {
 	phone_t *phone;
 	if (phone_get(phoneid, &phone) != EOK)
 		return ENOENT;
-
+	
 	call_t *call = ipc_call_alloc(0);
-	IPC_SET_METHOD(call->data, method);
+	IPC_SET_IMETHOD(call->data, imethod);
 	IPC_SET_ARG1(call->data, arg1);
 	IPC_SET_ARG2(call->data, arg2);
@@ -579,5 +581,4 @@
 		
 		process_answer(call);
-		
 	} else
 		IPC_SET_RETVAL(call->data, res);
@@ -593,13 +594,13 @@
 /** Make a synchronous IPC call allowing to transmit the entire payload.
  *
- * @param phoneid  Phone handle for the call.
- * @param question Userspace address of call data with the request.
- * @param reply    Userspace address of call data where to store the
- *                 answer.
+ * @param phoneid Phone handle for the call.
+ * @param request User-space address of call data with the request.
+ * @param reply   User-space address of call data where to store the
+ *                answer.
  *
  * @return Zero on success or an error code.
  *
  */
-unative_t sys_ipc_call_sync_slow(unative_t phoneid, ipc_data_t *question,
+sysarg_t sys_ipc_call_sync_slow(sysarg_t phoneid, ipc_data_t *request,
     ipc_data_t *reply)
 {
@@ -607,11 +608,11 @@
 	if (phone_get(phoneid, &phone) != EOK)
 		return ENOENT;
-
+	
 	call_t *call = ipc_call_alloc(0);
-	int rc = copy_from_uspace(&call->data.args, &question->args,
+	int rc = copy_from_uspace(&call->data.args, &request->args,
 	    sizeof(call->data.args));
 	if (rc != 0) {
 		ipc_call_free(call);
-		return (unative_t) rc;
+		return (sysarg_t) rc;
 	}
 	
@@ -644,15 +645,16 @@
 }
 
-/** Check that the task did not exceed the allowed limit of asynchronous calls.
+/** Check that the task did not exceed the allowed limit of asynchronous calls
+ * made over a phone.
+ *
+ * @param phone Phone to check the limit against.
  *
  * @return 0 if limit not reached or -1 if limit exceeded.
  *
  */
-static int check_call_limit(void)
-{
-	if (atomic_preinc(&TASK->active_calls) > IPC_MAX_ASYNC_CALLS) {
-		atomic_dec(&TASK->active_calls);
+static int check_call_limit(phone_t *phone)
+{
+	if (atomic_get(&phone->active_calls) >= IPC_MAX_ASYNC_CALLS)
 		return -1;
-	}
 	
 	return 0;
@@ -665,5 +667,5 @@
  *
  * @param phoneid Phone handle for the call.
- * @param method  Method of the call.
+ * @param imethod Interface and method of the call.
  * @param arg1    Service-defined payload argument.
  * @param arg2    Service-defined payload argument.
@@ -677,16 +679,16 @@
  *
  */
-unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method,
-    unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4)
-{
-	if (check_call_limit())
-		return IPC_CALLRET_TEMPORARY;
-	
+sysarg_t sys_ipc_call_async_fast(sysarg_t phoneid, sysarg_t imethod,
+    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
+{
 	phone_t *phone;
 	if (phone_get(phoneid, &phone) != EOK)
 		return IPC_CALLRET_FATAL;
 	
+	if (check_call_limit(phone))
+		return IPC_CALLRET_TEMPORARY;
+	
 	call_t *call = ipc_call_alloc(0);
-	IPC_SET_METHOD(call->data, method);
+	IPC_SET_IMETHOD(call->data, imethod);
 	IPC_SET_ARG1(call->data, arg1);
 	IPC_SET_ARG2(call->data, arg2);
@@ -707,5 +709,5 @@
 		ipc_backsend_err(phone, call, res);
 	
-	return (unative_t) call;
+	return (sysarg_t) call;
 }
 
@@ -718,12 +720,12 @@
  *
  */
-unative_t sys_ipc_call_async_slow(unative_t phoneid, ipc_data_t *data)
-{
-	if (check_call_limit())
-		return IPC_CALLRET_TEMPORARY;
-	
+sysarg_t sys_ipc_call_async_slow(sysarg_t phoneid, ipc_data_t *data)
+{
 	phone_t *phone;
 	if (phone_get(phoneid, &phone) != EOK)
 		return IPC_CALLRET_FATAL;
+
+	if (check_call_limit(phone))
+		return IPC_CALLRET_TEMPORARY;
 
 	call_t *call = ipc_call_alloc(0);
@@ -732,5 +734,5 @@
 	if (rc != 0) {
 		ipc_call_free(call);
-		return (unative_t) rc;
+		return (sysarg_t) rc;
 	}
 	
@@ -742,5 +744,5 @@
 		ipc_backsend_err(phone, call, res);
 	
-	return (unative_t) call;
+	return (sysarg_t) call;
 }
 
@@ -751,5 +753,5 @@
  * @param callid  Hash of the call to forward.
  * @param phoneid Phone handle to use for forwarding.
- * @param method  New method to use for the forwarded call.
+ * @param imethod New interface and method to use for the forwarded call.
  * @param arg1    New value of the first argument for the forwarded call.
  * @param arg2    New value of the second argument for the forwarded call.
@@ -767,7 +769,7 @@
  *
  */
-static unative_t sys_ipc_forward_common(unative_t callid, unative_t phoneid,
-    unative_t method, unative_t arg1, unative_t arg2, unative_t arg3,
-    unative_t arg4, unative_t arg5, unsigned int mode, bool slow)
+static sysarg_t sys_ipc_forward_common(sysarg_t callid, sysarg_t phoneid,
+    sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3,
+    sysarg_t arg4, sysarg_t arg5, unsigned int mode, bool slow)
 {
 	call_t *call = get_call(callid);
@@ -784,5 +786,5 @@
 	}
 	
-	if (!method_is_forwardable(IPC_GET_METHOD(call->data))) {
+	if (!method_is_forwardable(IPC_GET_IMETHOD(call->data))) {
 		IPC_SET_RETVAL(call->data, EFORWARD);
 		ipc_answer(&TASK->answerbox, call);
@@ -791,15 +793,15 @@
 	
 	/*
-	 * Userspace is not allowed to change method of system methods on
-	 * forward, allow changing ARG1, ARG2, ARG3 and ARG4 by means of method,
-	 * arg1, arg2 and arg3.
-	 * If the method is immutable, don't change anything.
+	 * Userspace is not allowed to change interface and method of system
+	 * methods on forward, allow changing ARG1, ARG2, ARG3 and ARG4 by
+	 * means of method, arg1, arg2 and arg3.
+	 * If the interface and method is immutable, don't change anything.
 	 */
-	if (!method_is_immutable(IPC_GET_METHOD(call->data))) {
-		if (method_is_system(IPC_GET_METHOD(call->data))) {
-			if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME)
+	if (!method_is_immutable(IPC_GET_IMETHOD(call->data))) {
+		if (method_is_system(IPC_GET_IMETHOD(call->data))) {
+			if (IPC_GET_IMETHOD(call->data) == IPC_M_CONNECT_TO_ME)
 				phone_dealloc(IPC_GET_ARG5(call->data));
 			
-			IPC_SET_ARG1(call->data, method);
+			IPC_SET_ARG1(call->data, imethod);
 			IPC_SET_ARG2(call->data, arg1);
 			IPC_SET_ARG3(call->data, arg2);
@@ -813,5 +815,5 @@
 			}
 		} else {
-			IPC_SET_METHOD(call->data, method);
+			IPC_SET_IMETHOD(call->data, imethod);
 			IPC_SET_ARG1(call->data, arg1);
 			IPC_SET_ARG2(call->data, arg2);
@@ -829,14 +831,14 @@
 /** Forward a received call to another destination - fast version.
  *
- * In case the original method is a system method, ARG1, ARG2 and ARG3 are
- * overwritten in the forwarded message with the new method and the new
- * arg1 and arg2, respectively. Otherwise the METHOD, ARG1 and ARG2 are
- * rewritten with the new method, arg1 and arg2, respectively. Also note there
- * is a set of immutable methods, for which the new method and arguments are not
- * set and these values are ignored.
+ * In case the original interface and method is a system method, ARG1, ARG2
+ * and ARG3 are overwritten in the forwarded message with the new method and
+ * the new arg1 and arg2, respectively. Otherwise the IMETHOD, ARG1 and ARG2
+ * are rewritten with the new interface and method, arg1 and arg2, respectively.
+ * Also note there is a set of immutable methods, for which the new method and
+ * arguments are not set and these values are ignored.
  *
  * @param callid  Hash of the call to forward.
  * @param phoneid Phone handle to use for forwarding.
- * @param method  New method to use for the forwarded call.
+ * @param imethod New interface and method to use for the forwarded call.
  * @param arg1    New value of the first argument for the forwarded call.
  * @param arg2    New value of the second argument for the forwarded call.
@@ -846,8 +848,8 @@
  *
  */
-unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid,
-    unative_t method, unative_t arg1, unative_t arg2, unsigned int mode)
-{
-	return sys_ipc_forward_common(callid, phoneid, method, arg1, arg2, 0, 0,
+sysarg_t sys_ipc_forward_fast(sysarg_t callid, sysarg_t phoneid,
+    sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode)
+{
+	return sys_ipc_forward_common(callid, phoneid, imethod, arg1, arg2, 0, 0,
 	    0, mode, false); 
 }
@@ -856,9 +858,9 @@
  *
  * This function is the slow verision of the sys_ipc_forward_fast interface.
- * It can copy all five new arguments and the new method from the userspace.
- * It naturally extends the functionality of the fast version. For system
- * methods, it additionally stores the new value of arg3 to ARG4. For non-system
- * methods, it additionally stores the new value of arg3, arg4 and arg5,
- * respectively, to ARG3, ARG4 and ARG5, respectively.
+ * It can copy all five new arguments and the new interface and method from
+ * the userspace. It naturally extends the functionality of the fast version.
+ * For system methods, it additionally stores the new value of arg3 to ARG4.
+ * For non-system methods, it additionally stores the new value of arg3, arg4
+ * and arg5, respectively, to ARG3, ARG4 and ARG5, respectively.
  *
  * @param callid  Hash of the call to forward.
@@ -870,5 +872,5 @@
  *
  */
-unative_t sys_ipc_forward_slow(unative_t callid, unative_t phoneid,
+sysarg_t sys_ipc_forward_slow(sysarg_t callid, sysarg_t phoneid,
     ipc_data_t *data, unsigned int mode)
 {
@@ -877,8 +879,8 @@
 	    sizeof(newdata.args));
 	if (rc != 0)
-		return (unative_t) rc;
+		return (sysarg_t) rc;
 	
 	return sys_ipc_forward_common(callid, phoneid,
-	    IPC_GET_METHOD(newdata), IPC_GET_ARG1(newdata),
+	    IPC_GET_IMETHOD(newdata), IPC_GET_ARG1(newdata),
 	    IPC_GET_ARG2(newdata), IPC_GET_ARG3(newdata),
 	    IPC_GET_ARG4(newdata), IPC_GET_ARG5(newdata), mode, true); 
@@ -900,6 +902,6 @@
  *
  */
-unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval,
-    unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4)
+sysarg_t sys_ipc_answer_fast(sysarg_t callid, sysarg_t retval,
+    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
 {
 	/* Do not answer notification callids */
@@ -945,5 +947,5 @@
  *
  */
-unative_t sys_ipc_answer_slow(unative_t callid, ipc_data_t *data)
+sysarg_t sys_ipc_answer_slow(sysarg_t callid, ipc_data_t *data)
 {
 	/* Do not answer notification callids */
@@ -982,5 +984,5 @@
  *
  */
-unative_t sys_ipc_hangup(unative_t phoneid)
+sysarg_t sys_ipc_hangup(sysarg_t phoneid)
 {
 	phone_t *phone;
@@ -1008,5 +1010,5 @@
  *
  */
-unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,
+sysarg_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,
     unsigned int flags)
 {
@@ -1037,5 +1039,5 @@
 		ipc_call_free(call);
 		
-		return ((unative_t) call) | IPC_CALLID_NOTIFICATION;
+		return ((sysarg_t) call) | IPC_CALLID_NOTIFICATION;
 	}
 	
@@ -1046,11 +1048,4 @@
 			ipc_call_free(call);
 			goto restart;
-		} else {
-			/*
-			 * Decrement the counter of active calls only if the
-			 * call is not an answer to IPC_M_PHONE_HUNGUP,
-			 * which doesn't contribute to the counter.
-			 */
-			atomic_dec(&TASK->active_calls);
 		}
 		
@@ -1058,5 +1053,5 @@
 		ipc_call_free(call);
 		
-		return ((unative_t) call) | IPC_CALLID_ANSWERED;
+		return ((sysarg_t) call) | IPC_CALLID_ANSWERED;
 	}
 	
@@ -1086,5 +1081,5 @@
 	}
 	
-	return (unative_t) call;
+	return (sysarg_t) call;
 }
 
@@ -1092,5 +1087,5 @@
  *
  */
-unative_t sys_ipc_poke(void)
+sysarg_t sys_ipc_poke(void)
 {
 	waitq_unsleep(&TASK->answerbox.wq);
@@ -1100,13 +1095,13 @@
 /** Connect an IRQ handler to a task.
  *
- * @param inr    IRQ number.
- * @param devno  Device number.
- * @param method Method to be associated with the notification.
- * @param ucode  Uspace pointer to the top-half pseudocode.
+ * @param inr     IRQ number.
+ * @param devno   Device number.
+ * @param imethod Interface and method to be associated with the notification.
+ * @param ucode   Uspace pointer to the top-half pseudocode.
  *
  * @return EPERM or a return code returned by ipc_irq_register().
  *
  */
-unative_t sys_ipc_register_irq(inr_t inr, devno_t devno, unative_t method,
+sysarg_t sys_ipc_register_irq(inr_t inr, devno_t devno, sysarg_t imethod,
     irq_code_t *ucode)
 {
@@ -1114,5 +1109,5 @@
 		return EPERM;
 	
-	return ipc_irq_register(&TASK->answerbox, inr, devno, method, ucode);
+	return ipc_irq_register(&TASK->answerbox, inr, devno, imethod, ucode);
 }
 
@@ -1125,5 +1120,5 @@
  *
  */
-unative_t sys_ipc_unregister_irq(inr_t inr, devno_t devno)
+sysarg_t sys_ipc_unregister_irq(inr_t inr, devno_t devno)
 {
 	if (!(cap_get(TASK) & CAP_IRQ_REG))
@@ -1135,27 +1130,45 @@
 }
 
-#include <console/console.h>
-
-/** Syscall connect to a task by id.
+#ifdef __32_BITS__
+
+/** Syscall connect to a task by ID (32 bits)
  *
  * @return Phone id on success, or negative error code.
  *
  */
-unative_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid_arg)
+sysarg_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid)
 {
 #ifdef CONFIG_UDEBUG
-	sysarg64_t taskid_arg;
-	int rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
+	sysarg64_t taskid;
+	int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));
 	if (rc != 0)
-		return (unative_t) rc;
-	
-	LOG("sys_ipc_connect_kbox(%" PRIu64 ")", taskid_arg.value);
-	
-	return ipc_connect_kbox(taskid_arg.value);
+		return (sysarg_t) rc;
+	
+	return ipc_connect_kbox((task_id_t) taskid);
 #else
-	return (unative_t) ENOTSUP;
+	return (sysarg_t) ENOTSUP;
 #endif
 }
 
+#endif  /* __32_BITS__ */
+
+#ifdef __64_BITS__
+
+/** Syscall connect to a task by ID (64 bits)
+ *
+ * @return Phone id on success, or negative error code.
+ *
+ */
+sysarg_t sys_ipc_connect_kbox(sysarg_t taskid)
+{
+#ifdef CONFIG_UDEBUG
+	return ipc_connect_kbox((task_id_t) taskid);
+#else
+	return (sysarg_t) ENOTSUP;
+#endif
+}
+
+#endif  /* __64_BITS__ */
+
 /** @}
  */
Index: kernel/generic/src/lib/memstr.c
===================================================================
--- kernel/generic/src/lib/memstr.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/lib/memstr.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -62,15 +62,15 @@
 	unsigned int i, j;
 	
-	if (ALIGN_UP((uintptr_t) src, sizeof(unative_t)) != (uintptr_t) src ||
-	    ALIGN_UP((uintptr_t) dst, sizeof(unative_t)) != (uintptr_t) dst) {
+	if (ALIGN_UP((uintptr_t) src, sizeof(sysarg_t)) != (uintptr_t) src ||
+	    ALIGN_UP((uintptr_t) dst, sizeof(sysarg_t)) != (uintptr_t) dst) {
 		for (i = 0; i < cnt; i++)
 			((uint8_t *) dst)[i] = ((uint8_t *) src)[i];
 	} else { 
-		for (i = 0; i < cnt / sizeof(unative_t); i++)
-			((unative_t *) dst)[i] = ((unative_t *) src)[i];
+		for (i = 0; i < cnt / sizeof(sysarg_t); i++)
+			((sysarg_t *) dst)[i] = ((sysarg_t *) src)[i];
 		
-		for (j = 0; j < cnt % sizeof(unative_t); j++)
-			((uint8_t *)(((unative_t *) dst) + i))[j] =
-			    ((uint8_t *)(((unative_t *) src) + i))[j];
+		for (j = 0; j < cnt % sizeof(sysarg_t); j++)
+			((uint8_t *)(((sysarg_t *) dst) + i))[j] =
+			    ((uint8_t *)(((sysarg_t *) src) + i))[j];
 	}
 		
Index: kernel/generic/src/lib/rd.c
===================================================================
--- kernel/generic/src/lib/rd.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/lib/rd.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -96,5 +96,5 @@
 	sysinfo_set_item_val("rd.size", NULL, dsize);
 	sysinfo_set_item_val("rd.address.physical", NULL,
-	    (unative_t)	KA2PA((void *) header + hsize));
+	    (sysarg_t) KA2PA((void *) header + hsize));
 
 	return RE_OK;
Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/mm/as.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -2000,29 +2000,29 @@
 
 /** Wrapper for as_area_create(). */
-unative_t sys_as_area_create(uintptr_t address, size_t size, unsigned int flags)
+sysarg_t sys_as_area_create(uintptr_t address, size_t size, unsigned int flags)
 {
 	if (as_area_create(AS, flags | AS_AREA_CACHEABLE, size, address,
 	    AS_AREA_ATTR_NONE, &anon_backend, NULL))
-		return (unative_t) address;
+		return (sysarg_t) address;
 	else
-		return (unative_t) -1;
+		return (sysarg_t) -1;
 }
 
 /** Wrapper for as_area_resize(). */
-unative_t sys_as_area_resize(uintptr_t address, size_t size, unsigned int flags)
-{
-	return (unative_t) as_area_resize(AS, address, size, 0);
+sysarg_t sys_as_area_resize(uintptr_t address, size_t size, unsigned int flags)
+{
+	return (sysarg_t) as_area_resize(AS, address, size, 0);
 }
 
 /** Wrapper for as_area_change_flags(). */
-unative_t sys_as_area_change_flags(uintptr_t address, unsigned int flags)
-{
-	return (unative_t) as_area_change_flags(AS, flags, address);
+sysarg_t sys_as_area_change_flags(uintptr_t address, unsigned int flags)
+{
+	return (sysarg_t) as_area_change_flags(AS, flags, address);
 }
 
 /** Wrapper for as_area_destroy(). */
-unative_t sys_as_area_destroy(uintptr_t address)
-{
-	return (unative_t) as_area_destroy(AS, address);
+sysarg_t sys_as_area_destroy(uintptr_t address)
+{
+	return (sysarg_t) as_area_destroy(AS, address);
 }
 
Index: kernel/generic/src/mm/slab.c
===================================================================
--- kernel/generic/src/mm/slab.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/mm/slab.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -612,6 +612,6 @@
 	cache->name = name;
 	
-	if (align < sizeof(unative_t))
-		align = sizeof(unative_t);
+	if (align < sizeof(sysarg_t))
+		align = sizeof(sysarg_t);
 	
 	size = ALIGN_UP(size, align);
Index: kernel/generic/src/proc/program.c
===================================================================
--- kernel/generic/src/proc/program.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/proc/program.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -210,5 +210,5 @@
  *
  */
-unative_t sys_program_spawn_loader(char *uspace_name, size_t name_len)
+sysarg_t sys_program_spawn_loader(char *uspace_name, size_t name_len)
 {
 	/* Cap length of name and copy it from userspace. */
@@ -219,5 +219,5 @@
 	int rc = copy_from_uspace(namebuf, uspace_name, name_len);
 	if (rc != 0)
-		return (unative_t) rc;
+		return (sysarg_t) rc;
 	
 	namebuf[name_len] = 0;
Index: kernel/generic/src/proc/task.c
===================================================================
--- kernel/generic/src/proc/task.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/proc/task.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -151,5 +151,4 @@
 	atomic_set(&task->refcount, 0);
 	atomic_set(&task->lifecount, 0);
-	atomic_set(&task->active_calls, 0);
 	
 	irq_spinlock_initialize(&task->lock, "task_t_lock");
@@ -291,13 +290,15 @@
 }
 
-/** Syscall for reading task ID from userspace.
- *
- * @param uspace_task_id Userspace address of 8-byte buffer
- *                       where to store current task ID.
+#ifdef __32_BITS__
+
+/** Syscall for reading task ID from userspace (32 bits)
+ *
+ * @param uspace_taskid Pointer to user-space buffer
+ *                      where to store current task ID.
  *
  * @return Zero on success or an error code from @ref errno.h.
  *
  */
-unative_t sys_task_get_id(task_id_t *uspace_task_id)
+sysarg_t sys_task_get_id(sysarg64_t *uspace_taskid)
 {
 	/*
@@ -305,7 +306,27 @@
 	 * the lifespan of the task.
 	 */
-	return (unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid,
+	return (sysarg_t) copy_to_uspace(uspace_taskid, &TASK->taskid,
 	    sizeof(TASK->taskid));
 }
+
+#endif  /* __32_BITS__ */
+
+#ifdef __64_BITS__
+
+/** Syscall for reading task ID from userspace (64 bits)
+ *
+ * @return Current task ID.
+ *
+ */
+sysarg_t sys_task_get_id(void)
+{
+	/*
+	 * No need to acquire lock on TASK because taskid remains constant for
+	 * the lifespan of the task.
+	 */
+	return TASK->taskid;
+}
+
+#endif  /* __64_BITS__ */
 
 /** Syscall for setting the task name.
@@ -319,5 +340,5 @@
  *
  */
-unative_t sys_task_set_name(const char *uspace_name, size_t name_len)
+sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len)
 {
 	int rc;
@@ -331,5 +352,5 @@
 	rc = copy_from_uspace(namebuf, uspace_name, name_len);
 	if (rc != 0)
-		return (unative_t) rc;
+		return (sysarg_t) rc;
 	
 	namebuf[name_len] = '\0';
@@ -478,6 +499,6 @@
 #ifdef __32_BITS__
 	if (*additional)
-		printf("%-8" PRIu64 " %9" PRIua " %7" PRIua, task->taskid,
-		    atomic_get(&task->refcount), atomic_get(&task->active_calls));
+		printf("%-8" PRIu64 " %9" PRIua, task->taskid,
+		    atomic_get(&task->refcount));
 	else
 		printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %10p %10p"
@@ -490,7 +511,6 @@
 	if (*additional)
 		printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c "
-		    "%9" PRIua " %7" PRIua,
-		    task->taskid, ucycles, usuffix, kcycles, ksuffix,
-		    atomic_get(&task->refcount), atomic_get(&task->active_calls));
+		    "%9" PRIua, task->taskid, ucycles, usuffix, kcycles,
+		    ksuffix, atomic_get(&task->refcount));
 	else
 		printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %18p %18p\n",
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/proc/thread.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -755,5 +755,5 @@
  *
  */
-unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
+sysarg_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
     size_t name_len, thread_id_t *uspace_thread_id)
 {
@@ -764,5 +764,5 @@
 	int rc = copy_from_uspace(namebuf, uspace_name, name_len);
 	if (rc != 0)
-		return (unative_t) rc;
+		return (sysarg_t) rc;
 	
 	namebuf[name_len] = 0;
@@ -779,5 +779,5 @@
 	if (rc != 0) {
 		free(kernel_uarg);
-		return (unative_t) rc;
+		return (sysarg_t) rc;
 	}
 	
@@ -804,5 +804,5 @@
 				free(kernel_uarg);
 				
-				return (unative_t) rc;
+				return (sysarg_t) rc;
 			 }
 		}
@@ -827,5 +827,5 @@
 		free(kernel_uarg);
 	
-	return (unative_t) ENOMEM;
+	return (sysarg_t) ENOMEM;
 }
 
@@ -833,5 +833,5 @@
  *
  */
-unative_t sys_thread_exit(int uspace_status)
+sysarg_t sys_thread_exit(int uspace_status)
 {
 	thread_exit();
@@ -849,5 +849,5 @@
  *
  */
-unative_t sys_thread_get_id(thread_id_t *uspace_thread_id)
+sysarg_t sys_thread_get_id(thread_id_t *uspace_thread_id)
 {
 	/*
@@ -856,10 +856,10 @@
 	 *
 	 */
-	return (unative_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
+	return (sysarg_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
 	    sizeof(THREAD->tid));
 }
 
 /** Syscall wrapper for sleeping. */
-unative_t sys_thread_usleep(uint32_t usec)
+sysarg_t sys_thread_usleep(uint32_t usec)
 {
 	thread_usleep(usec);
Index: kernel/generic/src/security/cap.c
===================================================================
--- kernel/generic/src/security/cap.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/security/cap.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -41,5 +41,4 @@
 #include <proc/task.h>
 #include <synch/spinlock.h>
-#include <syscall/sysarg64.h>
 #include <syscall/copy.h>
 #include <arch.h>
@@ -79,26 +78,21 @@
  * The calling task must have the CAP_CAP capability.
  *
- * @param uspace_taskid_arg Userspace structure holding destination task ID.
- * @param caps Capabilities to grant.
- *
- * @return Zero on success or an error code from @ref errno.h.
- *
- */
-unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps)
+ * @param taskid Destination task ID.
+ * @param caps   Capabilities to grant.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+static sysarg_t cap_grant(task_id_t taskid, cap_t caps)
 {
 	if (!(cap_get(TASK) & CAP_CAP))
-		return (unative_t) EPERM;
-	
-	sysarg64_t taskid_arg;
-	int rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
-	if (rc != 0)
-		return (unative_t) rc;
+		return (sysarg_t) EPERM;
 	
 	irq_spinlock_lock(&tasks_lock, true);
-	task_t *task = task_find_by_id((task_id_t) taskid_arg.value);
+	task_t *task = task_find_by_id(taskid);
 	
 	if ((!task) || (!context_check(CONTEXT, task->context))) {
 		irq_spinlock_unlock(&tasks_lock, true);
-		return (unative_t) ENOENT;
+		return (sysarg_t) ENOENT;
 	}
 	
@@ -116,23 +110,18 @@
  * attempt to revoke capabilities from itself.
  *
- * @param uspace_taskid_arg Userspace structure holding destination task ID.
- * @param caps Capabilities to revoke.
- *
- * @return Zero on success or an error code from @ref errno.h.
- *
- */
-unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps)
-{
-	sysarg64_t taskid_arg;
-	int rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
-	if (rc != 0)
-		return (unative_t) rc;
-	
+ * @param taskid Destination task ID.
+ * @param caps   Capabilities to revoke.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+static sysarg_t cap_revoke(task_id_t taskid, cap_t caps)
+{
 	irq_spinlock_lock(&tasks_lock, true);
 	
-	task_t *task = task_find_by_id((task_id_t) taskid_arg.value);
+	task_t *task = task_find_by_id(taskid);
 	if ((!task) || (!context_check(CONTEXT, task->context))) {
 		irq_spinlock_unlock(&tasks_lock, true);
-		return (unative_t) ENOENT;
+		return (sysarg_t) ENOENT;
 	}
 	
@@ -147,5 +136,5 @@
 		irq_spinlock_unlock(&TASK->lock, false);
 		irq_spinlock_unlock(&tasks_lock, true);
-		return (unative_t) EPERM;
+		return (sysarg_t) EPERM;
 	}
 	
@@ -157,4 +146,84 @@
 }
 
+#ifdef __32_BITS__
+
+/** Grant capabilities to a task (32 bits)
+ *
+ * The calling task must have the CAP_CAP capability.
+ *
+ * @param uspace_taskid User-space pointer to destination task ID.
+ * @param caps          Capabilities to grant.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+sysarg_t sys_cap_grant(sysarg64_t *uspace_taskid, cap_t caps)
+{
+	sysarg64_t taskid;
+	int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));
+	if (rc != 0)
+		return (sysarg_t) rc;
+	
+	return cap_grant((task_id_t) taskid, caps);
+}
+
+/** Revoke capabilities from a task (32 bits)
+ *
+ * The calling task must have the CAP_CAP capability or the caller must
+ * attempt to revoke capabilities from itself.
+ *
+ * @param uspace_taskid User-space pointer to destination task ID.
+ * @param caps          Capabilities to revoke.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+sysarg_t sys_cap_revoke(sysarg64_t *uspace_taskid, cap_t caps)
+{
+	sysarg64_t taskid;
+	int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));
+	if (rc != 0)
+		return (sysarg_t) rc;
+	
+	return cap_revoke((task_id_t) taskid, caps);
+}
+
+#endif  /* __32_BITS__ */
+
+#ifdef __64_BITS__
+
+/** Grant capabilities to a task (64 bits)
+ *
+ * The calling task must have the CAP_CAP capability.
+ *
+ * @param taskid Destination task ID.
+ * @param caps   Capabilities to grant.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+sysarg_t sys_cap_grant(sysarg_t taskid, cap_t caps)
+{
+	return cap_grant((task_id_t) taskid, caps);
+}
+
+/** Revoke capabilities from a task (64 bits)
+ *
+ * The calling task must have the CAP_CAP capability or the caller must
+ * attempt to revoke capabilities from itself.
+ *
+ * @param taskid Destination task ID.
+ * @param caps   Capabilities to revoke.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+sysarg_t sys_cap_revoke(sysarg_t taskid, cap_t caps)
+{
+	return cap_revoke((task_id_t) taskid, caps);
+}
+
+#endif  /* __64_BITS__ */
+
 /** @}
  */
Index: kernel/generic/src/synch/futex.c
===================================================================
--- kernel/generic/src/synch/futex.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/synch/futex.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -60,6 +60,6 @@
 
 static futex_t *futex_find(uintptr_t paddr);
-static size_t futex_ht_hash(unative_t *key);
-static bool futex_ht_compare(unative_t *key, size_t keys, link_t *item);
+static size_t futex_ht_hash(sysarg_t *key);
+static bool futex_ht_compare(sysarg_t *key, size_t keys, link_t *item);
 static void futex_ht_remove_callback(link_t *item);
 
@@ -108,5 +108,5 @@
  *			synch.h.
  */
-unative_t sys_futex_sleep(uintptr_t uaddr)
+sysarg_t sys_futex_sleep(uintptr_t uaddr)
 {
 	futex_t *futex;
@@ -122,5 +122,5 @@
 	if (!t || !PTE_VALID(t) || !PTE_PRESENT(t)) {
 		page_table_unlock(AS, true);
-		return (unative_t) ENOENT;
+		return (sysarg_t) ENOENT;
 	}
 	paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE));
@@ -136,5 +136,5 @@
 	udebug_stoppable_end();
 #endif
-	return (unative_t) rc;
+	return (sysarg_t) rc;
 }
 
@@ -145,5 +145,5 @@
  * @return		ENOENT if there is no physical mapping for uaddr.
  */
-unative_t sys_futex_wakeup(uintptr_t uaddr)
+sysarg_t sys_futex_wakeup(uintptr_t uaddr)
 {
 	futex_t *futex;
@@ -158,5 +158,5 @@
 	if (!t || !PTE_VALID(t) || !PTE_PRESENT(t)) {
 		page_table_unlock(AS, true);
-		return (unative_t) ENOENT;
+		return (sysarg_t) ENOENT;
 	}
 	paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE));
@@ -235,5 +235,5 @@
  * @return		Index into futex hash table.
  */
-size_t futex_ht_hash(unative_t *key)
+size_t futex_ht_hash(sysarg_t *key)
 {
 	return (*key & (FUTEX_HT_SIZE - 1));
@@ -247,5 +247,5 @@
  * @return		True if the item matches the key. False otherwise.
  */
-bool futex_ht_compare(unative_t *key, size_t keys, link_t *item)
+bool futex_ht_compare(sysarg_t *key, size_t keys, link_t *item)
 {
 	futex_t *futex;
Index: kernel/generic/src/synch/smc.c
===================================================================
--- kernel/generic/src/synch/smc.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/synch/smc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -42,5 +42,5 @@
 #include <synch/smc.h>
 
-unative_t sys_smc_coherence(uintptr_t va, size_t size)
+sysarg_t sys_smc_coherence(uintptr_t va, size_t size)
 {
 	if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
Index: kernel/generic/src/syscall/syscall.c
===================================================================
--- kernel/generic/src/syscall/syscall.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/syscall/syscall.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -56,6 +56,6 @@
 
 /** Dispatch system call */
-unative_t syscall_handler(unative_t a1, unative_t a2, unative_t a3,
-    unative_t a4, unative_t a5, unative_t a6, unative_t id)
+sysarg_t syscall_handler(sysarg_t a1, sysarg_t a2, sysarg_t a3,
+    sysarg_t a4, sysarg_t a5, sysarg_t a6, sysarg_t id)
 {
 	/* Do userpace accounting */
@@ -74,5 +74,5 @@
 #endif
 	
-	unative_t rc;
+	sysarg_t rc;
 	if (id < SYSCALL_END) {
 		rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
@@ -147,4 +147,5 @@
 	(syshandler_t) sys_ipc_register_irq,
 	(syshandler_t) sys_ipc_unregister_irq,
+	(syshandler_t) sys_ipc_connect_kbox,
 	
 	/* Event notification syscalls. */
@@ -169,7 +170,5 @@
 	/* Debug calls */
 	(syshandler_t) sys_debug_enable_console,
-	(syshandler_t) sys_debug_disable_console,
-	
-	(syshandler_t) sys_ipc_connect_kbox
+	(syshandler_t) sys_debug_disable_console
 };
 
Index: kernel/generic/src/sysinfo/stats.c
===================================================================
--- kernel/generic/src/sysinfo/stats.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/sysinfo/stats.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -87,5 +87,5 @@
  *
  */
-static unative_t get_stats_uptime(struct sysinfo_item *item)
+static sysarg_t get_stats_uptime(struct sysinfo_item *item)
 {
 	/* This doesn't have to be very accurate */
Index: kernel/generic/src/sysinfo/sysinfo.c
===================================================================
--- kernel/generic/src/sysinfo/sysinfo.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/sysinfo/sysinfo.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -296,5 +296,5 @@
  */
 void sysinfo_set_item_val(const char *name, sysinfo_item_t **root,
-    unative_t val)
+    sysarg_t val)
 {
 	/* Protect sysinfo tree consistency */
@@ -481,5 +481,5 @@
 		sysinfo_indent(depth);
 		
-		unative_t val;
+		sysarg_t val;
 		size_t size;
 		
@@ -660,5 +660,5 @@
  *
  */
-unative_t sys_sysinfo_get_tag(void *path_ptr, size_t path_size)
+sysarg_t sys_sysinfo_get_tag(void *path_ptr, size_t path_size)
 {
 	/*
@@ -679,5 +679,5 @@
 		ret.tag = SYSINFO_VAL_DATA;
 	
-	return (unative_t) ret.tag;
+	return (sysarg_t) ret.tag;
 }
 
@@ -696,5 +696,5 @@
  *
  */
-unative_t sys_sysinfo_get_value(void *path_ptr, size_t path_size,
+sysarg_t sys_sysinfo_get_value(void *path_ptr, size_t path_size,
     void *value_ptr)
 {
@@ -715,5 +715,5 @@
 		rc = EINVAL;
 	
-	return (unative_t) rc;
+	return (sysarg_t) rc;
 }
 
@@ -732,5 +732,5 @@
  *
  */
-unative_t sys_sysinfo_get_data_size(void *path_ptr, size_t path_size,
+sysarg_t sys_sysinfo_get_data_size(void *path_ptr, size_t path_size,
     void *size_ptr)
 {
@@ -752,5 +752,5 @@
 		rc = EINVAL;
 	
-	return (unative_t) rc;
+	return (sysarg_t) rc;
 }
 
@@ -774,5 +774,5 @@
  *
  */
-unative_t sys_sysinfo_get_data(void *path_ptr, size_t path_size,
+sysarg_t sys_sysinfo_get_data(void *path_ptr, size_t path_size,
     void *buffer_ptr, size_t buffer_size)
 {
@@ -797,5 +797,5 @@
 		free(ret.data.data);
 	
-	return (unative_t) rc;
+	return (sysarg_t) rc;
 }
 
Index: kernel/generic/src/time/clock.c
===================================================================
--- kernel/generic/src/time/clock.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/time/clock.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -70,5 +70,5 @@
  *
  */
-static unative_t secfrag = 0;
+static sysarg_t secfrag = 0;
 
 /** Initialize realtime clock counter
@@ -100,6 +100,6 @@
 	 *
 	 */
-	sysinfo_set_item_val("clock.cacheable", NULL, (unative_t) true);
-	sysinfo_set_item_val("clock.faddr", NULL, (unative_t) faddr);
+	sysinfo_set_item_val("clock.cacheable", NULL, (sysarg_t) true);
+	sysinfo_set_item_val("clock.faddr", NULL, (sysarg_t) faddr);
 }
 
Index: kernel/generic/src/udebug/udebug.c
===================================================================
--- kernel/generic/src/udebug/udebug.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/udebug/udebug.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -219,6 +219,6 @@
  *
  */
-void udebug_syscall_event(unative_t a1, unative_t a2, unative_t a3,
-    unative_t a4, unative_t a5, unative_t a6, unative_t id, unative_t rc,
+void udebug_syscall_event(sysarg_t a1, sysarg_t a2, sysarg_t a3,
+    sysarg_t a4, sysarg_t a5, sysarg_t a6, sysarg_t id, sysarg_t rc,
     bool end_variant)
 {
@@ -314,5 +314,5 @@
 	IPC_SET_RETVAL(call->data, 0);
 	IPC_SET_ARG1(call->data, UDEBUG_EVENT_THREAD_B);
-	IPC_SET_ARG2(call->data, (unative_t) thread);
+	IPC_SET_ARG2(call->data, (sysarg_t) thread);
 	
 	/*
Index: kernel/generic/src/udebug/udebug_ipc.c
===================================================================
--- kernel/generic/src/udebug/udebug_ipc.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/udebug/udebug_ipc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -210,6 +210,6 @@
 static void udebug_receive_name_read(call_t *call)
 {
-	unative_t uspace_addr;
-	unative_t to_copy;
+	sysarg_t uspace_addr;
+	sysarg_t to_copy;
 	size_t data_size;
 	size_t buf_size;
@@ -257,6 +257,6 @@
 static void udebug_receive_areas_read(call_t *call)
 {
-	unative_t uspace_addr;
-	unative_t to_copy;
+	sysarg_t uspace_addr;
+	sysarg_t to_copy;
 	size_t data_size;
 	size_t buf_size;
@@ -304,5 +304,5 @@
 {
 	thread_t *t;
-	unative_t uspace_addr;
+	sysarg_t uspace_addr;
 	int rc;
 	void *buffer;
@@ -328,5 +328,5 @@
 	   (no way to distinguish method in answer) */
 	IPC_SET_ARG1(call->data, uspace_addr);
-	IPC_SET_ARG2(call->data, 6 * sizeof(unative_t));
+	IPC_SET_ARG2(call->data, 6 * sizeof(sysarg_t));
 	call->buffer = buffer;
 
@@ -341,6 +341,6 @@
 {
 	thread_t *t;
-	unative_t uspace_addr;
-	unative_t to_copy;
+	sysarg_t uspace_addr;
+	sysarg_t to_copy;
 	void *buffer;
 	int rc;
@@ -382,6 +382,6 @@
 static void udebug_receive_mem_read(call_t *call)
 {
-	unative_t uspace_dst;
-	unative_t uspace_src;
+	sysarg_t uspace_dst;
+	sysarg_t uspace_src;
 	unsigned size;
 	void *buffer;
Index: kernel/generic/src/udebug/udebug_ops.c
===================================================================
--- kernel/generic/src/udebug/udebug_ops.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/generic/src/udebug/udebug_ops.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -371,5 +371,5 @@
 	
 	/* Allocate a buffer to hold thread IDs */
-	unative_t *id_buffer = malloc(buf_size + 1, 0);
+	sysarg_t *id_buffer = malloc(buf_size + 1, 0);
 	
 	mutex_lock(&TASK->udebug.lock);
@@ -385,5 +385,5 @@
 	/* Copy down the thread IDs */
 	
-	size_t max_ids = buf_size / sizeof(unative_t);
+	size_t max_ids = buf_size / sizeof(sysarg_t);
 	size_t copied_ids = 0;
 	size_t extra_ids = 0;
@@ -404,5 +404,5 @@
 		if (copied_ids < max_ids) {
 			/* Using thread struct pointer as identification hash */
-			id_buffer[copied_ids++] = (unative_t) thread;
+			id_buffer[copied_ids++] = (sysarg_t) thread;
 		} else
 			extra_ids++;
@@ -414,6 +414,6 @@
 	
 	*buffer = id_buffer;
-	*stored = copied_ids * sizeof(unative_t);
-	*needed = (copied_ids + extra_ids) * sizeof(unative_t);
+	*stored = copied_ids * sizeof(sysarg_t);
+	*needed = (copied_ids + extra_ids) * sizeof(sysarg_t);
 	
 	return 0;
@@ -463,5 +463,5 @@
 {
 	/* Prepare a buffer to hold the arguments. */
-	unative_t *arg_buffer = malloc(6 * sizeof(unative_t), 0);
+	sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
 	
 	/* On success, this will lock t->udebug.lock. */
@@ -478,5 +478,5 @@
 	
 	/* Copy to a local buffer before releasing the lock. */
-	memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(unative_t));
+	memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t));
 	
 	_thread_op_end(thread);
@@ -539,5 +539,5 @@
  *
  */
-int udebug_mem_read(unative_t uspace_addr, size_t n, void **buffer)
+int udebug_mem_read(sysarg_t uspace_addr, size_t n, void **buffer)
 {
 	/* Verify task state */
Index: kernel/test/fpu/fpu1_ia64.c
===================================================================
--- kernel/test/fpu/fpu1_ia64.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/test/fpu/fpu1_ia64.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -85,5 +85,5 @@
 		
 		if ((int) (100000000 * e) != E_10e8) {
-			TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
+			TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (sysarg_t) (100000000 * e), (sysarg_t) E_10e8);
 			atomic_inc(&threads_fault);
 			break;
@@ -118,5 +118,5 @@
 		
 		if ((int) (1000000 * pi) != PI_10e8) {
-			TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
+			TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (sysarg_t) (1000000 * pi), (sysarg_t) (PI_10e8 / 100));
 			atomic_inc(&threads_fault);
 			break;
Index: kernel/test/fpu/fpu1_x86.c
===================================================================
--- kernel/test/fpu/fpu1_x86.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/test/fpu/fpu1_x86.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -83,5 +83,5 @@
 		if ((int) (100000000 * e) != E_10e8) {
 			TPRINTF("tid%" PRIu64 ": e*10e8=%" PRIun " should be %" PRIun "\n",
-			    THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
+			    THREAD->tid, (sysarg_t) (100000000 * e), (sysarg_t) E_10e8);
 			atomic_inc(&threads_fault);
 			break;
@@ -117,5 +117,5 @@
 		if ((int) (100000000 * pi) != PI_10e8) {
 			TPRINTF("tid%" PRIu64 ": pi*10e8=%" PRIun " should be %" PRIun "\n",
-			    THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
+			    THREAD->tid, (sysarg_t) (100000000 * pi), (sysarg_t) PI_10e8);
 			atomic_inc(&threads_fault);
 			break;
Index: kernel/test/fpu/mips2.c
===================================================================
--- kernel/test/fpu/mips2.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/test/fpu/mips2.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -48,5 +48,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int) ((unative_t) data);
+	int arg __attribute__((aligned(16))) = (int) ((sysarg_t) data);
 	int after_arg __attribute__((aligned(16)));
 	
@@ -80,5 +80,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int) ((unative_t) data);
+	int arg __attribute__((aligned(16))) = (int) ((sysarg_t) data);
 	int after_arg __attribute__((aligned(16)));
 	
@@ -123,5 +123,5 @@
 		thread_t *t;
 		
-		if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) {
+		if (!(t = thread_create(testit1, (void *) ((sysarg_t) 2 * i), TASK, 0, "testit1", false))) {
 			TPRINTF("could not create thread %u\n", 2 * i);
 			break;
@@ -130,5 +130,5 @@
 		total++;
 		
-		if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) {
+		if (!(t = thread_create(testit2, (void *) ((sysarg_t) 2 * i + 1), TASK, 0, "testit2", false))) {
 			TPRINTF("could not create thread %u\n", 2 * i + 1);
 			break;
Index: kernel/test/fpu/sse1.c
===================================================================
--- kernel/test/fpu/sse1.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/test/fpu/sse1.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -48,5 +48,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int) ((unative_t) data);
+	int arg __attribute__((aligned(16))) = (int) ((sysarg_t) data);
 	int after_arg __attribute__((aligned(16)));
 	
@@ -79,5 +79,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int) ((unative_t) data);
+	int arg __attribute__((aligned(16))) = (int) ((sysarg_t) data);
 	int after_arg __attribute__((aligned(16)));
 	
@@ -121,5 +121,5 @@
 		thread_t *t;
 		
-		if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) {
+		if (!(t = thread_create(testit1, (void *) ((sysarg_t) 2 * i), TASK, 0, "testit1", false))) {
 			TPRINTF("could not create thread %u\n", 2 * i);
 			break;
@@ -128,5 +128,5 @@
 		total++;
 		
-		if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) {
+		if (!(t = thread_create(testit2, (void *) ((sysarg_t) 2 * i + 1), TASK, 0, "testit2", false))) {
 			TPRINTF("could not create thread %u\n", 2 * i + 1);
 			break;
Index: kernel/test/mm/slab1.c
===================================================================
--- kernel/test/mm/slab1.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/test/mm/slab1.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -123,5 +123,5 @@
 static void slabtest(void *data)
 {
-	int offs = (int) (unative_t) data;
+	int offs = (int) (sysarg_t) data;
 	int i, j;
 	
@@ -156,5 +156,5 @@
 	semaphore_initialize(&thr_sem, 0);
 	for (i = 0; i < THREADS; i++) {  
-		if (!(t = thread_create(slabtest, (void *) (unative_t) i, TASK, 0, "slabtest", false))) {
+		if (!(t = thread_create(slabtest, (void *) (sysarg_t) i, TASK, 0, "slabtest", false))) {
 			TPRINTF("Could not create thread %d\n", i);
 		} else
Index: kernel/test/print/print2.c
===================================================================
--- kernel/test/print/print2.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ kernel/test/print/print2.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -48,5 +48,5 @@
 	TPRINTF("Real output:     [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21);
 	
-	unative_t nat = UINTN_C(0x12345678);
+	sysarg_t nat = UINTN_C(0x12345678);
 	
 	TPRINTF("Testing printf(\"%%#" PRIx64 " %%#" PRIx32 " %%#" PRIx16 " %%#" PRIx8 " %%#" PRIxn " %%#" PRIx64 " %%s\", (uint64_t) UINT64_C(0x1234567887654321), (uint32_t) UINT32_C(0x12345678), (uint16_t) UINT16_C(0x1234), (uint8_t) UINT8_C(0x12), nat, (uint64_t) UINT64_C(0x1234567887654321), \"Lovely string\"):\n");
Index: tools/check.sh
===================================================================
--- tools/check.sh	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ tools/check.sh	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,89 @@
+#! /bin/bash
+
+#
+# Copyright (c) 2010 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.
+#
+
+if [ $1" " == "-h " ];
+then
+	echo "Perform pre-integration hands-off build of all profiles."
+	echo
+	echo "Syntax:"
+	echo " $0 [-h] [args...]"
+	echo
+	echo " -h        Print this help."
+	echo " args...   All other args are passed to make (e.g. -j 6)"
+	echo
+
+	exit
+fi
+
+FAILED=""
+PASSED=""
+PROFILES=""
+DIRS=`find defaults/ -name Makefile.config | sed 's/^defaults\/\(.*\)\/Makefile.config/\1/' | sort`
+
+for D in $DIRS;
+do
+	for H in $DIRS;
+	do
+		if [ `echo $H | grep "^$D\/.*"`x != "x"  ];
+		then
+			continue 2 
+		fi
+	done
+	PROFILES="$PROFILES $D"
+done
+
+echo ">>> Going to build the following profiles:"
+echo $PROFILES
+
+for P in $PROFILES;
+do
+	echo -n ">>>> Building $P... "
+	( make distclean && make PROFILE=$P HANDS_OFF=y $1 ) >>/dev/null 2>>/dev/null
+	if [ $? -ne 0 ];
+	then
+		FAILED="$FAILED $P"
+		echo "failed."
+	else
+		PASSED="$PASSED $P"
+		echo "ok."
+	fi
+done
+
+echo ">>> Done."
+echo
+
+echo ">>> The following profiles passed:"
+echo $PASSED
+echo
+
+echo ">>> The following profiles failed:"
+echo $FAILED
+echo
+
Index: tools/config.py
===================================================================
--- tools/config.py	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ tools/config.py	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -3,4 +3,5 @@
 # Copyright (c) 2006 Ondrej Palkovsky
 # Copyright (c) 2009 Martin Decky
+# Copyright (c) 2010 Jiri Svoboda
 # All rights reserved.
 #
@@ -40,11 +41,11 @@
 import xtui
 
-INPUT = sys.argv[1]
+RULES_FILE = sys.argv[1]
 MAKEFILE = 'Makefile.config'
 MACROS = 'config.h'
-PRECONF = 'defaults'
-
-def read_defaults(fname, defaults):
-	"Read saved values from last configuration run"
+PRESETS_DIR = 'defaults'
+
+def read_config(fname, config):
+	"Read saved values from last configuration run or a preset file"
 	
 	inf = open(fname, 'r')
@@ -52,18 +53,18 @@
 	for line in inf:
 		res = re.match(r'^(?:#!# )?([^#]\w*)\s*=\s*(.*?)\s*$', line)
-		if (res):
-			defaults[res.group(1)] = res.group(2)
+		if res:
+			config[res.group(1)] = res.group(2)
 	
 	inf.close()
 
-def check_condition(text, defaults, ask_names):
+def check_condition(text, config, rules):
 	"Check that the condition specified on input line is True (only CNF and DNF is supported)"
 	
 	ctype = 'cnf'
 	
-	if ((')|' in text) or ('|(' in text)):
+	if (')|' in text) or ('|(' in text):
 		ctype = 'dnf'
 	
-	if (ctype == 'cnf'):
+	if ctype == 'cnf':
 		conds = text.split('&')
 	else:
@@ -71,23 +72,23 @@
 	
 	for cond in conds:
-		if (cond.startswith('(')) and (cond.endswith(')')):
+		if cond.startswith('(') and cond.endswith(')'):
 			cond = cond[1:-1]
 		
-		inside = check_inside(cond, defaults, ctype)
+		inside = check_inside(cond, config, ctype)
 		
 		if (ctype == 'cnf') and (not inside):
 			return False
 		
-		if (ctype == 'dnf') and (inside):
+		if (ctype == 'dnf') and inside:
 			return True
 	
-	if (ctype == 'cnf'):
+	if ctype == 'cnf':
 		return True
 	return False
 
-def check_inside(text, defaults, ctype):
+def check_inside(text, config, ctype):
 	"Check for condition"
 	
-	if (ctype == 'cnf'):
+	if ctype == 'cnf':
 		conds = text.split('|')
 	else:
@@ -96,5 +97,5 @@
 	for cond in conds:
 		res = re.match(r'^(.*?)(!?=)(.*)$', cond)
-		if (not res):
+		if not res:
 			raise RuntimeError("Invalid condition: %s" % cond)
 		
@@ -103,12 +104,12 @@
 		condval = res.group(3)
 		
-		if (not condname in defaults):
+		if not condname in config:
 			varval = ''
 		else:
-			varval = defaults[condname]
+			varval = config[condname]
 			if (varval == '*'):
 				varval = 'y'
 		
-		if (ctype == 'cnf'):
+		if ctype == 'cnf':
 			if (oper == '=') and (condval == varval):
 				return True
@@ -123,11 +124,11 @@
 				return False
 	
-	if (ctype == 'cnf'):
+	if ctype == 'cnf':
 		return False
 	
 	return True
 
-def parse_config(fname, ask_names):
-	"Parse configuration file"
+def parse_rules(fname, rules):
+	"Parse rules file"
 	
 	inf = open(fname, 'r')
@@ -138,9 +139,9 @@
 	for line in inf:
 		
-		if (line.startswith('!')):
+		if line.startswith('!'):
 			# Ask a question
 			res = re.search(r'!\s*(?:\[(.*?)\])?\s*([^\s]+)\s*\((.*)\)\s*$', line)
 			
-			if (not res):
+			if not res:
 				raise RuntimeError("Weird line: %s" % line)
 			
@@ -149,10 +150,10 @@
 			vartype = res.group(3)
 			
-			ask_names.append((varname, vartype, name, choices, cond))
+			rules.append((varname, vartype, name, choices, cond))
 			name = ''
 			choices = []
 			continue
 		
-		if (line.startswith('@')):
+		if line.startswith('@'):
 			# Add new line into the 'choices' array
 			res = re.match(r'@\s*(?:\[(.*?)\])?\s*"(.*?)"\s*(.*)$', line)
@@ -164,10 +165,10 @@
 			continue
 		
-		if (line.startswith('%')):
+		if line.startswith('%'):
 			# Name of the option
 			name = line[1:].strip()
 			continue
 		
-		if ((line.startswith('#')) or (line == '\n')):
+		if line.startswith('#') or (line == '\n'):
 			# Comment or empty line
 			continue
@@ -181,5 +182,5 @@
 	"Return '*' if yes, ' ' if no"
 	
-	if (default == 'y'):
+	if default == 'y':
 		return '*'
 	
@@ -199,5 +200,5 @@
 	cnt = 0
 	for key, val in choices:
-		if ((default) and (key == default)):
+		if (default) and (key == default):
 			position = cnt
 		
@@ -207,22 +208,141 @@
 	(button, value) = xtui.choice_window(screen, name, 'Choose value', options, position)
 	
-	if (button == 'cancel'):
+	if button == 'cancel':
 		return None
 	
 	return choices[value][0]
 
-def check_choices(defaults, ask_names):
-	"Check whether all accessible variables have a default"
-	
-	for varname, vartype, name, choices, cond in ask_names:
-		if ((cond) and (not check_condition(cond, defaults, ask_names))):
+## Infer and verify configuration values.
+#
+# Augment @a config with values that can be inferred, purge invalid ones
+# and verify that all variables have a value (previously specified or inferred).
+#
+# @param config Configuration to work on
+# @param rules  Rules
+#
+# @return True if configuration is complete and valid, False
+#         otherwise.
+#
+def infer_verify_choices(config, rules):
+	"Infer and verify configuration values."
+	
+	for rule in rules:
+		varname, vartype, name, choices, cond = rule
+		
+		if cond and (not check_condition(cond, config, rules)):
 			continue
 		
-		if (not varname in defaults):
+		if not varname in config:
+			value = None
+		else:
+			value = config[varname]
+		
+		if not validate_rule_value(rule, value):
+			value = None
+		
+		default = get_default_rule(rule)
+
+		#
+		# If we don't have a value but we do have
+		# a default, use it.
+		#
+		if value == None and default != None:
+			value = default
+			config[varname] = default
+		
+		if not varname in config:
 			return False
 	
 	return True
 
-def create_output(mkname, mcname, defaults, ask_names):
+## Get default value from a rule.
+def get_default_rule(rule):
+	varname, vartype, name, choices, cond = rule
+	
+	default = None
+	
+	if vartype == 'choice':
+		# If there is just one option, use it
+		if len(choices) == 1:
+			default = choices[0][0]
+	elif vartype == 'y':
+		default = '*'
+	elif vartype == 'n':
+		default = 'n'
+	elif vartype == 'y/n':
+		default = 'y'
+	elif vartype == 'n/y':
+		default = 'n'
+	else:
+		raise RuntimeError("Unknown variable type: %s" % vartype)
+	
+	return default
+
+## Get option from a rule.
+#
+# @param rule  Rule for a variable
+# @param value Current value of the variable
+#
+# @return Option (string) to ask or None which means not to ask.
+#
+def get_rule_option(rule, value):
+	varname, vartype, name, choices, cond = rule
+	
+	option = None
+	
+	if vartype == 'choice':
+		# If there is just one option, don't ask
+		if len(choices) != 1:
+			if (value == None):
+				option = "?     %s --> " % name
+			else:
+				option = "      %s [%s] --> " % (name, value)
+	elif vartype == 'y':
+		pass
+	elif vartype == 'n':
+		pass
+	elif vartype == 'y/n':
+		option = "  <%s> %s " % (yes_no(value), name)
+	elif vartype == 'n/y':
+		option ="  <%s> %s " % (yes_no(value), name)
+	else:
+		raise RuntimeError("Unknown variable type: %s" % vartype)
+	
+	return option
+
+## Check if variable value is valid.
+#
+# @param rule  Rule for the variable
+# @param value Value of the variable
+#
+# @return True if valid, False if not valid.
+#
+def validate_rule_value(rule, value):
+	varname, vartype, name, choices, cond = rule
+	
+	if value == None:
+		return True
+	
+	if vartype == 'choice':
+		if not value in [choice[0] for choice in choices]:
+			return False
+	elif vartype == 'y':
+		if value != 'y':
+			return False
+	elif vartype == 'n':
+		if value != 'n':
+			return False
+	elif vartype == 'y/n':
+		if not value in ['y', 'n']:
+			return False
+	elif vartype == 'n/y':
+		if not value in ['y', 'n']:
+			return False
+	else:
+		raise RuntimeError("Unknown variable type: %s" % vartype)
+	
+	return True
+
+def create_output(mkname, mcname, config, rules):
 	"Create output configuration"
 	
@@ -238,7 +358,7 @@
 		sys.stderr.write("failed\n")
 	
-	if (len(version) == 3):
+	if len(version) == 3:
 		revision = version[1]
-		if (version[0] != 1):
+		if version[0] != 1:
 			revision += 'M'
 		revision += ' (%s)' % version[2]
@@ -259,26 +379,26 @@
 	defs = 'CONFIG_DEFS ='
 	
-	for varname, vartype, name, choices, cond in ask_names:
-		if ((cond) and (not check_condition(cond, defaults, ask_names))):
+	for varname, vartype, name, choices, cond in rules:
+		if cond and (not check_condition(cond, config, rules)):
 			continue
 		
-		if (not varname in defaults):
-			default = ''
+		if not varname in config:
+			value = ''
 		else:
-			default = defaults[varname]
-			if (default == '*'):
-				default = 'y'
-		
-		outmk.write('# %s\n%s = %s\n\n' % (name, varname, default))
-		
-		if ((vartype == "y") or (vartype == "n") or (vartype == "y/n") or (vartype == "n/y")):
-			if (default == "y"):
+			value = config[varname]
+			if (value == '*'):
+				value = 'y'
+		
+		outmk.write('# %s\n%s = %s\n\n' % (name, varname, value))
+		
+		if vartype in ["y", "n", "y/n", "n/y"]:
+			if value == "y":
 				outmc.write('/* %s */\n#define %s\n\n' % (name, varname))
 				defs += ' -D%s' % varname
 		else:
-			outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, default, varname, default))
-			defs += ' -D%s=%s -D%s_%s' % (varname, default, varname, default)
-	
-	if (revision is not None):
+			outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, value, varname, value))
+			defs += ' -D%s=%s -D%s_%s' % (varname, value, varname, value)
+	
+	if revision is not None:
 		outmk.write('REVISION = %s\n' % revision)
 		outmc.write('#define REVISION %s\n' % revision)
@@ -299,5 +419,7 @@
 	return list
 
-def read_preconfigured(root, fname, screen, defaults):
+## Ask user to choose a configuration profile.
+#
+def choose_profile(root, fname, screen, config):
 	options = []
 	opt2path = {}
@@ -309,5 +431,5 @@
 		canon = os.path.join(path, fname)
 		
-		if ((os.path.isdir(path)) and (os.path.exists(canon)) and (os.path.isfile(canon))):
+		if os.path.isdir(path) and os.path.exists(canon) and os.path.isfile(canon):
 			subprofile = False
 			
@@ -317,44 +439,91 @@
 				subcanon = os.path.join(subpath, fname)
 				
-				if ((os.path.isdir(subpath)) and (os.path.exists(subcanon)) and (os.path.isfile(subcanon))):
+				if os.path.isdir(subpath) and os.path.exists(subcanon) and os.path.isfile(subcanon):
 					subprofile = True
 					options.append("%s (%s)" % (name, subname))
-					opt2path[cnt] = (canon, subcanon)
+					opt2path[cnt] = [name, subname]
 					cnt += 1
 			
-			if (not subprofile):
+			if not subprofile:
 				options.append(name)
-				opt2path[cnt] = (canon, None)
+				opt2path[cnt] = [name]
 				cnt += 1
 	
 	(button, value) = xtui.choice_window(screen, 'Load preconfigured defaults', 'Choose configuration profile', options, None)
 	
-	if (button == 'cancel'):
+	if button == 'cancel':
 		return None
 	
-	read_defaults(opt2path[value][0], defaults)
-	if (opt2path[value][1] != None):
-		read_defaults(opt2path[value][1], defaults)
+	return opt2path[value]
+
+## Read presets from a configuration profile.
+#
+# @param profile Profile to load from (a list of string components)
+# @param config  Output configuration
+#
+def read_presets(profile, config):
+	path = os.path.join(PRESETS_DIR, profile[0], MAKEFILE)
+	read_config(path, config)
+	
+	if len(profile) > 1:
+		path = os.path.join(PRESETS_DIR, profile[0], profile[1], MAKEFILE)
+		read_config(path, config)
+
+## Parse profile name (relative OS path) into a list of components.
+#
+# @param profile_name Relative path (using OS separator)
+# @return             List of components
+#
+def parse_profile_name(profile_name):
+	profile = []
+	
+	head, tail = os.path.split(profile_name)
+	if head != '':
+		profile.append(head)
+	
+	profile.append(tail)
+	return profile
 
 def main():
-	defaults = {}
-	ask_names = []
-	
-	# Parse configuration file
-	parse_config(INPUT, ask_names)
-	
-	# Read defaults from previous run
-	if os.path.exists(MAKEFILE):
-		read_defaults(MAKEFILE, defaults)
-	
-	# Default mode: only check defaults and regenerate configuration
-	if ((len(sys.argv) >= 3) and (sys.argv[2] == 'default')):
-		if (check_choices(defaults, ask_names)):
-			create_output(MAKEFILE, MACROS, defaults, ask_names)
+	profile = None
+	config = {}
+	rules = []
+	
+	# Parse rules file
+	parse_rules(RULES_FILE, rules)
+	
+	# Input configuration file can be specified on command line
+	# otherwise configuration from previous run is used.
+	if len(sys.argv) >= 4:
+		profile = parse_profile_name(sys.argv[3])
+		read_presets(profile, config)
+	elif os.path.exists(MAKEFILE):
+		read_config(MAKEFILE, config)
+	
+	# Default mode: check values and regenerate configuration files
+	if (len(sys.argv) >= 3) and (sys.argv[2] == 'default'):
+		if (infer_verify_choices(config, rules)):
+			create_output(MAKEFILE, MACROS, config, rules)
 			return 0
 	
-	# Check mode: only check defaults
-	if ((len(sys.argv) >= 3) and (sys.argv[2] == 'check')):
-		if (check_choices(defaults, ask_names)):
+	# Hands-off mode: check values and regenerate configuration files,
+	# but no interactive fallback
+	if (len(sys.argv) >= 3) and (sys.argv[2] == 'hands-off'):
+		# We deliberately test sys.argv >= 4 because we do not want
+		# to read implicitly any possible previous run configuration
+		if len(sys.argv) < 4:
+			sys.stderr.write("Configuration error: No presets specified\n")
+			return 2
+		
+		if (infer_verify_choices(config, rules)):
+			create_output(MAKEFILE, MACROS, config, rules)
+			return 0
+		
+		sys.stderr.write("Configuration error: The presets are ambiguous\n")
+		return 1
+	
+	# Check mode: only check configuration
+	if (len(sys.argv) >= 3) and (sys.argv[2] == 'check'):
+		if infer_verify_choices(config, rules):
 			return 0
 		return 1
@@ -366,8 +535,8 @@
 		while True:
 			
-			# Cancel out all defaults which have to be deduced
-			for varname, vartype, name, choices, cond in ask_names:
-				if ((vartype == 'y') and (varname in defaults) and (defaults[varname] == '*')):
-					defaults[varname] = None
+			# Cancel out all values which have to be deduced
+			for varname, vartype, name, choices, cond in rules:
+				if (vartype == 'y') and (varname in config) and (config[varname] == '*'):
+					config[varname] = None
 			
 			options = []
@@ -377,50 +546,36 @@
 			options.append("  --- Load preconfigured defaults ... ")
 			
-			for varname, vartype, name, choices, cond in ask_names:
-				
-				if ((cond) and (not check_condition(cond, defaults, ask_names))):
+			for rule in rules:
+				varname, vartype, name, choices, cond = rule
+				
+				if cond and (not check_condition(cond, config, rules)):
 					continue
 				
-				if (varname == selname):
+				if varname == selname:
 					position = cnt
 				
-				if (not varname in defaults):
-					default = None
+				if not varname in config:
+					value = None
 				else:
-					default = defaults[varname]
-				
-				if (vartype == 'choice'):
-					# Check if the default is an acceptable value
-					if ((default) and (not default in [choice[0] for choice in choices])):
-						default = None
-						defaults.pop(varname)
-					
-					# If there is just one option, use it
-					if (len(choices) == 1):
-						defaults[varname] = choices[0][0]
-						continue
-					
-					if (default == None):
-						options.append("?     %s --> " % name)
-					else:
-						options.append("      %s [%s] --> " % (name, default))
-				elif (vartype == 'y'):
-					defaults[varname] = '*'
+					value = config[varname]
+				
+				if not validate_rule_value(rule, value):
+					value = None
+				
+				default = get_default_rule(rule)
+
+				#
+				# If we don't have a value but we do have
+				# a default, use it.
+				#
+				if value == None and default != None:
+					value = default
+					config[varname] = default
+				
+				option = get_rule_option(rule, value)
+				if option != None:
+					options.append(option)
+				else:
 					continue
-				elif (vartype == 'n'):
-					defaults[varname] = 'n'
-					continue
-				elif (vartype == 'y/n'):
-					if (default == None):
-						default = 'y'
-						defaults[varname] = default
-					options.append("  <%s> %s " % (yes_no(default), name))
-				elif (vartype == 'n/y'):
-					if (default == None):
-						default = 'n'
-						defaults[varname] = default
-					options.append("  <%s> %s " % (yes_no(default), name))
-				else:
-					raise RuntimeError("Unknown variable type: %s" % vartype)
 				
 				opt2row[cnt] = (varname, vartype, name, choices)
@@ -433,9 +588,9 @@
 			(button, value) = xtui.choice_window(screen, 'HelenOS configuration', 'Choose configuration option', options, position)
 			
-			if (button == 'cancel'):
+			if button == 'cancel':
 				return 'Configuration canceled'
 			
-			if (button == 'done'):
-				if (check_choices(defaults, ask_names)):
+			if button == 'done':
+				if (infer_verify_choices(config, rules)):
 					break
 				else:
@@ -443,31 +598,33 @@
 					continue
 			
-			if (value == 0):
-				read_preconfigured(PRECONF, MAKEFILE, screen, defaults)
+			if value == 0:
+				profile = choose_profile(PRESETS_DIR, MAKEFILE, screen, config)
+				if profile != None:
+					read_presets(profile, config)
 				position = 1
 				continue
 			
 			position = None
-			if (not value in opt2row):
+			if not value in opt2row:
 				raise RuntimeError("Error selecting value: %s" % value)
 			
 			(selname, seltype, name, choices) = opt2row[value]
 			
-			if (not selname in defaults):
-					default = None
+			if not selname in config:
+				value = None
 			else:
-				default = defaults[selname]
-			
-			if (seltype == 'choice'):
-				defaults[selname] = subchoice(screen, name, choices, default)
-			elif ((seltype == 'y/n') or (seltype == 'n/y')):
-				if (defaults[selname] == 'y'):
-					defaults[selname] = 'n'
+				value = config[selname]
+			
+			if seltype == 'choice':
+				config[selname] = subchoice(screen, name, choices, value)
+			elif (seltype == 'y/n') or (seltype == 'n/y'):
+				if config[selname] == 'y':
+					config[selname] = 'n'
 				else:
-					defaults[selname] = 'y'
+					config[selname] = 'y'
 	finally:
 		xtui.screen_done(screen)
 	
-	create_output(MAKEFILE, MACROS, defaults, ask_names)
+	create_output(MAKEFILE, MACROS, config, rules)
 	return 0
 
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -85,5 +85,8 @@
 	srv/net/tl/tcp \
 	srv/net/net \
-	drv/root
+	drv/root \
+	drv/rootvirt \
+	drv/test1 \
+	drv/test2
 
 ## Networking
@@ -108,8 +111,12 @@
 
 ifeq ($(UARCH),amd64)
+	DIRS += drv/rootpc
+	DIRS += drv/pciintel
+	DIRS += drv/isa
+	DIRS += drv/ns8250
 endif
 
 ifeq ($(UARCH),ia32)
-	DIRS += drv/rootia32
+	DIRS += drv/rootpc
 	DIRS += drv/pciintel
 	DIRS += drv/isa
Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/edit/edit.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -100,6 +100,6 @@
 static bool cursor_visible;
 
-static ipcarg_t scr_rows;
-static ipcarg_t scr_columns;
+static sysarg_t scr_rows;
+static sysarg_t scr_columns;
 
 #define ROW_BUF_SIZE 4096
@@ -684,5 +684,5 @@
 	
 	int i;
-	ipcarg_t j;
+	sysarg_t j;
 	for (i = rows; i < pane.rows; ++i) {
 		console_set_pos(con, 0, i);
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/init/init.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -57,6 +57,6 @@
 #define DEVFS_MOUNT_POINT  "/dev"
 
-#define SCRATCH_FS_TYPE      "tmpfs"
-#define SCRATCH_MOUNT_POINT  "/scratch"
+#define TMPFS_FS_TYPE      "tmpfs"
+#define TMPFS_MOUNT_POINT  "/tmp"
 
 #define DATA_FS_TYPE      "fat"
@@ -235,9 +235,9 @@
 }
 
-static bool mount_scratch(void)
-{
-	int rc = mount(SCRATCH_FS_TYPE, SCRATCH_MOUNT_POINT, "", "", 0);
-	return mount_report("Scratch filesystem", SCRATCH_MOUNT_POINT,
-	    SCRATCH_FS_TYPE, NULL, rc);
+static bool mount_tmpfs(void)
+{
+	int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0);
+	return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT,
+	    TMPFS_FS_TYPE, NULL, rc);
 }
 
@@ -271,5 +271,5 @@
 	}
 	
-	mount_scratch();
+	mount_tmpfs();
 	
 	spawn("/srv/fhc");
Index: uspace/app/netecho/print_error.c
===================================================================
--- uspace/app/netecho/print_error.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/netecho/print_error.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -164,5 +164,5 @@
 	case EDESTADDRREQ:
 		fprintf(output, "Destination address required (%d) error", error_code);
-	case TRY_AGAIN:
+	case EAGAIN:
 		fprintf(output, "Try again (%d) error", error_code);
 	default:
Index: uspace/app/netstart/self_test.c
===================================================================
--- uspace/app/netstart/self_test.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/app/netstart/self_test.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,334 @@
+/*
+ * Copyright (c) 2009 Lukas Mejdrech
+ * 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.
+ */
+
+/** @addtogroup net
+ * @{
+ */
+
+/** @file
+ * Networking self-tests implementation.
+ *
+ */
+
+#include <errno.h>
+#include <malloc.h>
+#include <stdio.h>
+
+#include <net_checksum.h>
+#include <adt/int_map.h>
+#include <adt/char_map.h>
+#include <adt/generic_char_map.h>
+#include <adt/measured_strings.h>
+#include <adt/dynamic_fifo.h>
+
+#include "self_test.h"
+
+/** Test the statement, compare the result and evaluate.
+ *
+ * @param[in] statement The statement to test.
+ * @param[in] result    The expected result.
+ *
+ */
+#define TEST(statement, result) \
+	do { \
+		printf("\n\t%s == %s", #statement, #result); \
+		if ((statement) != (result)) { \
+			printf("\tfailed\n"); \
+			fprintf(stderr, "\nNetwork self-test failed\n"); \
+			return EINVAL; \
+		} else \
+			printf("\tOK"); \
+	} while (0)
+
+#define XMALLOC(var, type) \
+	do { \
+		(var) = (type *) malloc(sizeof(type)); \
+		if ((var) == NULL) { \
+			fprintf(stderr, "\nMemory allocation error\n"); \
+			return ENOMEM; \
+		} \
+	} while (0)
+
+GENERIC_CHAR_MAP_DECLARE(int_char_map, int);
+GENERIC_CHAR_MAP_IMPLEMENT(int_char_map, int);
+
+GENERIC_FIELD_DECLARE(int_field, int);
+GENERIC_FIELD_IMPLEMENT(int_field, int);
+
+INT_MAP_DECLARE(int_map, int);
+INT_MAP_IMPLEMENT(int_map, int);
+
+/** Self-test start function.
+ *
+ * Run all self-tests.
+ *
+ * @returns EOK on success.
+ * @returns The first error occurred.
+ *
+ */
+int self_test(void)
+{
+	printf("Running networking self-tests\n");
+	
+	printf("\nChar map test");
+	char_map_t cm;
+	
+	TEST(char_map_update(&cm, "ucho", 0, 3), EINVAL);
+	TEST(char_map_initialize(&cm), EOK);
+	TEST(char_map_exclude(&cm, "bla", 0), CHAR_MAP_NULL);
+	TEST(char_map_find(&cm, "bla", 0), CHAR_MAP_NULL);
+	TEST(char_map_add(&cm, "bla", 0, 1), EOK);
+	TEST(char_map_find(&cm, "bla", 0), 1);
+	TEST(char_map_add(&cm, "bla", 0, 10), EEXISTS);
+	TEST(char_map_update(&cm, "bla", 0, 2), EOK);
+	TEST(char_map_find(&cm, "bla", 0), 2);
+	TEST(char_map_update(&cm, "ucho", 0, 2), EOK);
+	TEST(char_map_exclude(&cm, "bla", 0), 2);
+	TEST(char_map_exclude(&cm, "bla", 0), CHAR_MAP_NULL);
+	TEST(char_map_find(&cm, "ucho", 0), 2);
+	TEST(char_map_update(&cm, "ucho", 0, 3), EOK);
+	TEST(char_map_find(&cm, "ucho", 0), 3);
+	TEST(char_map_add(&cm, "blabla", 0, 5), EOK);
+	TEST(char_map_find(&cm, "blabla", 0), 5);
+	TEST(char_map_add(&cm, "bla", 0, 6), EOK);
+	TEST(char_map_find(&cm, "bla", 0), 6);
+	TEST(char_map_exclude(&cm, "bla", 0), 6);
+	TEST(char_map_find(&cm, "bla", 0), CHAR_MAP_NULL);
+	TEST(char_map_find(&cm, "blabla", 0), 5);
+	TEST(char_map_add(&cm, "auto", 0, 7), EOK);
+	TEST(char_map_find(&cm, "auto", 0), 7);
+	TEST(char_map_add(&cm, "kara", 0, 8), EOK);
+	TEST(char_map_find(&cm, "kara", 0), 8);
+	TEST(char_map_add(&cm, "nic", 0, 9), EOK);
+	TEST(char_map_find(&cm, "nic", 0), 9);
+	TEST(char_map_find(&cm, "blabla", 0), 5);
+	TEST(char_map_add(&cm, "micnicnic", 5, 9), EOK);
+	TEST(char_map_find(&cm, "micni", 0), 9);
+	TEST(char_map_find(&cm, "micnicn", 5), 9);
+	TEST(char_map_add(&cm, "\x10\x0\x2\x2", 4, 15), EOK);
+	TEST(char_map_find(&cm, "\x10\x0\x2\x2", 4), 15);
+	
+	TEST((char_map_destroy(&cm), EOK), EOK);
+	TEST(char_map_update(&cm, "ucho", 0, 3), EINVAL);
+	
+	printf("\nCRC computation test");
+	uint32_t value;
+	
+	TEST(value = ~compute_crc32(~0, "123456789", 8 * 9), 0xcbf43926);
+	TEST(value = ~compute_crc32(~0, "1", 8), 0x83dcefb7);
+	TEST(value = ~compute_crc32(~0, "12", 8 * 2), 0x4f5344cd);
+	TEST(value = ~compute_crc32(~0, "123", 8 * 3), 0x884863d2);
+	TEST(value = ~compute_crc32(~0, "1234", 8 * 4), 0x9be3e0a3);
+	TEST(value = ~compute_crc32(~0, "12345678", 8 * 8), 0x9ae0daaf);
+	TEST(value = ~compute_crc32(~0, "ahoj pane", 8 * 9), 0x5fc3d706);
+	
+	printf("\nDynamic fifo test");
+	dyn_fifo_t fifo;
+	
+	TEST(dyn_fifo_push(&fifo, 1, 0), EINVAL);
+	TEST(dyn_fifo_initialize(&fifo, 1), EOK);
+	TEST(dyn_fifo_push(&fifo, 1, 0), EOK);
+	TEST(dyn_fifo_pop(&fifo), 1);
+	TEST(dyn_fifo_pop(&fifo), ENOENT);
+	TEST(dyn_fifo_push(&fifo, 2, 1), EOK);
+	TEST(dyn_fifo_push(&fifo, 3, 1), ENOMEM);
+	TEST(dyn_fifo_push(&fifo, 3, 0), EOK);
+	TEST(dyn_fifo_pop(&fifo), 2);
+	TEST(dyn_fifo_pop(&fifo), 3);
+	TEST(dyn_fifo_push(&fifo, 4, 2), EOK);
+	TEST(dyn_fifo_push(&fifo, 5, 2), EOK);
+	TEST(dyn_fifo_push(&fifo, 6, 2), ENOMEM);
+	TEST(dyn_fifo_push(&fifo, 6, 5), EOK);
+	TEST(dyn_fifo_push(&fifo, 7, 5), EOK);
+	TEST(dyn_fifo_pop(&fifo), 4);
+	TEST(dyn_fifo_pop(&fifo), 5);
+	TEST(dyn_fifo_push(&fifo, 8, 5), EOK);
+	TEST(dyn_fifo_push(&fifo, 9, 5), EOK);
+	TEST(dyn_fifo_push(&fifo, 10, 6), EOK);
+	TEST(dyn_fifo_push(&fifo, 11, 6), EOK);
+	TEST(dyn_fifo_pop(&fifo), 6);
+	TEST(dyn_fifo_pop(&fifo), 7);
+	TEST(dyn_fifo_push(&fifo, 12, 6), EOK);
+	TEST(dyn_fifo_push(&fifo, 13, 6), EOK);
+	TEST(dyn_fifo_push(&fifo, 14, 6), ENOMEM);
+	TEST(dyn_fifo_push(&fifo, 14, 8), EOK);
+	TEST(dyn_fifo_pop(&fifo), 8);
+	TEST(dyn_fifo_pop(&fifo), 9);
+	TEST(dyn_fifo_pop(&fifo), 10);
+	TEST(dyn_fifo_pop(&fifo), 11);
+	TEST(dyn_fifo_pop(&fifo), 12);
+	TEST(dyn_fifo_pop(&fifo), 13);
+	TEST(dyn_fifo_pop(&fifo), 14);
+	TEST(dyn_fifo_destroy(&fifo), EOK);
+	TEST(dyn_fifo_push(&fifo, 1, 0), EINVAL);
+	
+	printf("\nGeneric char map test");
+	
+	int *x;
+	int *y;
+	int *z;
+	int *u;
+	int *v;
+	int *w;
+	
+	XMALLOC(x, int);
+	XMALLOC(y, int);
+	XMALLOC(z, int);
+	XMALLOC(u, int);
+	XMALLOC(v, int);
+	XMALLOC(w, int);
+	
+	int_char_map_t icm;
+	icm.magic = 0;
+	
+	TEST(int_char_map_add(&icm, "ucho", 0, z), EINVAL);
+	TEST(int_char_map_initialize(&icm), EOK);
+	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
+	TEST(int_char_map_find(&icm, "bla", 0), NULL);
+	TEST(int_char_map_add(&icm, "bla", 0, x), EOK);
+	TEST(int_char_map_find(&icm, "bla", 0), x);
+	TEST(int_char_map_add(&icm, "bla", 0, y), EEXISTS);
+	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
+	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
+	TEST(int_char_map_add(&icm, "blabla", 0, v), EOK);
+	TEST(int_char_map_find(&icm, "blabla", 0), v);
+	TEST(int_char_map_add(&icm, "bla", 0, w), EOK);
+	TEST(int_char_map_find(&icm, "bla", 0), w);
+	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
+	TEST(int_char_map_find(&icm, "bla", 0), NULL);
+	TEST(int_char_map_find(&icm, "blabla", 0), v);
+	TEST(int_char_map_add(&icm, "auto", 0, u), EOK);
+	TEST(int_char_map_find(&icm, "auto", 0), u);
+	TEST((int_char_map_destroy(&icm), EOK), EOK);
+	TEST(int_char_map_add(&icm, "ucho", 0, z), EINVAL);
+	
+	printf("\nGeneric field test");
+	
+	XMALLOC(x, int);
+	XMALLOC(y, int);
+	XMALLOC(z, int);
+	XMALLOC(u, int);
+	XMALLOC(v, int);
+	XMALLOC(w, int);
+	
+	int_field_t gf;
+	gf.magic = 0;
+	
+	TEST(int_field_add(&gf, x), EINVAL);
+	TEST(int_field_count(&gf), -1);
+	TEST(int_field_initialize(&gf), EOK);
+	TEST(int_field_count(&gf), 0);
+	TEST(int_field_get_index(&gf, 1), NULL);
+	TEST(int_field_add(&gf, x), 0);
+	TEST(int_field_get_index(&gf, 0), x);
+	TEST((int_field_exclude_index(&gf, 0), EOK), EOK);
+	TEST(int_field_get_index(&gf, 0), NULL);
+	TEST(int_field_add(&gf, y), 1);
+	TEST(int_field_get_index(&gf, 1), y);
+	TEST(int_field_add(&gf, z), 2);
+	TEST(int_field_get_index(&gf, 2), z);
+	TEST(int_field_get_index(&gf, 1), y);
+	TEST(int_field_count(&gf), 3);
+	TEST(int_field_add(&gf, u), 3);
+	TEST(int_field_get_index(&gf, 3), u);
+	TEST(int_field_add(&gf, v), 4);
+	TEST(int_field_get_index(&gf, 4), v);
+	TEST(int_field_add(&gf, w), 5);
+	TEST(int_field_get_index(&gf, 5), w);
+	TEST(int_field_count(&gf), 6);
+	TEST((int_field_exclude_index(&gf, 1), EOK), EOK);
+	TEST(int_field_get_index(&gf, 1), NULL);
+	TEST(int_field_get_index(&gf, 3), u);
+	TEST((int_field_exclude_index(&gf, 7), EOK), EOK);
+	TEST(int_field_get_index(&gf, 3), u);
+	TEST(int_field_get_index(&gf, 5), w);
+	TEST((int_field_exclude_index(&gf, 4), EOK), EOK);
+	TEST(int_field_get_index(&gf, 4), NULL);
+	TEST((int_field_destroy(&gf), EOK), EOK);
+	TEST(int_field_count(&gf), -1);
+	
+	printf("\nInt map test");
+	
+	XMALLOC(x, int);
+	XMALLOC(y, int);
+	XMALLOC(z, int);
+	XMALLOC(u, int);
+	XMALLOC(v, int);
+	XMALLOC(w, int);
+	
+	int_map_t im;
+	im.magic = 0;
+	
+	TEST(int_map_add(&im, 1, x), EINVAL);
+	TEST(int_map_count(&im), -1);
+	TEST(int_map_initialize(&im), EOK);
+	TEST(int_map_count(&im), 0);
+	TEST(int_map_find(&im, 1), NULL);
+	TEST(int_map_add(&im, 1, x), 0);
+	TEST(int_map_find(&im, 1), x);
+	TEST((int_map_exclude(&im, 1), EOK), EOK);
+	TEST(int_map_find(&im, 1), NULL);
+	TEST(int_map_add(&im, 1, y), 1);
+	TEST(int_map_find(&im, 1), y);
+	TEST(int_map_add(&im, 4, z), 2);
+	TEST(int_map_get_index(&im, 2), z);
+	TEST(int_map_find(&im, 4), z);
+	TEST(int_map_find(&im, 1), y);
+	TEST(int_map_count(&im), 3);
+	TEST(int_map_add(&im, 2, u), 3);
+	TEST(int_map_find(&im, 2), u);
+	TEST(int_map_add(&im, 3, v), 4);
+	TEST(int_map_find(&im, 3), v);
+	TEST(int_map_get_index(&im, 4), v);
+	TEST(int_map_add(&im, 6, w), 5);
+	TEST(int_map_find(&im, 6), w);
+	TEST(int_map_count(&im), 6);
+	TEST((int_map_exclude(&im, 1), EOK), EOK);
+	TEST(int_map_find(&im, 1), NULL);
+	TEST(int_map_find(&im, 2), u);
+	TEST((int_map_exclude(&im, 7), EOK), EOK);
+	TEST(int_map_find(&im, 2), u);
+	TEST(int_map_find(&im, 6), w);
+	TEST((int_map_exclude_index(&im, 4), EOK), EOK);
+	TEST(int_map_get_index(&im, 4), NULL);
+	TEST(int_map_find(&im, 3), NULL);
+	TEST((int_map_destroy(&im), EOK), EOK);
+	TEST(int_map_count(&im), -1);
+	
+	printf("\nMeasured strings test");
+	
+	measured_string_ref string =
+	    measured_string_create_bulk("I am a measured string!", 0);
+	printf("\n%x, %s at %x of %d\n", string, string->value, string->value,
+	    string->length);
+	
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/app/netstart/self_test.h
===================================================================
--- uspace/app/netstart/self_test.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/app/netstart/self_test.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2009 Lukas Mejdrech
+ * 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.
+ */
+
+/** @addtogroup net
+ * @{
+ */
+
+#ifndef __SELF_TEST_H__
+#define __SELF_TEST_H__
+
+extern int self_test(void);
+
+#endif
+
+/** @}
+ */
Index: uspace/app/tester/Makefile
===================================================================
--- uspace/app/tester/Makefile	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/tester/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -47,8 +47,7 @@
 	vfs/vfs1.c \
 	ipc/ping_pong.c \
-	ipc/register.c \
-	ipc/connect.c \
 	loop/loop1.c \
 	mm/malloc1.c \
+	hw/misc/virtchar1.c \
 	hw/serial/serial1.c
 
Index: uspace/app/tester/hw/misc/virtchar1.c
===================================================================
--- uspace/app/tester/hw/misc/virtchar1.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/app/tester/hw/misc/virtchar1.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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.
+ */
+
+/** @addtogroup tester
+ * @brief Test the virtual char driver
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <inttypes.h>
+#include <errno.h>
+#include <str_error.h>
+#include <sys/types.h>
+#include <async.h>
+#include <device/char.h>
+#include <str.h>
+#include <vfs/vfs.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <device/char.h>
+#include "../../tester.h"
+
+#define DEVICE_PATH_NORMAL "/dev/devices/\\virt\\null"
+#define DEVICE_PATH_CLASSES "/dev/class/virt-null\\1"
+#define BUFFER_SIZE 64
+
+static const char *test_virtchar1_internal(const char *path)
+{
+	TPRINTF("Opening `%s'...\n", path);
+	int fd = open(path, O_RDONLY);
+	if (fd < 0) {
+		TPRINTF("   ...error: %s\n", str_error(fd));
+		if (fd == ENOENT) {
+			TPRINTF("   (error was ENOENT: " \
+			    "have you compiled test drivers?)\n");
+		}
+		return "Failed opening devman driver device for reading";
+	}
+	
+	TPRINTF("   ...file handle %d\n", fd);
+
+	TPRINTF(" Asking for phone...\n");
+	int phone = fd_phone(fd);
+	if (phone < 0) {
+		close(fd);
+		TPRINTF("   ...error: %s\n", str_error(phone));
+		return "Failed to get phone to device";
+	}
+	TPRINTF("   ...phone is %d\n", phone);
+	
+	TPRINTF(" Will try to read...\n");
+	size_t i;
+	char buffer[BUFFER_SIZE];
+	read_dev(phone, buffer, BUFFER_SIZE);
+	TPRINTF(" ...verifying that we read zeroes only...\n");
+	for (i = 0; i < BUFFER_SIZE; i++) {
+		if (buffer[i] != 0) {
+			return "Not all bytes are zeroes";
+		}
+	}
+	TPRINTF("   ...data read okay\n");
+	
+	/* Clean-up. */
+	TPRINTF(" Closing phones and file descriptors\n");
+	ipc_hangup(phone);
+	close(fd);
+	
+	return NULL;
+}
+
+const char *test_virtchar1(void)
+{;
+	const char *res;
+
+	res = test_virtchar1_internal(DEVICE_PATH_NORMAL);
+	if (res != NULL) {
+		return res;
+	}
+
+	res = test_virtchar1_internal(DEVICE_PATH_CLASSES);
+	if (res != NULL) {
+		return res;
+	}
+
+	return NULL;
+}
+
+/** @}
+ */
Index: uspace/app/tester/hw/misc/virtchar1.def
===================================================================
--- uspace/app/tester/hw/misc/virtchar1.def	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/app/tester/hw/misc/virtchar1.def	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,6 @@
+{
+	"virtchar1",
+	"Virtual char device test",
+	&test_virtchar1,
+	false
+},
Index: uspace/app/tester/hw/serial/serial1.c
===================================================================
--- uspace/app/tester/hw/serial/serial1.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/tester/hw/serial/serial1.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -93,8 +93,8 @@
 	}
 	
-	ipcarg_t old_baud;
-	ipcarg_t old_par;
-	ipcarg_t old_stop;
-	ipcarg_t old_word_size;
+	sysarg_t old_baud;
+	sysarg_t old_par;
+	sysarg_t old_stop;
+	sysarg_t old_word_size;
 	
 	res = ipc_call_sync_0_4(phone, SERIAL_GET_COM_PROPS, &old_baud,
Index: pace/app/tester/ipc/connect.c
===================================================================
--- uspace/app/tester/ipc/connect.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/*
- * Copyright (c) 2006 Ondrej Palkovsky
- * 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 <stdio.h>
-#include <unistd.h>
-#include <atomic.h>
-#include "../tester.h"
-
-static atomic_t finish;
-
-static void callback(void *priv, int retval, ipc_call_t *data)
-{
-	atomic_set(&finish, 1);
-}
-
-const char *test_connect(void)
-{
-	TPRINTF("Connecting to %u...", IPC_TEST_SERVICE);
-	int phone = ipc_connect_me_to(PHONE_NS, IPC_TEST_SERVICE, 0, 0);
-	if (phone > 0) {
-		TPRINTF("phoneid %d\n", phone);
-	} else {
-		TPRINTF("\n");
-		return "ipc_connect_me_to() failed";
-	}
-	
-	printf("Sending synchronous message...\n");
-	int retval = ipc_call_sync_0_0(phone, IPC_TEST_METHOD);
-	TPRINTF("Received response to synchronous message\n");
-	
-	TPRINTF("Sending asynchronous message...\n");
-	atomic_set(&finish, 0);
-	ipc_call_async_0(phone, IPC_TEST_METHOD, NULL, callback, 1);
-	while (atomic_get(&finish) != 1)
-		TPRINTF(".");
-	TPRINTF("Received response to asynchronous message\n");
-	
-	TPRINTF("Hanging up...");
-	retval = ipc_hangup(phone);
-	if (retval == 0) {
-		TPRINTF("OK\n");
-	} else {
-		TPRINTF("\n");
-		return "ipc_hangup() failed";
-	}
-	
-	return NULL;
-}
Index: pace/app/tester/ipc/connect.def
===================================================================
--- uspace/app/tester/ipc/connect.def	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,6 +1,0 @@
-{
-	"connect",
-	"IPC connection test (connect to other service)",
-	&test_connect,
-	true
-},
Index: pace/app/tester/ipc/register.c
===================================================================
--- uspace/app/tester/ipc/register.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/*
- * Copyright (c) 2006 Ondrej Palkovsky
- * 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 <inttypes.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <async.h>
-#include <errno.h>
-#include "../tester.h"
-
-#define MAX_CONNECTIONS  50
-
-static int connections[MAX_CONNECTIONS];
-
-static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
-{
-	unsigned int i;
-	
-	TPRINTF("Connected phone %" PRIun " accepting\n", icall->in_phone_hash);
-	ipc_answer_0(iid, EOK);
-	for (i = 0; i < MAX_CONNECTIONS; i++) {
-		if (!connections[i]) {
-			connections[i] = icall->in_phone_hash;
-			break;
-		}
-	}
-	
-	while (true) {
-		ipc_call_t call;
-		ipc_callid_t callid = async_get_call(&call);
-		int retval;
-		
-		switch (IPC_GET_METHOD(call)) {
-		case IPC_M_PHONE_HUNGUP:
-			TPRINTF("Phone %" PRIun " hung up\n", icall->in_phone_hash);
-			retval = 0;
-			break;
-		case IPC_TEST_METHOD:
-			TPRINTF("Received well known message from %" PRIun ": %" PRIun "\n",
-			    icall->in_phone_hash, callid);
-			ipc_answer_0(callid, EOK);
-			break;
-		default:
-			TPRINTF("Received unknown message from %" PRIun ": %" PRIun "\n",
-			    icall->in_phone_hash, callid);
-			ipc_answer_0(callid, ENOENT);
-			break;
-		}
-	}
-}
-
-const char *test_register(void)
-{
-	async_set_client_connection(client_connection);
-	
-	ipcarg_t phonead;
-	int res = ipc_connect_to_me(PHONE_NS, IPC_TEST_SERVICE, 0, 0, &phonead);
-	if (res != 0)
-		return "Failed registering IPC service";
-	
-	TPRINTF("Registered as service %u, accepting connections\n", IPC_TEST_SERVICE);
-	async_manager();
-	
-	return NULL;
-}
Index: pace/app/tester/ipc/register.def
===================================================================
--- uspace/app/tester/ipc/register.def	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,6 +1,0 @@
-{
-	"register",
-	"IPC registration test",
-	&test_register,
-	true
-},
Index: uspace/app/tester/tester.c
===================================================================
--- uspace/app/tester/tester.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/tester/tester.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -60,9 +60,8 @@
 #include "vfs/vfs1.def"
 #include "ipc/ping_pong.def"
-#include "ipc/register.def"
-#include "ipc/connect.def"
 #include "loop/loop1.def"
 #include "mm/malloc1.def"
 #include "hw/serial/serial1.def"
+#include "hw/misc/virtchar1.def"
 	{NULL, NULL, NULL, false}
 };
Index: uspace/app/tester/tester.h
===================================================================
--- uspace/app/tester/tester.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/tester/tester.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -77,9 +77,8 @@
 extern const char *test_vfs1(void);
 extern const char *test_ping_pong(void);
-extern const char *test_register(void);
-extern const char *test_connect(void);
 extern const char *test_loop1(void);
 extern const char *test_malloc1(void);
 extern const char *test_serial1(void);
+extern const char *test_virtchar1(void);
 
 extern test_t tests[];
Index: uspace/app/tetris/input.c
===================================================================
--- uspace/app/tetris/input.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/tetris/input.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -97,5 +97,5 @@
 	struct timeval starttv, endtv, *s;
 	static ipc_call_t charcall;
-	ipcarg_t rc;
+	sysarg_t rc;
 	
 	/*
Index: uspace/app/tetris/screen.c
===================================================================
--- uspace/app/tetris/screen.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/tetris/screen.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -120,5 +120,5 @@
 }
 
-void moveto(ipcarg_t r, ipcarg_t c)
+void moveto(sysarg_t r, sysarg_t c)
 {
 	fflush(stdout);
@@ -135,5 +135,5 @@
 static bool get_display_color_sup(void)
 {
-	ipcarg_t ccap;
+	sysarg_t ccap;
 	int rc = console_get_color_cap(fphone(stdout), &ccap);
 	
Index: uspace/app/tetris/screen.h
===================================================================
--- uspace/app/tetris/screen.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/tetris/screen.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -53,11 +53,11 @@
 
 typedef struct {
-	ipcarg_t ws_row;
-	ipcarg_t ws_col;
+	sysarg_t ws_row;
+	sysarg_t ws_col;
 } winsize_t;
 
 extern winsize_t winsize;
 
-extern void moveto(ipcarg_t r, ipcarg_t c);
+extern void moveto(sysarg_t r, sysarg_t c);
 extern void clear_screen(void);
 
Index: uspace/app/top/input.c
===================================================================
--- uspace/app/top/input.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/top/input.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -99,5 +99,5 @@
 	struct timeval starttv, endtv, *s;
 	static ipc_call_t charcall;
-	ipcarg_t rc;
+	sysarg_t rc;
 	
 	/*
Index: uspace/app/top/screen.c
===================================================================
--- uspace/app/top/screen.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/top/screen.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -47,6 +47,6 @@
 #include "top.h"
 
-static ipcarg_t warn_col = 0;
-static ipcarg_t warn_row = 0;
+static sysarg_t warn_col = 0;
+static sysarg_t warn_row = 0;
 
 static void screen_style_normal(void)
@@ -62,5 +62,5 @@
 }
 
-static void screen_moveto(ipcarg_t col, ipcarg_t row)
+static void screen_moveto(sysarg_t col, sysarg_t row)
 {
 	fflush(stdout);
@@ -68,5 +68,5 @@
 }
 
-static void screen_get_pos(ipcarg_t *col, ipcarg_t *row)
+static void screen_get_pos(sysarg_t *col, sysarg_t *row)
 {
 	fflush(stdout);
@@ -74,5 +74,5 @@
 }
 
-static void screen_get_size(ipcarg_t *col, ipcarg_t *row)
+static void screen_get_size(sysarg_t *col, sysarg_t *row)
 {
 	fflush(stdout);
@@ -94,13 +94,13 @@
 static void screen_newline(void)
 {
-	ipcarg_t cols;
-	ipcarg_t rows;
+	sysarg_t cols;
+	sysarg_t rows;
 	screen_get_size(&cols, &rows);
 	
-	ipcarg_t c;
-	ipcarg_t r;
+	sysarg_t c;
+	sysarg_t r;
 	screen_get_pos(&c, &r);
 	
-	ipcarg_t i;
+	sysarg_t i;
 	for (i = c + 1; i < cols; i++)
 		puts(" ");
@@ -142,10 +142,10 @@
 static void print_string(const char *str)
 {
-	ipcarg_t cols;
-	ipcarg_t rows;
+	sysarg_t cols;
+	sysarg_t rows;
 	screen_get_size(&cols, &rows);
 	
-	ipcarg_t c;
-	ipcarg_t r;
+	sysarg_t c;
+	sysarg_t r;
 	screen_get_pos(&c, &r);
 	
@@ -282,10 +282,10 @@
 static inline void print_tasks(data_t *data)
 {
-	ipcarg_t cols;
-	ipcarg_t rows;
+	sysarg_t cols;
+	sysarg_t rows;
 	screen_get_size(&cols, &rows);
 	
-	ipcarg_t col;
-	ipcarg_t row;
+	sysarg_t col;
+	sysarg_t row;
 	screen_get_pos(&col, &row);
 	
@@ -329,10 +329,10 @@
 static inline void print_ipc(data_t *data)
 {
-	ipcarg_t cols;
-	ipcarg_t rows;
+	sysarg_t cols;
+	sysarg_t rows;
 	screen_get_size(&cols, &rows);
 	
-	ipcarg_t col;
-	ipcarg_t row;
+	sysarg_t col;
+	sysarg_t row;
 	screen_get_pos(&col, &row);
 	
@@ -396,10 +396,10 @@
 static inline void print_excs(data_t *data)
 {
-	ipcarg_t cols;
-	ipcarg_t rows;
+	sysarg_t cols;
+	sysarg_t rows;
 	screen_get_size(&cols, &rows);
 	
-	ipcarg_t col;
-	ipcarg_t row;
+	sysarg_t col;
+	sysarg_t row;
 	screen_get_pos(&col, &row);
 	
@@ -439,10 +439,10 @@
 static void print_help(void)
 {
-	ipcarg_t cols;
-	ipcarg_t rows;
+	sysarg_t cols;
+	sysarg_t rows;
 	screen_get_size(&cols, &rows);
 	
-	ipcarg_t col;
-	ipcarg_t row;
+	sysarg_t col;
+	sysarg_t row;
 	screen_get_pos(&col, &row);
 	
Index: uspace/app/trace/ipcp.c
===================================================================
--- uspace/app/trace/ipcp.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/trace/ipcp.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -46,5 +46,5 @@
 
 typedef struct {
-	ipcarg_t phone_hash;
+	sysarg_t phone_hash;
 	ipc_call_t question;
 	oper_t *oper;
@@ -124,5 +124,5 @@
 }
 
-static void ipc_m_print(proto_t *proto, ipcarg_t method)
+static void ipc_m_print(proto_t *proto, sysarg_t method)
 {
 	oper_t *oper;
@@ -192,5 +192,5 @@
 	unsigned long key[1];
 	oper_t *oper;
-	ipcarg_t *args;
+	sysarg_t *args;
 	int i;
 
@@ -204,5 +204,5 @@
 		    (void *) hash, phone,
 		    (proto ? proto->name : "n/a"));
-		ipc_m_print(proto, IPC_GET_METHOD(*call));
+		ipc_m_print(proto, IPC_GET_IMETHOD(*call));
 		printf(" args: (%" PRIun ", %" PRIun ", %" PRIun ", "
 		    "%" PRIun ", %" PRIun ")\n",
@@ -214,5 +214,5 @@
 
 		if (proto != NULL) {
-			oper = proto_get_oper(proto, IPC_GET_METHOD(*call));
+			oper = proto_get_oper(proto, IPC_GET_IMETHOD(*call));
 		} else {
 			oper = NULL;
@@ -262,12 +262,12 @@
     ipc_call_t *answer)
 {
-	ipcarg_t phone;
-	ipcarg_t method;
-	ipcarg_t service;
-	ipcarg_t retval;
+	sysarg_t phone;
+	sysarg_t method;
+	sysarg_t service;
+	sysarg_t retval;
 	proto_t *proto;
 	int cphone;
 
-	ipcarg_t *resp;
+	sysarg_t *resp;
 	oper_t *oper;
 	int i;
@@ -276,5 +276,5 @@
 
 	phone = pcall->phone_hash;
-	method = IPC_GET_METHOD(pcall->question);
+	method = IPC_GET_IMETHOD(pcall->question);
 	retval = IPC_GET_RETVAL(*answer);
 
Index: uspace/app/trace/proto.c
===================================================================
--- uspace/app/trace/proto.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/trace/proto.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -53,5 +53,5 @@
 
 typedef struct {
-	ipcarg_t method;
+	sysarg_t method;
 	oper_t *oper;
 	link_t link;
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/app/trace/trace.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -287,5 +287,5 @@
 {
 	ipc_call_t call;
-	ipcarg_t phoneid;
+	sysarg_t phoneid;
 	
 	if (sc_rc == (sysarg_t) IPC_CALLRET_FATAL ||
@@ -295,5 +295,5 @@
 	phoneid = sc_args[0];
 
-	IPC_SET_METHOD(call, sc_args[1]);
+	IPC_SET_IMETHOD(call, sc_args[1]);
 	IPC_SET_ARG1(call, sc_args[2]);
 	IPC_SET_ARG2(call, sc_args[3]);
@@ -331,5 +331,5 @@
 	phoneidx = sc_args[0];
 
-	IPC_SET_METHOD(question, sc_args[1]);
+	IPC_SET_IMETHOD(question, sc_args[1]);
 	IPC_SET_ARG1(question, sc_args[2]);
 	IPC_SET_ARG2(question, sc_args[3]);
Index: uspace/drv/isa/isa.c
===================================================================
--- uspace/drv/isa/isa.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/drv/isa/isa.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -282,5 +282,6 @@
 
 		printf(NAME ": added io range (addr=0x%x, size=0x%x) to "
-		    "device %s\n", addr, len, dev->name);
+		    "device %s\n", (unsigned int) addr, (unsigned int) len,
+		    dev->name);
 	}
 }
@@ -489,5 +490,6 @@
 static int isa_add_device(device_t *dev)
 {
-	printf(NAME ": isa_add_device, device handle = %d\n", dev->handle);
+	printf(NAME ": isa_add_device, device handle = %d\n",
+	    (int) dev->handle);
 
 	/* Add child devices. */
Index: uspace/drv/ns8250/ns8250.c
===================================================================
--- uspace/drv/ns8250/ns8250.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/drv/ns8250/ns8250.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -274,5 +274,5 @@
 	
 	/* Gain control over port's registers. */
-	if (pio_enable((void *) data->io_addr, REG_COUNT,
+	if (pio_enable((void *)(uintptr_t) data->io_addr, REG_COUNT,
 	    (void **) &data->port)) {
 		printf(NAME ": error - cannot gain the port %#" PRIx32 " for device "
@@ -342,13 +342,13 @@
 		printf(NAME ": failed to connect to the parent driver of the "
 		    "device %s.\n", dev->name);
-		ret = EPARTY;	/* FIXME: use another EC */
+		ret = dev->parent_phone;
 		goto failed;
 	}
 	
 	/* Get hw resources. */
-	if (!get_hw_resources(dev->parent_phone, &hw_resources)) {
+	ret = get_hw_resources(dev->parent_phone, &hw_resources);
+	if (ret != EOK) {
 		printf(NAME ": failed to get hw resources for the device "
 		    "%s.\n", dev->name);
-		ret = EPARTY;	/* FIXME: use another EC */
 		goto failed;
 	}
@@ -374,5 +374,5 @@
 				printf(NAME ": i/o range assigned to the device "
 				    "%s is too small.\n", dev->name);
-				ret = EPARTY;	/* FIXME: use another EC */
+				ret = ELIMIT;
 				goto failed;
 			}
@@ -390,5 +390,5 @@
 		printf(NAME ": missing hw resource(s) for the device %s.\n",
 		    dev->name);
-		ret = EPARTY;	/* FIXME: use another EC */
+		ret = ENOENT;
 		goto failed;
 	}
@@ -727,5 +727,5 @@
 {
 	printf(NAME ": ns8250_add_device %s (handle = %d)\n",
-	    dev->name, dev->handle);
+	    dev->name, (int) dev->handle);
 	
 	int res = ns8250_dev_initialize(dev);
@@ -887,5 +887,5 @@
     ipc_call_t *call)
 {
-	ipcarg_t method = IPC_GET_METHOD(*call);
+	sysarg_t method = IPC_GET_IMETHOD(*call);
 	int ret;
 	unsigned int baud_rate, parity, word_length, stop_bits;
Index: uspace/drv/pciintel/pci.c
===================================================================
--- uspace/drv/pciintel/pci.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/drv/pciintel/pci.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -324,5 +324,5 @@
 		printf(NAME ": device %s : ", dev->name);
 		printf("address = %" PRIx64, range_addr);
-		printf(", size = %x\n", range_size);
+		printf(", size = %x\n", (unsigned int) range_size);
 	}
 	
@@ -452,4 +452,6 @@
 static int pci_add_device(device_t *dev)
 {
+	int rc;
+
 	printf(NAME ": pci_add_device\n");
 	
@@ -466,15 +468,16 @@
 		    "parent's driver.\n");
 		delete_pci_bus_data(bus_data);
-		return EPARTY;	/* FIXME: use another EC */
+		return dev->parent_phone;
 	}
 	
 	hw_resource_list_t hw_resources;
 	
-	if (!get_hw_resources(dev->parent_phone, &hw_resources)) {
+	rc = get_hw_resources(dev->parent_phone, &hw_resources);
+	if (rc != EOK) {
 		printf(NAME ": pci_add_device failed to get hw resources for "
 		    "the device.\n");
 		delete_pci_bus_data(bus_data);
 		ipc_hangup(dev->parent_phone);
-		return EPARTY;	/* FIXME: use another EC */
+		return rc;
 	}	
 	
@@ -489,5 +492,5 @@
 	    (uint32_t) hw_resources.resources[0].res.io_range.address;
 	
-	if (pio_enable((void *)bus_data->conf_io_addr, 8,
+	if (pio_enable((void *)(uintptr_t)bus_data->conf_io_addr, 8,
 	    &bus_data->conf_addr_port)) {
 		printf(NAME ": failed to enable configuration ports.\n");
Index: uspace/drv/root/root.c
===================================================================
--- uspace/drv/root/root.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/drv/root/root.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2010 Lenka Trochtova
+ * Copyright (c) 2010 Vojtech Horky
  * All rights reserved.
  *
@@ -53,4 +54,12 @@
 #define NAME "root"
 
+#define PLATFORM_DEVICE_NAME "hw"
+#define PLATFORM_DEVICE_MATCH_ID STRING(UARCH)
+#define PLATFORM_DEVICE_MATCH_SCORE 100
+
+#define VIRTUAL_DEVICE_NAME "virt"
+#define VIRTUAL_DEVICE_MATCH_ID "rootvirt"
+#define VIRTUAL_DEVICE_MATCH_SCORE 100
+
 static int root_add_device(device_t *dev);
 
@@ -66,4 +75,21 @@
 };
 
+/** Create the device which represents the root of virtual device tree.
+ *
+ * @param parent Parent of the newly created device.
+ * @return Error code.
+ */
+static int add_virtual_root_child(device_t *parent)
+{
+	printf(NAME ": adding new child for virtual devices.\n");
+	printf(NAME ":   device node is `%s' (%d %s)\n", VIRTUAL_DEVICE_NAME,
+	    VIRTUAL_DEVICE_MATCH_SCORE, VIRTUAL_DEVICE_MATCH_ID);
+
+	int res = child_device_register_wrapper(parent, VIRTUAL_DEVICE_NAME,
+	    VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE);
+
+	return res;
+}
+
 /** Create the device which represents the root of HW device tree.
  *
@@ -74,47 +100,10 @@
 {
 	printf(NAME ": adding new child for platform device.\n");
+	printf(NAME ":   device node is `%s' (%d %s)\n", PLATFORM_DEVICE_NAME,
+	    PLATFORM_DEVICE_MATCH_SCORE, PLATFORM_DEVICE_MATCH_ID);
 	
-	int res = EOK;
-	device_t *platform = NULL;
-	match_id_t *match_id = NULL;
-	
-	/* Create new device. */
-	platform = create_device();
-	if (NULL == platform) {
-		res = ENOMEM;
-		goto failure;
-	}	
-	
-	platform->name = "hw";
-	printf(NAME ": the new device's name is %s.\n", platform->name);
-	
-	/* Initialize match id list. */
-	match_id = create_match_id();
-	if (NULL == match_id) {
-		res = ENOMEM;
-		goto failure;
-	}
-	
-	/* TODO - replace this with some better solution (sysinfo ?) */
-	match_id->id = STRING(UARCH);
-	match_id->score = 100;
-	add_match_id(&platform->match_ids, match_id);
-	
-	/* Register child device. */
-	res = child_device_register(platform, parent);
-	if (EOK != res)
-		goto failure;
-	
-	return res;
-	
-failure:
-	if (NULL != match_id)
-		match_id->id = NULL;
-	
-	if (NULL != platform) {
-		platform->name = NULL;
-		delete_device(platform);
-	}
-	
+	int res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME,
+	    PLATFORM_DEVICE_MATCH_ID, PLATFORM_DEVICE_MATCH_SCORE);
+
 	return res;
 }
@@ -130,4 +119,11 @@
 	    dev->handle);
 	
+	/*
+	 * Register virtual devices root.
+	 * We ignore error occurrence because virtual devices shall not be
+	 * vital for the system.
+	 */
+	add_virtual_root_child(dev);
+
 	/* Register root device's children. */
 	int res = add_platform_child(dev);
Index: pace/drv/rootia32/Makefile
===================================================================
--- uspace/drv/rootia32/Makefile	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#
-# Copyright (c) 2010 Lenka Trochtova
-# 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.
-#
-
-USPACE_PREFIX = ../..
-LIBS = $(LIBDRV_PREFIX)/libdrv.a
-EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include
-BINARY = rootia32
-
-SOURCES = \
-	rootia32.c
-
-include $(USPACE_PREFIX)/Makefile.common
Index: pace/drv/rootia32/rootia32.c
===================================================================
--- uspace/drv/rootia32/rootia32.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,204 +1,0 @@
-/*
- * Copyright (c) 2010 Lenka Trochtova
- * 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.
- */
-
-/**
- * @defgroup root_ia32 Root HW device driver for ia32 platform.
- * @brief HelenOS root HW device driver for ia32 platform.
- * @{
- */
-
-/** @file
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <errno.h>
-#include <bool.h>
-#include <fibril_synch.h>
-#include <stdlib.h>
-#include <str.h>
-#include <ctype.h>
-#include <macros.h>
-
-#include <driver.h>
-#include <devman.h>
-#include <ipc/devman.h>
-#include <ipc/dev_iface.h>
-#include <resource.h>
-#include <device/hw_res.h>
-
-#define NAME "rootia32"
-
-typedef struct rootia32_child_dev_data {
-	hw_resource_list_t hw_resources;
-} rootia32_child_dev_data_t;
-
-static int rootia32_add_device(device_t *dev);
-static void root_ia32_init(void);
-
-/** The root device driver's standard operations. */
-static driver_ops_t rootia32_ops = {
-	.add_device = &rootia32_add_device
-};
-
-/** The root device driver structure. */
-static driver_t rootia32_driver = {
-	.name = NAME,
-	.driver_ops = &rootia32_ops
-};
-
-static hw_resource_t pci_conf_regs = {
-	.type = IO_RANGE,
-	.res.io_range = {
-		.address = 0xCF8,
-		.size = 8,
-		.endianness = LITTLE_ENDIAN
-	}
-};
-
-static rootia32_child_dev_data_t pci_data = {
-	.hw_resources = {
-		1,
-		&pci_conf_regs
-	}
-};
-
-static hw_resource_list_t *rootia32_get_child_resources(device_t *dev)
-{
-	rootia32_child_dev_data_t *data;
-	
-	data = (rootia32_child_dev_data_t *) dev->driver_data;
-	if (NULL == data)
-		return NULL;
-	
-	return &data->hw_resources;
-}
-
-static bool rootia32_enable_child_interrupt(device_t *dev)
-{
-	/* TODO */
-	
-	return false;
-}
-
-static resource_iface_t child_res_iface = {
-	&rootia32_get_child_resources,
-	&rootia32_enable_child_interrupt
-};
-
-/* Initialized in root_ia32_init() function. */
-static device_ops_t rootia32_child_ops;
-
-static bool
-rootia32_add_child(device_t *parent, const char *name, const char *str_match_id,
-    rootia32_child_dev_data_t *drv_data)
-{
-	printf(NAME ": adding new child device '%s'.\n", name);
-	
-	device_t *child = NULL;
-	match_id_t *match_id = NULL;
-	
-	/* Create new device. */
-	child = create_device();
-	if (NULL == child)
-		goto failure;
-	
-	child->name = name;
-	child->driver_data = drv_data;
-	
-	/* Initialize match id list */
-	match_id = create_match_id();
-	if (NULL == match_id)
-		goto failure;
-	
-	match_id->id = str_match_id;
-	match_id->score = 100;
-	add_match_id(&child->match_ids, match_id);
-	
-	/* Set provided operations to the device. */
-	child->ops = &rootia32_child_ops;
-	
-	/* Register child device. */
-	if (EOK != child_device_register(child, parent))
-		goto failure;
-	
-	return true;
-	
-failure:
-	if (NULL != match_id)
-		match_id->id = NULL;
-	
-	if (NULL != child) {
-		child->name = NULL;
-		delete_device(child);
-	}
-	
-	printf(NAME ": failed to add child device '%s'.\n", name);
-	
-	return false;
-}
-
-static bool rootia32_add_children(device_t *dev)
-{
-	return rootia32_add_child(dev, "pci0", "intel_pci", &pci_data);
-}
-
-/** Get the root device.
- *
- * @param dev		The device which is root of the whole device tree (both
- *			of HW and pseudo devices).
- * @return		Zero on success, negative error number otherwise.
- */
-static int rootia32_add_device(device_t *dev)
-{
-	printf(NAME ": rootia32_add_device, device handle = %d\n", dev->handle);
-	
-	/* Register child devices. */
-	if (!rootia32_add_children(dev)) {
-		printf(NAME ": failed to add child devices for platform "
-		    "ia32.\n");
-	}
-	
-	return EOK;
-}
-
-static void root_ia32_init(void)
-{
-	rootia32_child_ops.interfaces[HW_RES_DEV_IFACE] = &child_res_iface;
-}
-
-int main(int argc, char *argv[])
-{
-	printf(NAME ": HelenOS rootia32 device driver\n");
-	root_ia32_init();
-	return driver_main(&rootia32_driver);
-}
-
-/**
- * @}
- */
Index: pace/drv/rootia32/rootia32.ma
===================================================================
--- uspace/drv/rootia32/rootia32.ma	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-10 ia32
Index: uspace/drv/rootpc/Makefile
===================================================================
--- uspace/drv/rootpc/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/rootpc/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2010 Lenka Trochtova
+# 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.
+#
+
+USPACE_PREFIX = ../..
+LIBS = $(LIBDRV_PREFIX)/libdrv.a
+EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include
+BINARY = rootpc
+
+SOURCES = \
+	rootpc.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/rootpc/rootpc.c
===================================================================
--- uspace/drv/rootpc/rootpc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/rootpc/rootpc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,205 @@
+/*
+ * Copyright (c) 2010 Lenka Trochtova
+ * 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.
+ */
+
+/**
+ * @defgroup root_pc Root HW device driver for ia32 and amd64 platform.
+ * @brief HelenOS root HW device driver for ia32 and amd64 platform.
+ * @{
+ */
+
+/** @file
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <errno.h>
+#include <bool.h>
+#include <fibril_synch.h>
+#include <stdlib.h>
+#include <str.h>
+#include <ctype.h>
+#include <macros.h>
+
+#include <driver.h>
+#include <devman.h>
+#include <ipc/devman.h>
+#include <ipc/dev_iface.h>
+#include <resource.h>
+#include <device/hw_res.h>
+
+#define NAME "rootpc"
+
+typedef struct rootpc_child_dev_data {
+	hw_resource_list_t hw_resources;
+} rootpc_child_dev_data_t;
+
+static int rootpc_add_device(device_t *dev);
+static void root_pc_init(void);
+
+/** The root device driver's standard operations. */
+static driver_ops_t rootpc_ops = {
+	.add_device = &rootpc_add_device
+};
+
+/** The root device driver structure. */
+static driver_t rootpc_driver = {
+	.name = NAME,
+	.driver_ops = &rootpc_ops
+};
+
+static hw_resource_t pci_conf_regs = {
+	.type = IO_RANGE,
+	.res.io_range = {
+		.address = 0xCF8,
+		.size = 8,
+		.endianness = LITTLE_ENDIAN
+	}
+};
+
+static rootpc_child_dev_data_t pci_data = {
+	.hw_resources = {
+		1,
+		&pci_conf_regs
+	}
+};
+
+static hw_resource_list_t *rootpc_get_child_resources(device_t *dev)
+{
+	rootpc_child_dev_data_t *data;
+	
+	data = (rootpc_child_dev_data_t *) dev->driver_data;
+	if (NULL == data)
+		return NULL;
+	
+	return &data->hw_resources;
+}
+
+static bool rootpc_enable_child_interrupt(device_t *dev)
+{
+	/* TODO */
+	
+	return false;
+}
+
+static resource_iface_t child_res_iface = {
+	&rootpc_get_child_resources,
+	&rootpc_enable_child_interrupt
+};
+
+/* Initialized in root_pc_init() function. */
+static device_ops_t rootpc_child_ops;
+
+static bool
+rootpc_add_child(device_t *parent, const char *name, const char *str_match_id,
+    rootpc_child_dev_data_t *drv_data)
+{
+	printf(NAME ": adding new child device '%s'.\n", name);
+	
+	device_t *child = NULL;
+	match_id_t *match_id = NULL;
+	
+	/* Create new device. */
+	child = create_device();
+	if (NULL == child)
+		goto failure;
+	
+	child->name = name;
+	child->driver_data = drv_data;
+	
+	/* Initialize match id list */
+	match_id = create_match_id();
+	if (NULL == match_id)
+		goto failure;
+	
+	match_id->id = str_match_id;
+	match_id->score = 100;
+	add_match_id(&child->match_ids, match_id);
+	
+	/* Set provided operations to the device. */
+	child->ops = &rootpc_child_ops;
+	
+	/* Register child device. */
+	if (EOK != child_device_register(child, parent))
+		goto failure;
+	
+	return true;
+	
+failure:
+	if (NULL != match_id)
+		match_id->id = NULL;
+	
+	if (NULL != child) {
+		child->name = NULL;
+		delete_device(child);
+	}
+	
+	printf(NAME ": failed to add child device '%s'.\n", name);
+	
+	return false;
+}
+
+static bool rootpc_add_children(device_t *dev)
+{
+	return rootpc_add_child(dev, "pci0", "intel_pci", &pci_data);
+}
+
+/** Get the root device.
+ *
+ * @param dev		The device which is root of the whole device tree (both
+ *			of HW and pseudo devices).
+ * @return		Zero on success, negative error number otherwise.
+ */
+static int rootpc_add_device(device_t *dev)
+{
+	printf(NAME ": rootpc_add_device, device handle = %d\n",
+	    (int)dev->handle);
+	
+	/* Register child devices. */
+	if (!rootpc_add_children(dev)) {
+		printf(NAME ": failed to add child devices for platform "
+		    "ia32.\n");
+	}
+	
+	return EOK;
+}
+
+static void root_pc_init(void)
+{
+	rootpc_child_ops.interfaces[HW_RES_DEV_IFACE] = &child_res_iface;
+}
+
+int main(int argc, char *argv[])
+{
+	printf(NAME ": HelenOS rootpc device driver\n");
+	root_pc_init();
+	return driver_main(&rootpc_driver);
+}
+
+/**
+ * @}
+ */
Index: uspace/drv/rootpc/rootpc.ma
===================================================================
--- uspace/drv/rootpc/rootpc.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/rootpc/rootpc.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,2 @@
+10 ia32
+10 amd64
Index: uspace/drv/rootvirt/Makefile
===================================================================
--- uspace/drv/rootvirt/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/rootvirt/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2010 Vojtech Horky
+# 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.
+#
+
+USPACE_PREFIX = ../..
+LIBS = $(LIBDRV_PREFIX)/libdrv.a
+EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include
+BINARY = rootvirt
+
+SOURCES = \
+	rootvirt.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/rootvirt/devices.def
===================================================================
--- uspace/drv/rootvirt/devices.def	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/rootvirt/devices.def	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,23 @@
+/*
+ * Add list of virtual devices you want to launch driver for here.
+ *
+ * Unless the list is empty, the last item shall be followed by a comma.
+ */
+#ifdef CONFIG_TEST_DRIVERS
+{
+	.name = "test1",
+	.match_id = "virtual&test1"
+},
+{
+	.name = "test2alpha",
+	.match_id = "virtual&test2"
+},
+{
+	.name = "test2bravo",
+	.match_id = "virtual&test2"
+},
+{
+	.name = "null",
+	.match_id = "virtual&test1"
+},
+#endif
Index: uspace/drv/rootvirt/rootvirt.c
===================================================================
--- uspace/drv/rootvirt/rootvirt.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/rootvirt/rootvirt.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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.
+ */
+
+/**
+ * @defgroup rootvirt Root device driver for virtual devices.
+ * @{
+ */
+
+/** @file
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <errno.h>
+#include <str_error.h>
+#include <driver.h>
+
+#define NAME "rootvirt"
+
+/** Virtual device entry. */
+typedef struct {
+	/** Device name. */
+	const char *name;
+	/** Device match id. */
+	const char *match_id;
+} virtual_device_t;
+
+/** List of existing virtual devices. */
+virtual_device_t virtual_devices[] = {
+#include "devices.def"
+	/* Terminating item. */
+	{
+		.name = NULL,
+		.match_id = NULL
+	}
+};
+
+static int add_device(device_t *dev);
+
+static driver_ops_t rootvirt_ops = {
+	.add_device = &add_device
+};
+
+static driver_t rootvirt_driver = {
+	.name = NAME,
+	.driver_ops = &rootvirt_ops
+};
+
+/** Add child device.
+ *
+ * @param parent Parent device.
+ * @param virt_dev Virtual device to add.
+ * @return Error code.
+ */
+static int add_child(device_t *parent, virtual_device_t *virt_dev)
+{
+	printf(NAME ": registering child device `%s' (match \"%s\")\n",
+	    virt_dev->name, virt_dev->match_id);
+
+	int rc = child_device_register_wrapper(parent, virt_dev->name,
+	    virt_dev->match_id, 10);
+
+	if (rc == EOK) {
+		printf(NAME ": registered child device `%s'\n",
+		    virt_dev->name);
+	} else {
+		printf(NAME ": failed to register child device `%s': %s\n",
+		    virt_dev->name, str_error(rc));
+	}
+
+	return rc;
+}
+
+static int add_device(device_t *dev)
+{
+	static int instances = 0;
+
+	/*
+	 * Allow only single instance of root virtual device.
+	 */
+	instances++;
+	if (instances > 1) {
+		return ELIMIT;
+	}
+
+	printf(NAME ": add_device(name=\"%s\", handle=%d)\n",
+	    dev->name, (int)dev->handle);
+	
+	/*
+	 * Go through all virtual devices and try to add them.
+	 * We silently ignore failures.
+	 */
+	virtual_device_t *virt_dev = virtual_devices;
+	while (virt_dev->name != NULL) {
+		(void) add_child(dev, virt_dev);
+		virt_dev++;
+	}
+
+	return EOK;
+}
+
+int main(int argc, char *argv[])
+{
+	printf(NAME ": HelenOS virtual devices root driver\n");
+	return driver_main(&rootvirt_driver);
+}
+
+/**
+ * @}
+ */
+
Index: uspace/drv/rootvirt/rootvirt.ma
===================================================================
--- uspace/drv/rootvirt/rootvirt.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/rootvirt/rootvirt.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,1 @@
+10 rootvirt
Index: uspace/drv/test1/Makefile
===================================================================
--- uspace/drv/test1/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test1/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2010 Vojtech Horky
+# 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.
+#
+
+USPACE_PREFIX = ../..
+LIBS = $(LIBDRV_PREFIX)/libdrv.a
+EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include
+BINARY = test1
+
+SOURCES = \
+	char.c \
+	test1.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/test1/char.c
===================================================================
--- uspace/drv/test1/char.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test1/char.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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.
+ */
+
+/** @file
+ */
+
+#include <assert.h>
+#include <errno.h>
+#include <mem.h>
+#include <char.h>
+
+#include "test1.h"
+
+static int impl_char_read(device_t *dev, char *buf, size_t count) {
+	memset(buf, 0, count);
+	return count;
+}
+
+static int imp_char_write(device_t *dev, char *buf, size_t count) {
+	return count;
+}
+
+static char_iface_t char_interface = {
+	.read = &impl_char_read,
+	.write = &imp_char_write
+};
+
+device_ops_t char_device_ops = {
+	.interfaces[CHAR_DEV_IFACE] = &char_interface
+};
+
Index: uspace/drv/test1/test1.c
===================================================================
--- uspace/drv/test1/test1.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test1/test1.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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.
+ */
+
+/** @file
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <errno.h>
+#include <str_error.h>
+#include "test1.h"
+
+static int add_device(device_t *dev);
+
+static driver_ops_t driver_ops = {
+	.add_device = &add_device
+};
+
+static driver_t the_driver = {
+	.name = NAME,
+	.driver_ops = &driver_ops
+};
+
+/** Register child and inform user about it.
+ *
+ * @param parent Parent device.
+ * @param message Message for the user.
+ * @param name Device name.
+ * @param match_id Device match id.
+ * @param score Device match score.
+ */
+static void register_child_verbose(device_t *parent, const char *message,
+    const char *name, const char *match_id, int match_score)
+{
+	printf(NAME ": registering child device `%s': %s.\n",
+	   name, message);
+
+	int rc = child_device_register_wrapper(parent, name,
+	    match_id, match_score);
+
+	if (rc == EOK) {
+		printf(NAME ": registered child device `%s'.\n", name);
+	} else {
+		printf(NAME ": failed to register child `%s' (%s).\n",
+		    name, str_error(rc));
+	}
+}
+
+/** Callback when new device is passed to this driver.
+ * This function is the body of the test: it shall register new child
+ * (named `clone') that shall be driven by the same task. When the clone
+ * is added, it registers another child (named `child') that is also driven
+ * by this task. The conditions ensure that we do not recurse indefinitely.
+ * When successful, the device tree shall contain following fragment:
+ *
+ * /virtual/test1
+ * /virtual/test1/clone
+ * /virtual/test1/clone/child
+ *
+ * and devman shall not deadlock.
+ *
+ *
+ * @param dev New device.
+ * @return Error code reporting success of the operation.
+ */
+static int add_device(device_t *dev)
+{
+	printf(NAME ": add_device(name=\"%s\", handle=%d)\n",
+	    dev->name, (int) dev->handle);
+
+	add_device_to_class(dev, "virtual");
+
+	if (str_cmp(dev->name, "null") == 0) {
+		dev->ops = &char_device_ops;
+		add_device_to_class(dev, "virt-null");
+	} else if (dev->parent == NULL) {
+		register_child_verbose(dev, "cloning myself ;-)", "clone",
+		    "virtual&test1", 10);
+	} else if (str_cmp(dev->name, "clone") == 0) {
+		register_child_verbose(dev, "run by the same task", "child",
+		    "virtual&test1&child", 10);
+	}
+
+	printf(NAME ": device `%s' accepted.\n", dev->name);
+
+	return EOK;
+}
+
+int main(int argc, char *argv[])
+{
+	printf(NAME ": HelenOS test1 virtual device driver\n");
+	return driver_main(&the_driver);
+}
+
Index: uspace/drv/test1/test1.h
===================================================================
--- uspace/drv/test1/test1.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test1/test1.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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.
+ */
+
+/** @file
+ */
+#ifndef DRV_TEST1_TEST1_H_
+#define DRV_TEST1_TEST1_H_
+
+#include <driver.h>
+
+#define NAME "test1"
+
+extern device_ops_t char_device_ops;
+
+#endif
Index: uspace/drv/test1/test1.ma
===================================================================
--- uspace/drv/test1/test1.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test1/test1.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,2 @@
+10 virtual&test1
+10 virtual&test1&child
Index: uspace/drv/test2/Makefile
===================================================================
--- uspace/drv/test2/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test2/Makefile	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2010 Vojtech Horky
+# 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.
+#
+
+USPACE_PREFIX = ../..
+LIBS = $(LIBDRV_PREFIX)/libdrv.a
+EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include
+BINARY = test2
+
+SOURCES = \
+	test2.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/test2/test2.c
===================================================================
--- uspace/drv/test2/test2.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test2/test2.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * 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.
+ */
+
+/** @file
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <errno.h>
+#include <str_error.h>
+#include <driver.h>
+
+#define NAME "test2"
+
+static int add_device(device_t *dev);
+
+static driver_ops_t driver_ops = {
+	.add_device = &add_device
+};
+
+static driver_t the_driver = {
+	.name = NAME,
+	.driver_ops = &driver_ops
+};
+
+/** Register child and inform user about it.
+ *
+ * @param parent Parent device.
+ * @param message Message for the user.
+ * @param name Device name.
+ * @param match_id Device match id.
+ * @param score Device match score.
+ */
+static void register_child_verbose(device_t *parent, const char *message,
+    const char *name, const char *match_id, int match_score)
+{
+	printf(NAME ": registering child device `%s': %s.\n",
+	   name, message);
+
+	int rc = child_device_register_wrapper(parent, name,
+	    match_id, match_score);
+
+	if (rc == EOK) {
+		printf(NAME ": registered child device `%s'.\n", name);
+	} else {
+		printf(NAME ": failed to register child `%s' (%s).\n",
+		    name, str_error(rc));
+	}
+}
+
+/** Add child devices after some sleep.
+ *
+ * @param arg Parent device structure (device_t *).
+ * @return Always EOK.
+ */
+static int postponed_birth(void *arg)
+{
+	device_t *dev = (device_t *) arg;
+
+	async_usleep(1000);
+
+	register_child_verbose(dev, "child driven by the same task",
+	    "child", "virtual&test2", 10);
+	register_child_verbose(dev, "child driven by test1",
+	    "test1", "virtual&test1", 10);
+
+	add_device_to_class(dev, "virtual");
+
+	return EOK;
+}
+
+
+static int add_device(device_t *dev)
+{
+	printf(NAME ": add_device(name=\"%s\", handle=%d)\n",
+	    dev->name, (int) dev->handle);
+
+	if (dev->parent == NULL) {
+		fid_t postpone = fibril_create(postponed_birth, dev);
+		fibril_add_ready(postpone);
+	} else {
+		register_child_verbose(dev, "child without available driver",
+		    "ERROR", "non-existent.match.id", 10);
+	}
+
+	return EOK;
+}
+
+int main(int argc, char *argv[])
+{
+	printf(NAME ": HelenOS test2 virtual device driver\n");
+	return driver_main(&the_driver);
+}
+
+
Index: uspace/drv/test2/test2.ma
===================================================================
--- uspace/drv/test2/test2.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
+++ uspace/drv/test2/test2.ma	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -0,0 +1,1 @@
+10 virtual&test2
Index: uspace/lib/block/libblock.c
===================================================================
--- uspace/lib/block/libblock.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/block/libblock.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -862,5 +862,5 @@
 static int get_block_size(int dev_phone, size_t *bsize)
 {
-	ipcarg_t bs;
+	sysarg_t bs;
 	int rc;
 
@@ -875,5 +875,5 @@
 static int get_num_blocks(int dev_phone, aoff64_t *nblocks)
 {
-	ipcarg_t nb_l, nb_h;
+	sysarg_t nb_l, nb_h;
 	int rc;
 
Index: pace/lib/c/Makefile.toolchain
===================================================================
--- uspace/lib/c/Makefile.toolchain	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,128 +1,0 @@
-#
-# Copyright (C) 2005 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.
-#
-
-GCC_CFLAGS = -I$(LIBC_PREFIX)/include -O3 -imacros $(LIBC_PREFIX)/../../../config.h \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
-	-finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
-	-Werror-implicit-function-declaration -pipe -g -D__$(ENDIANESS)__
-
-ICC_CFLAGS = -I$(LIBC_PREFIX)/include -O3 -imacros $(LIBC_PREFIX)/../../../config.h \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
-	-finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
-	-Werror-implicit-function-declaration -pipe -g -D__$(ENDIANESS)__
-
-CLANG_CFLAGS = -I$(LIBC_PREFIX)/include -O3 -imacros $(LIBC_PREFIX)/../../../config.h \
-	-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
-	-finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
-	-Werror-implicit-function-declaration -pipe -g -arch $(CLANG_ARCH) \
-	-D__$(ENDIANESS)__
-
-LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a
-AFLAGS =
-
-## Cross-toolchain prefix
-#
-
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
-## Setup platform configuration
-#
-
--include $(LIBC_PREFIX)/../../../Makefile.config
--include $(LIBC_PREFIX)/../../../config.defs
--include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
-
-## Simple detection of the host system
-#
-HOST = $(shell uname)
-
-## On Solaris, some utilities have different names
-#
-ifeq ($(HOST),SunOS)
-	BINUTILS_PREFIX = "g"
-else
-	BINUTILS_PREFIX = ""
-endif
-
-## Toolchain configuration
-#
-
-JOBFILE = $(LIBC_PREFIX)/../../../tools/jobfile.py
-
-ifeq ($(COMPILER),gcc_cross)
-	CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
-	GCC = $(CC)
-	AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
-	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
-	AR = $(TOOLCHAIN_DIR)/$(TARGET)-ar
-	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
-	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
-	CFLAGS = $(GCC_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
-
-ifeq ($(COMPILER),gcc_native)
-	CC = gcc
-	GCC = $(CC)
-	AS = $(BINUTILS_PREFIX)as
-	LD = $(BINUTILS_PREFIX)ld
-	AR = $(BINUTILS_PREFIX)ar
-	OBJCOPY = $(BINUTILS_PREFIX)objcopy
-	OBJDUMP = $(BINUTILS_PREFIX)objdump
-	CFLAGS = $(GCC_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
-
-ifeq ($(COMPILER),icc)
-	CC = icc
-	GCC = gcc
-	AS = as
-	LD = ld
-	AR = ar
-	OBJCOPY = objcopy
-	OBJDUMP = objdump
-	CFLAGS = $(ICC_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
-
-ifeq ($(COMPILER),clang)
-	CC = clang
-	GCC = gcc
-	AS = $(BINUTILS_PREFIX)as
-	LD = $(BINUTILS_PREFIX)ld
-	AR = $(BINUTILS_PREFIX)ar
-	OBJCOPY = $(BINUTILS_PREFIX)objcopy
-	OBJDUMP = $(BINUTILS_PREFIX)objdump
-	CFLAGS = $(CLANG_CFLAGS)
-	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
-endif
Index: uspace/lib/c/arch/abs32le/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/abs32le/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_abs32le_INTTYPES_H_
 
-#define PRIdn  PRId32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId32  /**< Format for native_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: uspace/lib/c/arch/amd64/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/amd64/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/amd64/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_amd64_INTTYPES_H_
 
-#define PRIdn  PRId64  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu64  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId64  /**< Format for native_t. */
+#define PRIun  PRIu64  /**< Format for sysarg_t. */
+#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu64  /**< Format for atomic_count_t. */
 
Index: pace/lib/c/arch/amd64/include/limits.h
===================================================================
--- uspace/lib/c/arch/amd64/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup libcamd64
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_amd64_LIMITS_H_
-#define LIBC_amd64_LIMITS_H_
-
-# define LONG_MIN MIN_INT64
-# define LONG_MAX MAX_INT64
-# define ULONG_MIN MIN_UINT64
-# define ULONG_MAX MAX_UINT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/arm32/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/arm32/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/arm32/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_arm32_INTTYPES_H_
 
-#define PRIdn  PRId32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId32  /**< Format for native_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: pace/lib/c/arch/arm32/include/limits.h
===================================================================
--- uspace/lib/c/arch/arm32/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * 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.
- */
-
-/** @addtogroup libcarm32	
- * @{
- */
-/** @file 
- *  @brief Limits declarations.
- */
-
-#ifndef LIBC_arm32__LIMITS_H_
-#define LIBC_arm32__LIMITS_H_
-
-#define LONG_MIN MIN_INT32
-#define LONG_MAX MAX_INT32
-#define ULONG_MIN MIN_UINT32
-#define ULONG_MAX MAX_UINT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/ia32/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/ia32/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/ia32/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_ia32_INTTYPES_H_
 
-#define PRIdn  PRId32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId32  /**< Format for native_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: pace/lib/c/arch/ia32/include/limits.h
===================================================================
--- uspace/lib/c/arch/ia32/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup libcia32
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia32__LIMITS_H_
-#define LIBC_ia32__LIMITS_H_
-
-# define LONG_MIN MIN_INT32
-# define LONG_MAX MAX_INT32
-# define ULONG_MIN MIN_UINT32
-# define ULONG_MAX MAX_UINT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/ia64/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/ia64/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/ia64/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_ia64_INTTYPES_H_
 
-#define PRIdn  PRId64  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu64  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId64  /**< Format for native_t. */
+#define PRIun  PRIu64  /**< Format for sysarg_t. */
+#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu64  /**< Format for atomic_count_t. */
 
Index: pace/lib/c/arch/ia64/include/limits.h
===================================================================
--- uspace/lib/c/arch/ia64/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup libcia64	
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ia64_LIMITS_H_
-#define LIBC_ia64_LIMITS_H_
-
-# define LONG_MIN MIN_INT64
-# define LONG_MAX MAX_INT64
-# define ULONG_MIN MIN_UINT64
-# define ULONG_MAX MAX_UINT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/mips32/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/mips32/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/mips32/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_mips32_INTTYPES_H_
 
-#define PRIdn  PRId32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId32  /**< Format for native_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: pace/lib/c/arch/mips32/include/limits.h
===================================================================
--- uspace/lib/c/arch/mips32/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup libcmips32	
- * @{
- */
-/** @file
- * @ingroup libcmips32eb	
- */
-
-#ifndef LIBC_mips32__LIMITS_H_
-#define LIBC_mips32__LIMITS_H_
-
-# define LONG_MIN MIN_INT32
-# define LONG_MAX MAX_INT32
-# define ULONG_MIN MIN_UINT32
-# define ULONG_MAX MAX_UINT32
-
-#endif
-
-/** @}
- */
Index: pace/lib/c/arch/mips32eb/include/limits.h
===================================================================
--- uspace/lib/c/arch/mips32eb/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-../../mips32/include/limits.h
Index: uspace/lib/c/arch/ppc32/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/ppc32/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_ppc32_INTTYPES_H_
 
-#define PRIdn  PRId32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu32  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId32  /**< Format for native_t. */
+#define PRIun  PRIu32  /**< Format for sysarg_t. */
+#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu32  /**< Format for atomic_count_t. */
 
Index: pace/lib/c/arch/ppc32/include/limits.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup libcppc32	
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ppc32_LIMITS_H_
-#define LIBC_ppc32_LIMITS_H_
-
-#define LONG_MIN MIN_INT32
-#define LONG_MAX MAX_INT32
-#define ULONG_MIN MIN_UINT32
-#define ULONG_MAX MAX_UINT32
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/arch/sparc64/include/inttypes.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/inttypes.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/arch/sparc64/include/inttypes.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -34,7 +34,7 @@
 #define LIBC_sparc64_INTTYPES_H_
 
-#define PRIdn  PRId64  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIun  PRIu64  /**< Format for sysarg_t, ipcarg_t, etc. */
-#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t, ipcarg_t, etc. */
+#define PRIdn  PRId64  /**< Format for native_t. */
+#define PRIun  PRIu64  /**< Format for sysarg_t. */
+#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
 #define PRIua  PRIu64  /**< Format for atomic_count_t. */
 
Index: pace/lib/c/arch/sparc64/include/limits.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup libcsparc64	
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_sparc64_LIMITS_H_
-#define LIBC_sparc64_LIMITS_H_
-
-#define LONG_MIN MIN_INT64
-#define LONG_MAX MAX_INT64
-#define ULONG_MIN MIN_UINT64
-#define ULONG_MAX MAX_UINT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/generic/adt/char_map.c
===================================================================
--- uspace/lib/c/generic/adt/char_map.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/adt/char_map.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -90,8 +90,8 @@
 	}
 
-	map->items[map->next]->c = * identifier;
-	++ identifier;
-	++ map->next;
-	if ((length > 1) || ((length == 0) && (*identifier))) {
+	map->items[map->next]->c = *identifier;
+	identifier++;
+	map->next++;
+	if ((length > 1) || ((length == 0) && *identifier)) {
 		map->items[map->next - 1]->value = CHAR_MAP_NULL;
 		return char_map_add_item(map->items[map->next - 1], identifier,
@@ -142,14 +142,13 @@
     const int value)
 {
-	if (char_map_is_valid(map) && (identifier) &&
-	    ((length) || (*identifier))) {
+	if (char_map_is_valid(map) && identifier && (length || *identifier)) {
 		int index;
 
-		for (index = 0; index < map->next; ++ index) {
+		for (index = 0; index < map->next; index++) {
 			if (map->items[index]->c != *identifier)
 				continue;
 				
-			++ identifier;
-			if((length > 1) || ((length == 0) && (*identifier))) {
+			identifier++;
+			if((length > 1) || ((length == 0) && *identifier)) {
 				return char_map_add(map->items[index],
 				    identifier, length ? length - 1 : 0, value);
@@ -178,5 +177,5 @@
 
 		map->magic = 0;
-		for (index = 0; index < map->next; ++index)
+		for (index = 0; index < map->next; index++)
 			char_map_destroy(map->items[index]);
 
@@ -207,10 +206,10 @@
 		return NULL;
 
-	if (length || (*identifier)) {
+	if (length || *identifier) {
 		int index;
 
-		for (index = 0; index < map->next; ++index) {
+		for (index = 0; index < map->next; index++) {
 			if (map->items[index]->c == *identifier) {
-				++identifier;
+				identifier++;
 				if (length == 1)
 					return map->items[index];
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/async.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -120,5 +120,5 @@
 	ipc_call_t *dataptr;
 	
-	ipcarg_t retval;
+	sysarg_t retval;
 } amsg_t;
 
@@ -140,5 +140,5 @@
 	
 	/** Incoming phone hash. */
-	ipcarg_t in_phone_hash;
+	sysarg_t in_phone_hash;
 	
 	/** Messages that should be delivered to this fibril. */
@@ -288,5 +288,5 @@
 	list_append(&msg->link, &conn->msg_queue);
 	
-	if (IPC_GET_METHOD(*call) == IPC_M_PHONE_HUNGUP)
+	if (IPC_GET_IMETHOD(*call) == IPC_M_PHONE_HUNGUP)
 		conn->close_callid = callid;
 	
@@ -401,5 +401,5 @@
 			 */
 			memset(call, 0, sizeof(ipc_call_t));
-			IPC_SET_METHOD(*call, IPC_M_PHONE_HUNGUP);
+			IPC_SET_IMETHOD(*call, IPC_M_PHONE_HUNGUP);
 			futex_up(&async_futex);
 			return conn->close_callid;
@@ -529,5 +529,5 @@
  *
  */
-fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid,
+fid_t async_new_connection(sysarg_t in_phone_hash, ipc_callid_t callid,
     ipc_call_t *call, void (*cfibril)(ipc_callid_t, ipc_call_t *))
 {
@@ -588,5 +588,5 @@
 	}
 	
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_CONNECT_ME:
 	case IPC_M_CONNECT_ME_TO:
@@ -807,6 +807,6 @@
  *
  */
-aid_t async_send_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr)
+aid_t async_send_fast(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr)
 {
 	amsg_t *msg = malloc(sizeof(*msg));
@@ -846,6 +846,6 @@
  *
  */
-aid_t async_send_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
+aid_t async_send_slow(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5,
     ipc_call_t *dataptr)
 {
@@ -875,5 +875,5 @@
  *
  */
-void async_wait_for(aid_t amsgid, ipcarg_t *retval)
+void async_wait_for(aid_t amsgid, sysarg_t *retval)
 {
 	amsg_t *msg = (amsg_t *) amsgid;
@@ -911,5 +911,5 @@
  *
  */
-int async_wait_timeout(aid_t amsgid, ipcarg_t *retval, suseconds_t timeout)
+int async_wait_timeout(aid_t amsgid, sysarg_t *retval, suseconds_t timeout)
 {
 	amsg_t *msg = (amsg_t *) amsgid;
@@ -1023,7 +1023,7 @@
  *
  */
-ipcarg_t async_req_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t *r1, ipcarg_t *r2,
-    ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5)
+sysarg_t async_req_fast(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t *r1, sysarg_t *r2,
+    sysarg_t *r3, sysarg_t *r4, sysarg_t *r5)
 {
 	ipc_call_t result;
@@ -1031,5 +1031,5 @@
 	    &result);
 	
-	ipcarg_t rc;
+	sysarg_t rc;
 	async_wait_for(eid, &rc);
 	
@@ -1072,7 +1072,7 @@
  *
  */
-ipcarg_t async_req_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *r1,
-    ipcarg_t *r2, ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5)
+sysarg_t async_req_slow(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, sysarg_t *r1,
+    sysarg_t *r2, sysarg_t *r3, sysarg_t *r4, sysarg_t *r5)
 {
 	ipc_call_t result;
@@ -1080,5 +1080,5 @@
 	    &result);
 	
-	ipcarg_t rc;
+	sysarg_t rc;
 	async_wait_for(eid, &rc);
 	
@@ -1113,8 +1113,8 @@
  */
 int
-async_connect_me_to(int phoneid, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3)
+async_connect_me_to(int phoneid, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3)
 {
 	int rc;
-	ipcarg_t newphid;
+	sysarg_t newphid;
 
 	rc = async_req_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, NULL,
@@ -1140,9 +1140,9 @@
  */
 int
-async_connect_me_to_blocking(int phoneid, ipcarg_t arg1, ipcarg_t arg2,
-    ipcarg_t arg3)
+async_connect_me_to_blocking(int phoneid, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3)
 {
 	int rc;
-	ipcarg_t newphid;
+	sysarg_t newphid;
 
 	rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
@@ -1166,11 +1166,11 @@
  * @return		Zero on success or a negative error code from errno.h.
  */
-int async_share_in_start(int phoneid, void *dst, size_t size, ipcarg_t arg,
+int async_share_in_start(int phoneid, void *dst, size_t size, sysarg_t arg,
     int *flags)
 {
 	int res;
 	sysarg_t tmp_flags;
-	res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst,
-	    (ipcarg_t) size, arg, NULL, &tmp_flags);
+	res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (sysarg_t) dst,
+	    (sysarg_t) size, arg, NULL, &tmp_flags);
 	if (flags)
 		*flags = tmp_flags;
@@ -1199,5 +1199,5 @@
 
 	*callid = async_get_call(&data);
-	if (IPC_GET_METHOD(data) != IPC_M_SHARE_IN)
+	if (IPC_GET_IMETHOD(data) != IPC_M_SHARE_IN)
 		return 0;
 	*size = (size_t) IPC_GET_ARG2(data);
@@ -1231,6 +1231,6 @@
 int async_share_out_start(int phoneid, void *src, int flags)
 {
-	return async_req_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0,
-	    (ipcarg_t) flags);
+	return async_req_3_0(phoneid, IPC_M_SHARE_OUT, (sysarg_t) src, 0,
+	    (sysarg_t) flags);
 }
 
@@ -1259,5 +1259,5 @@
 
 	*callid = async_get_call(&data);
-	if (IPC_GET_METHOD(data) != IPC_M_SHARE_OUT)
+	if (IPC_GET_IMETHOD(data) != IPC_M_SHARE_OUT)
 		return 0;
 	*size = (size_t) IPC_GET_ARG2(data);
@@ -1292,6 +1292,6 @@
 int async_data_read_start(int phoneid, void *dst, size_t size)
 {
-	return async_req_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst,
-	    (ipcarg_t) size);
+	return async_req_2_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst,
+	    (sysarg_t) size);
 }
 
@@ -1317,5 +1317,5 @@
 
 	*callid = async_get_call(&data);
-	if (IPC_GET_METHOD(data) != IPC_M_DATA_READ)
+	if (IPC_GET_IMETHOD(data) != IPC_M_DATA_READ)
 		return 0;
 	if (size)
@@ -1345,6 +1345,6 @@
  *
  */
-int async_data_read_forward_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr)
+int async_data_read_forward_fast(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr)
 {
 	ipc_callid_t callid;
@@ -1369,5 +1369,5 @@
 	}
 	
-	ipcarg_t rc;
+	sysarg_t rc;
 	async_wait_for(msg, &rc);
 	
@@ -1386,6 +1386,6 @@
 int async_data_write_start(int phoneid, const void *src, size_t size)
 {
-	return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,
-	    (ipcarg_t) size);
+	return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (sysarg_t) src,
+	    (sysarg_t) size);
 }
 
@@ -1412,5 +1412,5 @@
 	
 	*callid = async_get_call(&data);
-	if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE)
+	if (IPC_GET_IMETHOD(data) != IPC_M_DATA_WRITE)
 		return 0;
 	
@@ -1531,6 +1531,6 @@
  *
  */
-int async_data_write_forward_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr)
+int async_data_write_forward_fast(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr)
 {
 	ipc_callid_t callid;
@@ -1555,5 +1555,5 @@
 	}
 	
-	ipcarg_t rc;
+	sysarg_t rc;
 	async_wait_for(msg, &rc);
 	
Index: uspace/lib/c/generic/cap.c
===================================================================
--- uspace/lib/c/generic/cap.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/cap.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -31,6 +31,6 @@
  */
 /**
- * @file	cap.c
- * @brief	Functions to grant/revoke capabilities to/from a task.
+ * @file  cap.c
+ * @brief Functions to grant/revoke capabilities to/from a task.
  */
 
@@ -38,36 +38,43 @@
 #include <task.h>
 #include <libc.h>
-#include <kernel/syscall/sysarg64.h>
 
 /** Grant capabilities to a task.
  *
- * @param id Destination task ID.
+ * @param id   Destination task ID.
  * @param caps Capabilities to grant.
  *
  * @return Zero on success or a value from @ref errno.h on failure.
+ *
  */
 int cap_grant(task_id_t id, unsigned int caps)
 {
-	sysarg64_t arg;
+#ifdef __32_BITS__
+	sysarg64_t arg = (sysarg64_t) id;
+	return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps);
+#endif
 	
-	arg.value = (unsigned long long) id;
-
-	return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps);
+#ifdef __64_BITS__
+	return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) id, (sysarg_t) caps);
+#endif
 }
 
 /** Revoke capabilities from a task.
  *
- * @param id Destination task ID.
+ * @param id   Destination task ID.
  * @param caps Capabilities to revoke.
  *
  * @return Zero on success or a value from @ref errno.h on failure.
+ *
  */
 int cap_revoke(task_id_t id, unsigned int caps)
 {
-	sysarg64_t arg;
+#ifdef __32_BITS__
+	sysarg64_t arg = (sysarg64_t) id;
+	return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps);
+#endif
 	
-	arg.value = (unsigned long long) id;
-
-	return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps);
+#ifdef __64_BITS__
+	return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) id, (sysarg_t) caps);
+#endif
 }
 
Index: uspace/lib/c/generic/clipboard.c
===================================================================
--- uspace/lib/c/generic/clipboard.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/clipboard.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -75,5 +75,5 @@
 		clip_connect();
 		
-		ipcarg_t rc = async_req_1_0(clip_phone, CLIPBOARD_PUT_DATA, CLIPBOARD_TAG_NONE);
+		sysarg_t rc = async_req_1_0(clip_phone, CLIPBOARD_PUT_DATA, CLIPBOARD_TAG_NONE);
 		
 		async_serialize_end();
@@ -85,7 +85,7 @@
 		
 		aid_t req = async_send_1(clip_phone, CLIPBOARD_PUT_DATA, CLIPBOARD_TAG_DATA, NULL);
-		ipcarg_t rc = async_data_write_start(clip_phone, (void *) str, size);
+		sysarg_t rc = async_data_write_start(clip_phone, (void *) str, size);
 		if (rc != EOK) {
-			ipcarg_t rc_orig;
+			sysarg_t rc_orig;
 			async_wait_for(req, &rc_orig);
 			async_serialize_end();
@@ -119,7 +119,7 @@
 		clip_connect();
 		
-		ipcarg_t size;
-		ipcarg_t tag;
-		ipcarg_t rc = async_req_0_2(clip_phone, CLIPBOARD_CONTENT, &size, &tag);
+		sysarg_t size;
+		sysarg_t tag;
+		sysarg_t rc = async_req_0_2(clip_phone, CLIPBOARD_CONTENT, &size, &tag);
 		
 		async_serialize_end();
@@ -158,5 +158,5 @@
 			
 			if (rc != EOK) {
-				ipcarg_t rc_orig;
+				sysarg_t rc_orig;
 				async_wait_for(req, &rc_orig);
 				async_serialize_end();
Index: uspace/lib/c/generic/device/char.c
===================================================================
--- uspace/lib/c/generic/device/char.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/device/char.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -76,5 +76,5 @@
 	}
 	
-	ipcarg_t rc;
+	sysarg_t rc;
 	if (ret != EOK) {
 		async_wait_for(req, &rc);
Index: uspace/lib/c/generic/device/hw_res.c
===================================================================
--- uspace/lib/c/generic/device/hw_res.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/device/hw_res.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -38,27 +38,25 @@
 #include <malloc.h>
 
-bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)
+int get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)
 {
-	ipcarg_t count = 0;
+	sysarg_t count = 0;
 	int rc = async_req_1_1(dev_phone, DEV_IFACE_ID(HW_RES_DEV_IFACE), GET_RESOURCE_LIST, &count);
 	hw_resources->count = count;
-	if (EOK != rc) {
-		return false;
-	}
+	if (rc != EOK)
+		return rc;
 	
 	size_t size = count * sizeof(hw_resource_t);
 	hw_resources->resources = (hw_resource_t *)malloc(size);
-	if (NULL == hw_resources->resources) {
-		return false;
-	}
+	if (!hw_resources->resources)
+		return ENOMEM;
 	
 	rc = async_data_read_start(dev_phone, hw_resources->resources, size);
-	if (EOK != rc) {
+	if (rc != EOK) {
 		free(hw_resources->resources);
 		hw_resources->resources = NULL;
-		return false;
+		return rc;
 	}
 	 	 
-	return true;	 
+	return EOK;
 }
 
Index: uspace/lib/c/generic/devman.c
===================================================================
--- uspace/lib/c/generic/devman.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/devman.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -95,5 +95,5 @@
 	aid_t req = async_send_2(phone, DEVMAN_DRIVER_REGISTER, 0, 0, &answer);
 	
-	ipcarg_t retval = async_data_write_start(phone, name, str_size(name));
+	sysarg_t retval = async_data_write_start(phone, name, str_size(name));
 	if (retval != EOK) {
 		async_wait_for(req, NULL);
@@ -104,5 +104,5 @@
 	async_set_client_connection(conn);
 	
-	ipcarg_t callback_phonehash;
+	sysarg_t callback_phonehash;
 	ipc_connect_to_me(phone, 0, 0, 0, &callback_phonehash);
 	async_wait_for(req, &retval);
@@ -116,7 +116,8 @@
 {
 	ipc_call_t answer;
-	async_send_1(phone, DEVMAN_ADD_MATCH_ID, match_id->score, &answer);
+	aid_t req = async_send_1(phone, DEVMAN_ADD_MATCH_ID, match_id->score, &answer);
 	int retval = async_data_write_start(phone, match_id->id, str_size(match_id->id));
-	return retval;	
+	async_wait_for(req, NULL);
+	return retval;
 }
 
@@ -154,5 +155,5 @@
 	aid_t req = async_send_2(phone, DEVMAN_ADD_CHILD_DEVICE, parent_handle, match_count, &answer);
 
-	ipcarg_t retval = async_data_write_start(phone, name, str_size(name));
+	sysarg_t retval = async_data_write_start(phone, name, str_size(name));
 	if (retval != EOK) {
 		async_wait_for(req, NULL);
@@ -191,5 +192,5 @@
 	aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, devman_handle, &answer);
 	
-	ipcarg_t retval = async_data_write_start(phone, class_name, str_size(class_name));
+	sysarg_t retval = async_data_write_start(phone, class_name, str_size(class_name));
 	if (retval != EOK) {
 		async_wait_for(req, NULL);
@@ -267,5 +268,5 @@
 	    &answer);
 	
-	ipcarg_t retval = async_data_write_start(phone, pathname, str_size(pathname));
+	sysarg_t retval = async_data_write_start(phone, pathname, str_size(pathname));
 	if (retval != EOK) {
 		async_wait_for(req, NULL);
Index: uspace/lib/c/generic/devmap.c
===================================================================
--- uspace/lib/c/generic/devmap.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/devmap.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -107,5 +107,5 @@
 	aid_t req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer);
 	
-	ipcarg_t retval = async_data_write_start(phone, name, str_size(name));
+	sysarg_t retval = async_data_write_start(phone, name, str_size(name));
 	if (retval != EOK) {
 		async_wait_for(req, NULL);
@@ -116,5 +116,5 @@
 	async_set_client_connection(conn);
 	
-	ipcarg_t callback_phonehash;
+	sysarg_t callback_phonehash;
 	ipc_connect_to_me(phone, 0, 0, 0, &callback_phonehash);
 	async_wait_for(req, &retval);
@@ -127,5 +127,54 @@
 /** Register new device.
  *
- * @param namespace Namespace name.
+ * The @p interface is used when forwarding connection to the driver.
+ * If not 0, the first argument is the interface and the second argument
+ * is the devmap handle of the device.
+ * When the interface is zero (default), the first argument is directly
+ * the handle (to ensure backward compatibility).
+ *
+ * @param fqdn Fully qualified device name.
+ * @param[out] handle Handle to the created instance of device.
+ * @param interface Interface when forwarding.
+ *
+ */
+int devmap_device_register_with_iface(const char *fqdn,
+    devmap_handle_t *handle, sysarg_t interface)
+{
+	int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING);
+	
+	if (phone < 0)
+		return phone;
+	
+	async_serialize_start();
+	
+	ipc_call_t answer;
+	aid_t req = async_send_2(phone, DEVMAP_DEVICE_REGISTER, interface, 0,
+	    &answer);
+	
+	sysarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn));
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		async_serialize_end();
+		return retval;
+	}
+	
+	async_wait_for(req, &retval);
+	
+	async_serialize_end();
+	
+	if (retval != EOK) {
+		if (handle != NULL)
+			*handle = -1;
+		return retval;
+	}
+	
+	if (handle != NULL)
+		*handle = (devmap_handle_t) IPC_GET_ARG1(answer);
+	
+	return retval;
+}
+
+/** Register new device.
+ *
  * @param fqdn      Fully qualified device name.
  * @param handle    Output: Handle to the created instance of device.
@@ -134,37 +183,7 @@
 int devmap_device_register(const char *fqdn, devmap_handle_t *handle)
 {
-	int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING);
-	
-	if (phone < 0)
-		return phone;
-	
-	async_serialize_start();
-	
-	ipc_call_t answer;
-	aid_t req = async_send_2(phone, DEVMAP_DEVICE_REGISTER, 0, 0,
-	    &answer);
-	
-	ipcarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn));
-	if (retval != EOK) {
-		async_wait_for(req, NULL);
-		async_serialize_end();
-		return retval;
-	}
-	
-	async_wait_for(req, &retval);
-	
-	async_serialize_end();
-	
-	if (retval != EOK) {
-		if (handle != NULL)
-			*handle = -1;
-		return retval;
-	}
-	
-	if (handle != NULL)
-		*handle = (devmap_handle_t) IPC_GET_ARG1(answer);
-	
-	return retval;
-}
+	return devmap_device_register_with_iface(fqdn, handle, 0);
+}
+
 
 int devmap_device_get_handle(const char *fqdn, devmap_handle_t *handle, unsigned int flags)
@@ -181,5 +200,5 @@
 	    &answer);
 	
-	ipcarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn));
+	sysarg_t retval = async_data_write_start(phone, fqdn, str_size(fqdn));
 	if (retval != EOK) {
 		async_wait_for(req, NULL);
@@ -217,5 +236,5 @@
 	    &answer);
 	
-	ipcarg_t retval = async_data_write_start(phone, name, str_size(name));
+	sysarg_t retval = async_data_write_start(phone, name, str_size(name));
 	if (retval != EOK) {
 		async_wait_for(req, NULL);
@@ -247,5 +266,5 @@
 		return phone;
 	
-	ipcarg_t type;
+	sysarg_t type;
 	int retval = async_req_1_1(phone, DEVMAP_HANDLE_PROBE, handle, &type);
 	if (retval != EOK)
@@ -277,5 +296,5 @@
 		return -1;
 	
-	ipcarg_t null_id;
+	sysarg_t null_id;
 	int retval = async_req_0_1(phone, DEVMAP_NULL_CREATE, &null_id);
 	if (retval != EOK)
@@ -292,10 +311,10 @@
 		return;
 	
-	async_req_1_0(phone, DEVMAP_NULL_DESTROY, (ipcarg_t) null_id);
+	async_req_1_0(phone, DEVMAP_NULL_DESTROY, (sysarg_t) null_id);
 }
 
 static size_t devmap_count_namespaces_internal(int phone)
 {
-	ipcarg_t count;
+	sysarg_t count;
 	int retval = async_req_0_1(phone, DEVMAP_GET_NAMESPACE_COUNT, &count);
 	if (retval != EOK)
@@ -307,5 +326,5 @@
 static size_t devmap_count_devices_internal(int phone, devmap_handle_t ns_handle)
 {
-	ipcarg_t count;
+	sysarg_t count;
 	int retval = async_req_1_1(phone, DEVMAP_GET_DEVICE_COUNT, ns_handle, &count);
 	if (retval != EOK)
@@ -375,5 +394,5 @@
 		}
 		
-		ipcarg_t retval;
+		sysarg_t retval;
 		async_wait_for(req, &retval);
 		async_serialize_end();
@@ -427,5 +446,5 @@
 		}
 		
-		ipcarg_t retval;
+		sysarg_t retval;
 		async_wait_for(req, &retval);
 		async_serialize_end();
Index: uspace/lib/c/generic/event.c
===================================================================
--- uspace/lib/c/generic/event.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/event.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -49,5 +49,5 @@
  * @return Value returned by the kernel.
  */
-int event_subscribe(event_type_t e, ipcarg_t method)
+int event_subscribe(event_type_t e, sysarg_t method)
 {
 	return __SYSCALL2(SYS_EVENT_SUBSCRIBE, (sysarg_t) e, (sysarg_t) method);
Index: uspace/lib/c/generic/fibril_synch.c
===================================================================
--- uspace/lib/c/generic/fibril_synch.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/fibril_synch.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -139,5 +139,4 @@
 static void _fibril_mutex_unlock_unsafe(fibril_mutex_t *fm)
 {
-	assert(fm->counter <= 0);
 	if (fm->counter++ < 0) {
 		link_t *tmp;
@@ -165,7 +164,20 @@
 void fibril_mutex_unlock(fibril_mutex_t *fm)
 {
+	assert(fibril_mutex_is_locked(fm));
 	futex_down(&async_futex);
 	_fibril_mutex_unlock_unsafe(fm);
 	futex_up(&async_futex);
+}
+
+bool fibril_mutex_is_locked(fibril_mutex_t *fm)
+{
+	bool locked = false;
+	
+	futex_down(&async_futex);
+	if (fm->counter <= 0) 
+		locked = true;
+	futex_up(&async_futex);
+	
+	return locked;
 }
 
@@ -230,5 +242,4 @@
 {
 	futex_down(&async_futex);
-	assert(frw->readers || (frw->writers == 1));
 	if (frw->readers) {
 		if (--frw->readers) {
@@ -296,4 +307,5 @@
 void fibril_rwlock_read_unlock(fibril_rwlock_t *frw)
 {
+	assert(fibril_rwlock_is_read_locked(frw));
 	_fibril_rwlock_common_unlock(frw);
 }
@@ -301,5 +313,38 @@
 void fibril_rwlock_write_unlock(fibril_rwlock_t *frw)
 {
+	assert(fibril_rwlock_is_write_locked(frw));
 	_fibril_rwlock_common_unlock(frw);
+}
+
+bool fibril_rwlock_is_read_locked(fibril_rwlock_t *frw)
+{
+	bool locked = false;
+
+	futex_down(&async_futex);
+	if (frw->readers)
+		locked = true;
+	futex_up(&async_futex);
+
+	return locked;
+}
+
+bool fibril_rwlock_is_write_locked(fibril_rwlock_t *frw)
+{
+	bool locked = false;
+
+	futex_down(&async_futex);
+	if (frw->writers) {
+		assert(frw->writers == 1);
+		locked = true;
+	}
+	futex_up(&async_futex);
+
+	return locked;
+}
+
+bool fibril_rwlock_is_locked(fibril_rwlock_t *frw)
+{
+	return fibril_rwlock_is_read_locked(frw) ||
+	    fibril_rwlock_is_write_locked(frw);
 }
 
@@ -314,4 +359,6 @@
 {
 	awaiter_t wdata;
+
+	assert(fibril_mutex_is_locked(fm));
 
 	if (timeout < 0)
Index: uspace/lib/c/generic/io/console.c
===================================================================
--- uspace/lib/c/generic/io/console.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/io/console.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -45,5 +45,5 @@
 }
 
-int console_get_size(int phone, ipcarg_t *cols, ipcarg_t *rows)
+int console_get_size(int phone, sysarg_t *cols, sysarg_t *rows)
 {
 	return async_req_0_2(phone, CONSOLE_GET_SIZE, cols, rows);
@@ -71,5 +71,5 @@
 }
 
-int console_get_color_cap(int phone, ipcarg_t *ccap)
+int console_get_color_cap(int phone, sysarg_t *ccap)
 {
 	return async_req_0_1(phone, CONSOLE_GET_COLOR_CAP, ccap);
@@ -81,10 +81,10 @@
 }
 
-int console_get_pos(int phone, ipcarg_t *col, ipcarg_t *row)
+int console_get_pos(int phone, sysarg_t *col, sysarg_t *row)
 {
 	return async_req_0_2(phone, CONSOLE_GET_POS, col, row);
 }
 
-void console_set_pos(int phone, ipcarg_t col, ipcarg_t row)
+void console_set_pos(int phone, sysarg_t col, sysarg_t row)
 {
 	async_msg_2(phone, CONSOLE_GOTO, col, row);
@@ -93,8 +93,8 @@
 bool console_get_event(int phone, console_event_t *event)
 {
-	ipcarg_t type;
-	ipcarg_t key;
-	ipcarg_t mods;
-	ipcarg_t c;
+	sysarg_t type;
+	sysarg_t key;
+	sysarg_t mods;
+	sysarg_t c;
 	
 	int rc = async_req_0_4(phone, CONSOLE_GET_EVENT, &type, &key, &mods, &c);
Index: uspace/lib/c/generic/io/screenbuffer.c
===================================================================
--- uspace/lib/c/generic/io/screenbuffer.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/io/screenbuffer.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -67,6 +67,6 @@
  *
  */
-screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, ipcarg_t size_x,
-    ipcarg_t size_y)
+screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, sysarg_t size_x,
+    sysarg_t size_y)
 {
 	scr->buffer = (keyfield_t *) malloc(sizeof(keyfield_t) * size_x * size_y);
@@ -110,7 +110,7 @@
  *
  */
-void screenbuffer_clear_line(screenbuffer_t *scr, ipcarg_t line)
+void screenbuffer_clear_line(screenbuffer_t *scr, sysarg_t line)
 {
-	ipcarg_t x;
+	sysarg_t x;
 	
 	for (x = 0; x < scr->size_x; x++) {
@@ -141,5 +141,5 @@
  *
  */
-void screenbuffer_goto(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y)
+void screenbuffer_goto(screenbuffer_t *scr, sysarg_t x, sysarg_t y)
 {
 	scr->position_x = x % scr->size_x;
Index: uspace/lib/c/generic/ipc.c
===================================================================
--- uspace/lib/c/generic/ipc.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/ipc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -38,5 +38,5 @@
  */
 /** @file
- */ 
+ */
 
 #include <ipc/ipc.h>
@@ -104,7 +104,7 @@
  */
 int
-ipc_call_sync_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
-    ipcarg_t arg3, ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3,
-    ipcarg_t *result4, ipcarg_t *result5)
+ipc_call_sync_fast(int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3, sysarg_t *result1, sysarg_t *result2, sysarg_t *result3,
+    sysarg_t *result4, sysarg_t *result5)
 {
 	ipc_call_t resdata;
@@ -131,29 +131,29 @@
 /** Make a synchronous call transmitting 5 arguments of payload.
  *
- * @param phoneid	Phone handle for the call.
- * @param method	Requested method.
- * @param arg1		Service-defined payload argument.
- * @param arg2		Service-defined payload argument.
- * @param arg3		Service-defined payload argument.
- * @param arg4		Service-defined payload argument.
- * @param arg5		Service-defined payload argument.
- * @param result1	If non-NULL, storage for the first return argument.
- * @param result2	If non-NULL, storage for the second return argument.
- * @param result3	If non-NULL, storage for the third return argument.
- * @param result4	If non-NULL, storage for the fourth return argument.
- * @param result5	If non-NULL, storage for the fifth return argument.
- *
- * @return		Negative value means IPC error.
- *			Otherwise the RETVAL of the answer.
+ * @param phoneid Phone handle for the call.
+ * @param imethod Requested interface and method.
+ * @param arg1    Service-defined payload argument.
+ * @param arg2    Service-defined payload argument.
+ * @param arg3    Service-defined payload argument.
+ * @param arg4    Service-defined payload argument.
+ * @param arg5    Service-defined payload argument.
+ * @param result1 If non-NULL, storage for the first return argument.
+ * @param result2 If non-NULL, storage for the second return argument.
+ * @param result3 If non-NULL, storage for the third return argument.
+ * @param result4 If non-NULL, storage for the fourth return argument.
+ * @param result5 If non-NULL, storage for the fifth return argument.
+ *
+ * @return Negative value means IPC error.
+ *         Otherwise the RETVAL of the answer.
+ *
  */
 int
-ipc_call_sync_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
-    ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *result1,
-    ipcarg_t *result2, ipcarg_t *result3, ipcarg_t *result4, ipcarg_t *result5)
+ipc_call_sync_slow(int phoneid, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, sysarg_t *result1,
+    sysarg_t *result2, sysarg_t *result3, sysarg_t *result4, sysarg_t *result5)
 {
 	ipc_call_t data;
-	int callres;
-
-	IPC_SET_METHOD(data, method);
+	
+	IPC_SET_IMETHOD(data, imethod);
 	IPC_SET_ARG1(data, arg1);
 	IPC_SET_ARG2(data, arg2);
@@ -161,10 +161,10 @@
 	IPC_SET_ARG4(data, arg4);
 	IPC_SET_ARG5(data, arg5);
-
-	callres = __SYSCALL3(SYS_IPC_CALL_SYNC_SLOW, phoneid, (sysarg_t) &data,
-	    (sysarg_t) &data);
+	
+	int callres = __SYSCALL3(SYS_IPC_CALL_SYNC_SLOW, phoneid,
+	    (sysarg_t) &data, (sysarg_t) &data);
 	if (callres)
 		return callres;
-
+	
 	if (result1)
 		*result1 = IPC_GET_ARG1(data);
@@ -177,5 +177,5 @@
 	if (result5)
 		*result5 = IPC_GET_ARG5(data);
-
+	
 	return IPC_GET_RETVAL(data);
 }
@@ -183,8 +183,9 @@
 /** Syscall to send asynchronous message.
  *
- * @param phoneid	Phone handle for the call.
- * @param data		Call data with the request.
- *
- * @return		Hash of the call or an error code.
+ * @param phoneid Phone handle for the call.
+ * @param data    Call data with the request.
+ *
+ * @return Hash of the call or an error code.
+ *
  */
 static ipc_callid_t _ipc_call_async(int phoneid, ipc_call_t *data)
@@ -277,23 +278,23 @@
  * If the call cannot be temporarily made, queue it.
  *
- * @param phoneid	Phone handle for the call.
- * @param method	Requested method.
- * @param arg1		Service-defined payload argument.
- * @param arg2		Service-defined payload argument.
- * @param arg3		Service-defined payload argument.
- * @param arg4		Service-defined payload argument.
- * @param private	Argument to be passed to the answer/error callback.
- * @param callback	Answer or error callback.
- * @param can_preempt	If non-zero, the current fibril will be preempted in
- *			case the kernel temporarily refuses to accept more
- *			asynchronous calls.
- */
-void ipc_call_async_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, void *private,
+ * @param phoneid     Phone handle for the call.
+ * @param imethod     Requested interface and method.
+ * @param arg1        Service-defined payload argument.
+ * @param arg2        Service-defined payload argument.
+ * @param arg3        Service-defined payload argument.
+ * @param arg4        Service-defined payload argument.
+ * @param private     Argument to be passed to the answer/error callback.
+ * @param callback    Answer or error callback.
+ * @param can_preempt If non-zero, the current fibril will be preempted in
+ *                    case the kernel temporarily refuses to accept more
+ *                    asynchronous calls.
+ *
+ */
+void ipc_call_async_fast(int phoneid, sysarg_t imethod, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, void *private,
     ipc_async_callback_t callback, int can_preempt)
 {
 	async_call_t *call = NULL;
-	ipc_callid_t callid;
-
+	
 	if (callback) {
 		call = ipc_prepare_async(private, callback);
@@ -301,5 +302,5 @@
 			return;
 	}
-
+	
 	/*
 	 * We need to make sure that we get callid before another thread
@@ -307,7 +308,7 @@
 	 */
 	futex_down(&ipc_futex);
-	callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid, method, arg1,
-	    arg2, arg3, arg4);
-
+	ipc_callid_t callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid,
+	    imethod, arg1, arg2, arg3, arg4);
+	
 	if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) {
 		if (!call) {
@@ -316,5 +317,5 @@
 				return;
 		}
-		IPC_SET_METHOD(call->u.msg.data, method);
+		IPC_SET_IMETHOD(call->u.msg.data, imethod);
 		IPC_SET_ARG1(call->u.msg.data, arg1);
 		IPC_SET_ARG2(call->u.msg.data, arg2);
@@ -337,20 +338,20 @@
  * If the call cannot be temporarily made, queue it.
  *
- * @param phoneid	Phone handle for the call.
- * @param method	Requested method.
- * @param arg1		Service-defined payload argument.
- * @param arg2		Service-defined payload argument.
- * @param arg3		Service-defined payload argument.
- * @param arg4		Service-defined payload argument.
- * @param arg5		Service-defined payload argument.
- * @param private	Argument to be passed to the answer/error callback.
- * @param callback	Answer or error callback.
- * @param can_preempt	If non-zero, the current fibril will be preempted in
- *			case the kernel temporarily refuses to accept more
- *			asynchronous calls.
- *
- */
-void ipc_call_async_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, void *private,
+ * @param phoneid     Phone handle for the call.
+ * @param imethod     Requested interface and method.
+ * @param arg1        Service-defined payload argument.
+ * @param arg2        Service-defined payload argument.
+ * @param arg3        Service-defined payload argument.
+ * @param arg4        Service-defined payload argument.
+ * @param arg5        Service-defined payload argument.
+ * @param private     Argument to be passed to the answer/error callback.
+ * @param callback    Answer or error callback.
+ * @param can_preempt If non-zero, the current fibril will be preempted in
+ *                    case the kernel temporarily refuses to accept more
+ *                    asynchronous calls.
+ *
+ */
+void ipc_call_async_slow(int phoneid, sysarg_t imethod, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, void *private,
     ipc_async_callback_t callback, int can_preempt)
 {
@@ -362,5 +363,5 @@
 		return;
 
-	IPC_SET_METHOD(call->u.msg.data, method);
+	IPC_SET_IMETHOD(call->u.msg.data, imethod);
 	IPC_SET_ARG1(call->u.msg.data, arg1);
 	IPC_SET_ARG2(call->u.msg.data, arg2);
@@ -393,6 +394,6 @@
  * @return		Zero on success or a value from @ref errno.h on failure.
  */
-ipcarg_t ipc_answer_fast(ipc_callid_t callid, ipcarg_t retval, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4)
+sysarg_t ipc_answer_fast(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
 {
 	return __SYSCALL6(SYS_IPC_ANSWER_FAST, callid, retval, arg1, arg2, arg3,
@@ -412,6 +413,6 @@
  * @return		Zero on success or a value from @ref errno.h on failure.
  */
-ipcarg_t ipc_answer_slow(ipc_callid_t callid, ipcarg_t retval, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5)
+sysarg_t ipc_answer_slow(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5)
 {
 	ipc_call_t data;
@@ -585,5 +586,5 @@
  */
 int ipc_connect_to_me(int phoneid, int arg1, int arg2, int arg3, 
-    ipcarg_t *phonehash)
+    sysarg_t *phonehash)
 {
 	return ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2,
@@ -602,5 +603,5 @@
 int ipc_connect_me_to(int phoneid, int arg1, int arg2, int arg3)
 {
-	ipcarg_t newphid;
+	sysarg_t newphid;
 	int res;
 
@@ -626,5 +627,5 @@
 int ipc_connect_me_to_blocking(int phoneid, int arg1, int arg2, int arg3)
 {
-	ipcarg_t newphid;
+	sysarg_t newphid;
 	int res;
 
@@ -676,12 +677,12 @@
 /** Forward a received call to another destination.
  *
- * @param callid	Hash of the call to forward.
- * @param phoneid	Phone handle to use for forwarding.
- * @param method	New method for the forwarded call.
- * @param arg1		New value of the first argument for the forwarded call.
- * @param arg2		New value of the second argument for the forwarded call.
- * @param mode		Flags specifying mode of the forward operation.
- *
- * @return		Zero on success or an error code.
+ * @param callid  Hash of the call to forward.
+ * @param phoneid Phone handle to use for forwarding.
+ * @param imethod New interface and method for the forwarded call.
+ * @param arg1    New value of the first argument for the forwarded call.
+ * @param arg2    New value of the second argument for the forwarded call.
+ * @param mode    Flags specifying mode of the forward operation.
+ *
+ * @return Zero on success or an error code.
  *
  * For non-system methods, the old method, arg1 and arg2 are rewritten by the
@@ -690,19 +691,19 @@
  * methods are forwarded verbatim.
  */
-int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method,
-    ipcarg_t arg1, ipcarg_t arg2, int mode)
-{
-	return __SYSCALL6(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1, 
+int ipc_forward_fast(ipc_callid_t callid, int phoneid, int imethod,
+    sysarg_t arg1, sysarg_t arg2, int mode)
+{
+	return __SYSCALL6(SYS_IPC_FORWARD_FAST, callid, phoneid, imethod, arg1,
 	    arg2, mode);
 }
 
 
-int ipc_forward_slow(ipc_callid_t callid, int phoneid, int method,
-    ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
+int ipc_forward_slow(ipc_callid_t callid, int phoneid, int imethod,
+    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5,
     int mode)
 {
 	ipc_call_t data;
-
-	IPC_SET_METHOD(data, method);
+	
+	IPC_SET_IMETHOD(data, imethod);
 	IPC_SET_ARG1(data, arg1);
 	IPC_SET_ARG2(data, arg2);
@@ -710,5 +711,5 @@
 	IPC_SET_ARG4(data, arg4);
 	IPC_SET_ARG5(data, arg5);
-
+	
 	return __SYSCALL4(SYS_IPC_FORWARD_SLOW, callid, phoneid, (sysarg_t) &data, mode);
 }
@@ -725,10 +726,10 @@
  * @return		Zero on success or a negative error code from errno.h.
  */
-int ipc_share_in_start(int phoneid, void *dst, size_t size, ipcarg_t arg,
+int ipc_share_in_start(int phoneid, void *dst, size_t size, sysarg_t arg,
     int *flags)
 {
 	sysarg_t tmp_flags = 0;
-	int res = ipc_call_sync_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst,
-	    (ipcarg_t) size, arg, NULL, &tmp_flags);
+	int res = ipc_call_sync_3_2(phoneid, IPC_M_SHARE_IN, (sysarg_t) dst,
+	    (sysarg_t) size, arg, NULL, &tmp_flags);
 	
 	if (flags)
@@ -751,5 +752,5 @@
 int ipc_share_in_finalize(ipc_callid_t callid, void *src, int flags)
 {
-	return ipc_answer_2(callid, EOK, (ipcarg_t) src, (ipcarg_t) flags);
+	return ipc_answer_2(callid, EOK, (sysarg_t) src, (sysarg_t) flags);
 }
 
@@ -764,6 +765,6 @@
 int ipc_share_out_start(int phoneid, void *src, int flags)
 {
-	return ipc_call_sync_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0,
-	    (ipcarg_t) flags);
+	return ipc_call_sync_3_0(phoneid, IPC_M_SHARE_OUT, (sysarg_t) src, 0,
+	    (sysarg_t) flags);
 }
 
@@ -780,5 +781,5 @@
 int ipc_share_out_finalize(ipc_callid_t callid, void *dst)
 {
-	return ipc_answer_1(callid, EOK, (ipcarg_t) dst);
+	return ipc_answer_1(callid, EOK, (sysarg_t) dst);
 }
 
@@ -794,6 +795,6 @@
 int ipc_data_read_start(int phoneid, void *dst, size_t size)
 {
-	return ipc_call_sync_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst,
-	    (ipcarg_t) size);
+	return ipc_call_sync_2_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst,
+	    (sysarg_t) size);
 }
 
@@ -812,5 +813,5 @@
 int ipc_data_read_finalize(ipc_callid_t callid, const void *src, size_t size)
 {
-	return ipc_answer_2(callid, EOK, (ipcarg_t) src, (ipcarg_t) size);
+	return ipc_answer_2(callid, EOK, (sysarg_t) src, (sysarg_t) size);
 }
 
@@ -825,6 +826,6 @@
 int ipc_data_write_start(int phoneid, const void *src, size_t size)
 {
-	return ipc_call_sync_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,
-	    (ipcarg_t) size);
+	return ipc_call_sync_2_0(phoneid, IPC_M_DATA_WRITE, (sysarg_t) src,
+	    (sysarg_t) size);
 }
 
@@ -842,19 +843,22 @@
 int ipc_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
 {
-	return ipc_answer_2(callid, EOK, (ipcarg_t) dst, (ipcarg_t) size);
-}
-
-#include <kernel/syscall/sysarg64.h>
+	return ipc_answer_2(callid, EOK, (sysarg_t) dst, (sysarg_t) size);
+}
+
 /** Connect to a task specified by id.
+ *
  */
 int ipc_connect_kbox(task_id_t id)
 {
-	sysarg64_t arg;
-
-	arg.value = (unsigned long long) id;
-
+#ifdef __32_BITS__
+	sysarg64_t arg = (sysarg64_t) id;
 	return __SYSCALL1(SYS_IPC_CONNECT_KBOX, (sysarg_t) &arg);
-}
- 
+#endif
+	
+#ifdef __64_BITS__
+	return __SYSCALL1(SYS_IPC_CONNECT_KBOX, (sysarg_t) id);
+#endif
+}
+
 /** @}
  */
Index: uspace/lib/c/generic/loader.c
===================================================================
--- uspace/lib/c/generic/loader.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/loader.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -96,5 +96,5 @@
 	}
 	
-	ipcarg_t retval;
+	sysarg_t retval;
 	async_wait_for(req, &retval);
 	return (int) retval;
@@ -131,5 +131,5 @@
 	}
 	
-	ipcarg_t retval;
+	sysarg_t retval;
 	async_wait_for(req, &retval);
 	return (int) retval;
@@ -166,5 +166,5 @@
 	free(pa);
 	
-	ipcarg_t retval;
+	sysarg_t retval;
 	async_wait_for(req, &retval);
 	return (int) retval;
@@ -213,5 +213,5 @@
 	ipc_call_t answer;
 	aid_t req = async_send_0(ldr->phone_id, LOADER_SET_ARGS, &answer);
-	ipcarg_t rc = async_data_write_start(ldr->phone_id, (void *) arg_buf, buffer_size);
+	sysarg_t rc = async_data_write_start(ldr->phone_id, (void *) arg_buf, buffer_size);
 	if (rc != EOK) {
 		async_wait_for(req, NULL);
@@ -267,5 +267,5 @@
 	ipc_call_t answer;
 	aid_t req = async_send_0(ldr->phone_id, LOADER_SET_FILES, &answer);
-	ipcarg_t rc = async_data_write_start(ldr->phone_id, (void *) files_buf,
+	sysarg_t rc = async_data_write_start(ldr->phone_id, (void *) files_buf,
 	    count * sizeof(fdi_node_t));
 	if (rc != EOK) {
Index: uspace/lib/c/generic/net/icmp_api.c
===================================================================
--- uspace/lib/c/generic/net/icmp_api.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/net/icmp_api.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -81,5 +81,5 @@
 {
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 
 	if (addrlen <= 0)
@@ -87,5 +87,5 @@
 
 	message_id = async_send_5(icmp_phone, NET_ICMP_ECHO, size, timeout, ttl,
-	    tos, (ipcarg_t) dont_fragment, NULL);
+	    tos, (sysarg_t) dont_fragment, NULL);
 
 	// send the address
Index: uspace/lib/c/generic/net/modules.c
===================================================================
--- uspace/lib/c/generic/net/modules.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/net/modules.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -67,21 +67,21 @@
 		switch (answer_count) {
 		case 0:
-			ipc_answer_0(callid, (ipcarg_t) result);
+			ipc_answer_0(callid, (sysarg_t) result);
 			break;
 		case 1:
-			ipc_answer_1(callid, (ipcarg_t) result,
+			ipc_answer_1(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer));
 			break;
 		case 2:
-			ipc_answer_2(callid, (ipcarg_t) result,
+			ipc_answer_2(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer));
 			break;
 		case 3:
-			ipc_answer_3(callid, (ipcarg_t) result,
+			ipc_answer_3(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer),
 			    IPC_GET_ARG3(*answer));
 			break;
 		case 4:
-			ipc_answer_4(callid, (ipcarg_t) result,
+			ipc_answer_4(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer),
 			    IPC_GET_ARG3(*answer), IPC_GET_ARG4(*answer));
@@ -89,5 +89,5 @@
 		case 5:
 		default:
-			ipc_answer_5(callid, (ipcarg_t) result,
+			ipc_answer_5(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer),
 			    IPC_GET_ARG3(*answer), IPC_GET_ARG4(*answer),
@@ -111,5 +111,5 @@
  *			function.
  */
-int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3,
+int bind_service(services_t need, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3,
     async_client_conn_t client_receiver)
 {
@@ -134,6 +134,6 @@
  *
  */
-int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2,
-    ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout)
+int bind_service_timeout(services_t need, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout)
 {
 	int rc;
@@ -143,5 +143,5 @@
 	if (phone >= 0) {
 		/* Request the bidirectional connection */
-		ipcarg_t phonehash;
+		sysarg_t phonehash;
 		
 		rc = ipc_connect_to_me(phone, arg1, arg2, arg3, &phonehash);
@@ -196,44 +196,4 @@
 		timeout -= MODULE_WAIT_TIME;
 	}
-}
-
-/** Receives data from the other party.
- *
- * The received data buffer is allocated and returned.
- *
- * @param[out] data	The data buffer to be filled.
- * @param[out] length	The buffer length.
- * @return		EOK on success.
- * @return		EBADMEM if the data or the length parameter is NULL.
- * @return		EINVAL if the client does not send data.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
- *			async_data_write_finalize() function.
- */
-int data_receive(void **data, size_t *length)
-{
-	ipc_callid_t callid;
-	int rc;
-
-	if (!data || !length)
-		return EBADMEM;
-
-	// fetch the request
-	if (!async_data_write_receive(&callid, length))
-		return EINVAL;
-
-	// allocate the buffer
-	*data = malloc(*length);
-	if (!*data)
-		return ENOMEM;
-
-	// fetch the data
-	rc = async_data_write_finalize(callid, *data, *length);
-	if (rc != EOK) {
-		free(data);
-		return rc;
-	}
-
-	return EOK;
 }
 
@@ -283,5 +243,5 @@
 		IPC_SET_RETVAL(*answer, 0);
 		// just to be precize
-		IPC_SET_METHOD(*answer, 0);
+		IPC_SET_IMETHOD(*answer, 0);
 		IPC_SET_ARG1(*answer, 0);
 		IPC_SET_ARG2(*answer, 0);
Index: uspace/lib/c/generic/net/socket_client.c
===================================================================
--- uspace/lib/c/generic/net/socket_client.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/net/socket_client.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -214,5 +214,5 @@
 	callid = async_get_call(&call);
 
-	switch (IPC_GET_METHOD(call)) {
+	switch (IPC_GET_IMETHOD(call)) {
 	case NET_SOCKET_RECEIVED:
 	case NET_SOCKET_ACCEPTED:
@@ -229,5 +229,5 @@
 		}
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case NET_SOCKET_RECEIVED:
 			fibril_mutex_lock(&socket->receive_lock);
@@ -278,5 +278,5 @@
 	}
 
-	ipc_answer_0(callid, (ipcarg_t) rc);
+	ipc_answer_0(callid, (sysarg_t) rc);
 	goto loop;
 }
@@ -404,6 +404,6 @@
 	int socket_id;
 	services_t service;
-	ipcarg_t fragment_size;
-	ipcarg_t header_size;
+	sysarg_t fragment_size;
+	sysarg_t header_size;
 	int rc;
 
@@ -494,5 +494,5 @@
 		dyn_fifo_destroy(&socket->accepted);
 		free(socket);
-		async_msg_3(phone, NET_SOCKET_CLOSE, (ipcarg_t) socket_id, 0,
+		async_msg_3(phone, NET_SOCKET_CLOSE, (sysarg_t) socket_id, 0,
 		    service);
 		return rc;
@@ -516,10 +516,10 @@
  */
 static int
-socket_send_data(int socket_id, ipcarg_t message, ipcarg_t arg2,
+socket_send_data(int socket_id, sysarg_t message, sysarg_t arg2,
     const void *data, size_t datalength)
 {
 	socket_t *socket;
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 
 	if (!data)
@@ -540,5 +540,5 @@
 	// request the message
 	message_id = async_send_3(socket->phone, message,
-	    (ipcarg_t) socket->socket_id, arg2, socket->service, NULL);
+	    (sysarg_t) socket->socket_id, arg2, socket->service, NULL);
 	// send the address
 	async_data_write_start(socket->phone, data, datalength);
@@ -600,5 +600,5 @@
 	// request listen backlog change
 	result = (int) async_req_3_0(socket->phone, NET_SOCKET_LISTEN,
-	    (ipcarg_t) socket->socket_id, (ipcarg_t) backlog, socket->service);
+	    (sysarg_t) socket->socket_id, (sysarg_t) backlog, socket->service);
 
 	fibril_rwlock_read_unlock(&socket_globals.lock);
@@ -625,5 +625,5 @@
 	socket_t *new_socket;
 	aid_t message_id;
-	ipcarg_t ipc_result;
+	sysarg_t ipc_result;
 	int result;
 	ipc_call_t answer;
@@ -683,5 +683,5 @@
 	// request accept
 	message_id = async_send_5(socket->phone, NET_SOCKET_ACCEPT,
-	    (ipcarg_t) socket->socket_id, 0, socket->service, 0,
+	    (sysarg_t) socket->socket_id, 0, socket->service, 0,
 	    new_socket->socket_id, &answer);
 
@@ -782,5 +782,5 @@
 	// request close
 	rc = (int) async_req_3_0(socket->phone, NET_SOCKET_CLOSE,
-	    (ipcarg_t) socket->socket_id, 0, socket->service);
+	    (sysarg_t) socket->socket_id, 0, socket->service);
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&socket_globals.lock);
@@ -815,5 +815,5 @@
  */
 static int
-sendto_core(ipcarg_t message, int socket_id, const void *data,
+sendto_core(sysarg_t message, int socket_id, const void *data,
     size_t datalength, int flags, const struct sockaddr *toaddr,
     socklen_t addrlen)
@@ -821,5 +821,5 @@
 	socket_t *socket;
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 	size_t fragments;
 	ipc_call_t answer;
@@ -855,7 +855,7 @@
 	// request send
 	message_id = async_send_5(socket->phone, message,
-	    (ipcarg_t) socket->socket_id,
+	    (sysarg_t) socket->socket_id,
 	    (fragments == 1 ? datalength : socket->data_fragment_size),
-	    socket->service, (ipcarg_t) flags, fragments, &answer);
+	    socket->service, (sysarg_t) flags, fragments, &answer);
 
 	// send the address if given
@@ -973,10 +973,10 @@
  */
 static int
-recvfrom_core(ipcarg_t message, int socket_id, void *data, size_t datalength,
+recvfrom_core(sysarg_t message, int socket_id, void *data, size_t datalength,
     int flags, struct sockaddr *fromaddr, socklen_t *addrlen)
 {
 	socket_t *socket;
 	aid_t message_id;
-	ipcarg_t ipc_result;
+	sysarg_t ipc_result;
 	int result;
 	size_t fragments;
@@ -1031,6 +1031,6 @@
 		// request packet data
 		message_id = async_send_4(socket->phone, message,
-		    (ipcarg_t) socket->socket_id, 0, socket->service,
-		    (ipcarg_t) flags, &answer);
+		    (sysarg_t) socket->socket_id, 0, socket->service,
+		    (sysarg_t) flags, &answer);
 
 		// read the address if desired
@@ -1060,6 +1060,6 @@
 		// request packet data
 		message_id = async_send_4(socket->phone, message,
-		    (ipcarg_t) socket->socket_id, 0, socket->service,
-		    (ipcarg_t) flags, &answer);
+		    (sysarg_t) socket->socket_id, 0, socket->service,
+		    (sysarg_t) flags, &answer);
 
 		// read the address if desired
@@ -1160,5 +1160,5 @@
 	socket_t *socket;
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 
 	if (!value || !optlen)
@@ -1179,5 +1179,5 @@
 	// request option value
 	message_id = async_send_3(socket->phone, NET_SOCKET_GETSOCKOPT,
-	    (ipcarg_t) socket->socket_id, (ipcarg_t) optname, socket->service,
+	    (sysarg_t) socket->socket_id, (sysarg_t) optname, socket->service,
 	    NULL);
 
@@ -1214,5 +1214,5 @@
 	// send the value
 	return socket_send_data(socket_id, NET_SOCKET_SETSOCKOPT,
-	    (ipcarg_t) optname, value, optlen);
+	    (sysarg_t) optname, value, optlen);
 }
 
Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/task.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -47,8 +47,14 @@
 task_id_t task_get_id(void)
 {
+#ifdef __32_BITS__
 	task_id_t task_id;
 	(void) __SYSCALL1(SYS_TASK_GET_ID, (sysarg_t) &task_id);
 	
 	return task_id;
+#endif  /* __32_BITS__ */
+	
+#ifdef __64_BITS__
+	return (task_id_t) __SYSCALL0(SYS_TASK_GET_ID);
+#endif  /* __64_BITS__ */
 }
 
@@ -211,5 +217,5 @@
 int task_wait(task_id_t id, task_exit_t *texit, int *retval)
 {
-	ipcarg_t te, rv;
+	sysarg_t te, rv;
 	int rc;
 
Index: uspace/lib/c/generic/udebug.c
===================================================================
--- uspace/lib/c/generic/udebug.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/udebug.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -57,5 +57,5 @@
 	size_t *copied, size_t *needed)
 {
-	ipcarg_t a_copied, a_needed;
+	sysarg_t a_copied, a_needed;
 	int rc;
 
@@ -72,5 +72,5 @@
 	size_t *copied, size_t *needed)
 {
-	ipcarg_t a_copied, a_needed;
+	sysarg_t a_copied, a_needed;
 	int rc;
 
@@ -87,5 +87,5 @@
 	size_t *copied, size_t *needed)
 {
-	ipcarg_t a_copied, a_needed;
+	sysarg_t a_copied, a_needed;
 	int rc;
 
@@ -120,5 +120,5 @@
     sysarg_t *val0, sysarg_t *val1)
 {
-	ipcarg_t a_ev_type;
+	sysarg_t a_ev_type;
 	int rc;
 
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -158,7 +158,7 @@
 	vfs_connect();
 	
-	ipcarg_t rc_orig;
+	sysarg_t rc_orig;
 	aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, devmap_handle, flags, NULL);
-	ipcarg_t rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
+	sysarg_t rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
 	if (rc != EOK) {
 		async_wait_for(req, &rc_orig);
@@ -238,6 +238,6 @@
 int unmount(const char *mp)
 {
-	ipcarg_t rc;
-	ipcarg_t rc_orig;
+	sysarg_t rc;
+	sysarg_t rc_orig;
 	aid_t req;
 	size_t mpa_size;
@@ -282,8 +282,8 @@
 	ipc_call_t answer;
 	aid_t req = async_send_3(vfs_phone, VFS_IN_OPEN, lflag, oflag, 0, &answer);
-	ipcarg_t rc = async_data_write_start(vfs_phone, abs, abs_size);
-	
-	if (rc != EOK) {
-		ipcarg_t rc_orig;
+	sysarg_t rc = async_data_write_start(vfs_phone, abs, abs_size);
+	
+	if (rc != EOK) {
+		sysarg_t rc_orig;
 		async_wait_for(req, &rc_orig);
 		
@@ -330,5 +330,5 @@
 	    node->devmap_handle, node->index, oflag, &answer);
 	
-	ipcarg_t rc;
+	sysarg_t rc;
 	async_wait_for(req, &rc);
 	async_serialize_end();
@@ -343,5 +343,5 @@
 int close(int fildes)
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	
 	futex_down(&vfs_phone_futex);
@@ -359,5 +359,5 @@
 ssize_t read(int fildes, void *buf, size_t nbyte) 
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	ipc_call_t answer;
 	aid_t req;
@@ -370,5 +370,5 @@
 	rc = async_data_read_start(vfs_phone, (void *)buf, nbyte);
 	if (rc != EOK) {
-		ipcarg_t rc_orig;
+		sysarg_t rc_orig;
 	
 		async_wait_for(req, &rc_orig);
@@ -391,5 +391,5 @@
 ssize_t write(int fildes, const void *buf, size_t nbyte) 
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	ipc_call_t answer;
 	aid_t req;
@@ -402,5 +402,5 @@
 	rc = async_data_write_start(vfs_phone, (void *)buf, nbyte);
 	if (rc != EOK) {
-		ipcarg_t rc_orig;
+		sysarg_t rc_orig;
 	
 		async_wait_for(req, &rc_orig);
@@ -427,5 +427,5 @@
 	vfs_connect();
 	
-	ipcarg_t rc = async_req_1_0(vfs_phone, VFS_IN_SYNC, fildes);
+	sysarg_t rc = async_req_1_0(vfs_phone, VFS_IN_SYNC, fildes);
 	
 	async_serialize_end();
@@ -441,7 +441,7 @@
 	vfs_connect();
 	
-	ipcarg_t newoff_lo;
-	ipcarg_t newoff_hi;
-	ipcarg_t rc = async_req_4_2(vfs_phone, VFS_IN_SEEK, fildes,
+	sysarg_t newoff_lo;
+	sysarg_t newoff_hi;
+	sysarg_t rc = async_req_4_2(vfs_phone, VFS_IN_SEEK, fildes,
 	    LOWER32(offset), UPPER32(offset), whence,
 	    &newoff_lo, &newoff_hi);
@@ -458,5 +458,5 @@
 int ftruncate(int fildes, aoff64_t length)
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	
 	futex_down(&vfs_phone_futex);
@@ -474,5 +474,5 @@
 int fstat(int fildes, struct stat *stat)
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	aid_t req;
 
@@ -484,5 +484,5 @@
 	rc = async_data_read_start(vfs_phone, (void *) stat, sizeof(struct stat));
 	if (rc != EOK) {
-		ipcarg_t rc_orig;
+		sysarg_t rc_orig;
 		
 		async_wait_for(req, &rc_orig);
@@ -503,6 +503,6 @@
 int stat(const char *path, struct stat *stat)
 {
-	ipcarg_t rc;
-	ipcarg_t rc_orig;
+	sysarg_t rc;
+	sysarg_t rc_orig;
 	aid_t req;
 	
@@ -593,5 +593,5 @@
 int mkdir(const char *path, mode_t mode)
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	aid_t req;
 	
@@ -608,5 +608,5 @@
 	rc = async_data_write_start(vfs_phone, pa, pa_size);
 	if (rc != EOK) {
-		ipcarg_t rc_orig;
+		sysarg_t rc_orig;
 	
 		async_wait_for(req, &rc_orig);
@@ -628,5 +628,5 @@
 static int _unlink(const char *path, int lflag)
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	aid_t req;
 	
@@ -643,5 +643,5 @@
 	rc = async_data_write_start(vfs_phone, pa, pa_size);
 	if (rc != EOK) {
-		ipcarg_t rc_orig;
+		sysarg_t rc_orig;
 
 		async_wait_for(req, &rc_orig);
@@ -673,6 +673,6 @@
 int rename(const char *old, const char *new)
 {
-	ipcarg_t rc;
-	ipcarg_t rc_orig;
+	sysarg_t rc;
+	sysarg_t rc_orig;
 	aid_t req;
 	
@@ -810,6 +810,6 @@
 	vfs_connect();
 	
-	ipcarg_t ret;
-	ipcarg_t rc = async_req_2_1(vfs_phone, VFS_IN_DUP, oldfd, newfd, &ret);
+	sysarg_t ret;
+	sysarg_t rc = async_req_2_1(vfs_phone, VFS_IN_DUP, oldfd, newfd, &ret);
 	
 	async_serialize_end();
Index: uspace/lib/c/include/adt/generic_field.h
===================================================================
--- uspace/lib/c/include/adt/generic_field.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/adt/generic_field.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -91,5 +91,5 @@
 			} \
 			field->items[field->next] = value; \
-			++field->next; \
+			field->next++; \
 			field->items[field->next] = NULL; \
 			return field->next - 1; \
@@ -108,5 +108,5 @@
 			int index; \
 			field->magic = 0; \
-			for (index = 0; index < field->next; ++ index) { \
+			for (index = 0; index < field->next; index++) { \
 				if (field->items[index]) \
 					free(field->items[index]); \
Index: uspace/lib/c/include/async.h
===================================================================
--- uspace/lib/c/include/async.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/async.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -84,14 +84,14 @@
 	    (arg5), (dataptr))
 
-extern aid_t async_send_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr);
-extern aid_t async_send_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
+extern aid_t async_send_fast(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr);
+extern aid_t async_send_slow(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5,
     ipc_call_t *dataptr);
-extern void async_wait_for(aid_t amsgid, ipcarg_t *result);
-extern int async_wait_timeout(aid_t amsgid, ipcarg_t *retval,
+extern void async_wait_for(aid_t amsgid, sysarg_t *result);
+extern int async_wait_timeout(aid_t amsgid, sysarg_t *retval,
     suseconds_t timeout);
 
-extern fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid,
+extern fid_t async_new_connection(sysarg_t in_phone_hash, ipc_callid_t callid,
     ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *));
 extern void async_usleep(suseconds_t timeout);
@@ -242,10 +242,10 @@
 	    (arg5), (rc1), (rc2), (rc3), (rc4), (rc5))
 
-extern ipcarg_t async_req_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t *r1, ipcarg_t *r2,
-    ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5);
-extern ipcarg_t async_req_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
-    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *r1,
-    ipcarg_t *r2, ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5);
+extern sysarg_t async_req_fast(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t *r1, sysarg_t *r2,
+    sysarg_t *r3, sysarg_t *r4, sysarg_t *r5);
+extern sysarg_t async_req_slow(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, sysarg_t *r1,
+    sysarg_t *r2, sysarg_t *r3, sysarg_t *r4, sysarg_t *r5);
 
 static inline void async_serialize_start(void)
@@ -259,6 +259,6 @@
 }
 
-extern int async_connect_me_to(int, ipcarg_t, ipcarg_t, ipcarg_t);
-extern int async_connect_me_to_blocking(int, ipcarg_t, ipcarg_t, ipcarg_t);
+extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
+extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
 
 /*
@@ -274,5 +274,5 @@
 	async_share_in_start((phoneid), (dst), (size), (arg), (flags))
 
-extern int async_share_in_start(int, void *, size_t, ipcarg_t, int *);
+extern int async_share_in_start(int, void *, size_t, sysarg_t, int *);
 extern int async_share_in_receive(ipc_callid_t *, size_t *);
 extern int async_share_in_finalize(ipc_callid_t, void *, int );
@@ -314,6 +314,6 @@
 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
 
-extern int async_data_read_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t, ipcarg_t, ipc_call_t *);
+extern int async_data_read_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, ipc_call_t *);
 
 /*
@@ -356,6 +356,6 @@
 extern void async_data_write_void(const int);
 
-extern int async_data_write_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t, ipcarg_t, ipc_call_t *);
+extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, ipc_call_t *);
 
 #endif
Index: uspace/lib/c/include/device/hw_res.h
===================================================================
--- uspace/lib/c/include/device/hw_res.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/device/hw_res.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -95,7 +95,6 @@
 
 
-bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources);
-
-bool enable_interrupt(int dev_phone);
+extern int get_hw_resources(int, hw_resource_list_t *);
+extern bool enable_interrupt(int);
 
 
Index: uspace/lib/c/include/devmap.h
===================================================================
--- uspace/lib/c/include/devmap.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/devmap.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -45,4 +45,5 @@
 extern int devmap_driver_register(const char *, async_client_conn_t);
 extern int devmap_device_register(const char *, devmap_handle_t *);
+extern int devmap_device_register_with_iface(const char *, devmap_handle_t *, sysarg_t);
 
 extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int);
Index: uspace/lib/c/include/errno.h
===================================================================
--- uspace/lib/c/include/errno.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/errno.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -83,8 +83,6 @@
 #define ENOTCONN	(-10057)
 
-/** The requested operation was not performed.
- *  Try again later.
- */
-#define TRY_AGAIN	(-11002)
+/** The requested operation was not performed. Try again later. */
+#define EAGAIN		(-11002)
 
 /** No data.
Index: uspace/lib/c/include/event.h
===================================================================
--- uspace/lib/c/include/event.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/event.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -39,5 +39,5 @@
 #include <ipc/ipc.h>
 
-extern int event_subscribe(event_type_t, ipcarg_t);
+extern int event_subscribe(event_type_t, sysarg_t);
 
 #endif
Index: uspace/lib/c/include/fibril_synch.h
===================================================================
--- uspace/lib/c/include/fibril_synch.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/fibril_synch.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -105,4 +105,5 @@
 extern bool fibril_mutex_trylock(fibril_mutex_t *);
 extern void fibril_mutex_unlock(fibril_mutex_t *);
+extern bool fibril_mutex_is_locked(fibril_mutex_t *);
 
 extern void fibril_rwlock_initialize(fibril_rwlock_t *);
@@ -111,4 +112,7 @@
 extern void fibril_rwlock_read_unlock(fibril_rwlock_t *);
 extern void fibril_rwlock_write_unlock(fibril_rwlock_t *);
+extern bool fibril_rwlock_is_read_locked(fibril_rwlock_t *);
+extern bool fibril_rwlock_is_write_locked(fibril_rwlock_t *);
+extern bool fibril_rwlock_is_locked(fibril_rwlock_t *);
 
 extern void fibril_condvar_initialize(fibril_condvar_t *);
Index: uspace/lib/c/include/io/console.h
===================================================================
--- uspace/lib/c/include/io/console.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/io/console.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -68,7 +68,7 @@
 extern void console_clear(int phone);
 
-extern int console_get_size(int phone, ipcarg_t *cols, ipcarg_t *rows);
-extern int console_get_pos(int phone, ipcarg_t *col, ipcarg_t *row);
-extern void console_set_pos(int phone, ipcarg_t col, ipcarg_t row);
+extern int console_get_size(int phone, sysarg_t *cols, sysarg_t *rows);
+extern int console_get_pos(int phone, sysarg_t *col, sysarg_t *row);
+extern void console_set_pos(int phone, sysarg_t col, sysarg_t row);
 
 extern void console_set_style(int phone, uint8_t style);
@@ -78,5 +78,5 @@
 
 extern void console_cursor_visibility(int phone, bool show);
-extern int console_get_color_cap(int phone, ipcarg_t *ccap);
+extern int console_get_color_cap(int phone, sysarg_t *ccap);
 extern void console_kcon_enable(int phone);
 
Index: uspace/lib/c/include/io/screenbuffer.h
===================================================================
--- uspace/lib/c/include/io/screenbuffer.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/io/screenbuffer.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -84,10 +84,10 @@
 	keyfield_t *buffer;      /**< Screen content - characters and
 	                              their attributes (used as a circular buffer) */
-	ipcarg_t size_x;         /**< Number of columns  */
-	ipcarg_t size_y;         /**< Number of rows */
+	sysarg_t size_x;         /**< Number of columns  */
+	sysarg_t size_y;         /**< Number of rows */
 	
 	/** Coordinates of last printed character for determining cursor position */
-	ipcarg_t position_x;
-	ipcarg_t position_y;
+	sysarg_t position_x;
+	sysarg_t position_y;
 	
 	attrs_t attrs;           /**< Current attributes. */
@@ -109,5 +109,5 @@
  *
  */
-static inline keyfield_t *get_field_at(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y)
+static inline keyfield_t *get_field_at(screenbuffer_t *scr, sysarg_t x, sysarg_t y)
 {
 	return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x;
@@ -143,10 +143,10 @@
 
 extern void screenbuffer_putchar(screenbuffer_t *, wchar_t);
-extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, ipcarg_t, ipcarg_t);
+extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, sysarg_t, sysarg_t);
 
 extern void screenbuffer_clear(screenbuffer_t *);
-extern void screenbuffer_clear_line(screenbuffer_t *, ipcarg_t);
+extern void screenbuffer_clear_line(screenbuffer_t *, sysarg_t);
 extern void screenbuffer_copy_buffer(screenbuffer_t *, keyfield_t *);
-extern void screenbuffer_goto(screenbuffer_t *, ipcarg_t, ipcarg_t);
+extern void screenbuffer_goto(screenbuffer_t *, sysarg_t, sysarg_t);
 extern void screenbuffer_set_style(screenbuffer_t *, uint8_t);
 extern void screenbuffer_set_color(screenbuffer_t *, uint8_t, uint8_t, uint8_t);
Index: uspace/lib/c/include/ipc/devman.h
===================================================================
--- uspace/lib/c/include/ipc/devman.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/ipc/devman.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -42,5 +42,5 @@
 #define DEVMAN_NAME_MAXLEN 256
 
-typedef ipcarg_t devman_handle_t;
+typedef sysarg_t devman_handle_t;
 
 /** Ids of device models used for device-to-driver matching.
@@ -123,4 +123,5 @@
 	DEVMAN_CLIENT,
 	DEVMAN_CONNECT_TO_DEVICE,
+	DEVMAN_CONNECT_FROM_DEVMAP,
 	DEVMAN_CONNECT_TO_PARENTS_DEVICE
 } devman_interface_t;
Index: uspace/lib/c/include/ipc/devmap.h
===================================================================
--- uspace/lib/c/include/ipc/devmap.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/ipc/devmap.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -40,5 +40,5 @@
 #define DEVMAP_NAME_MAXLEN  255
 
-typedef ipcarg_t devmap_handle_t;
+typedef sysarg_t devmap_handle_t;
 
 typedef enum {
Index: uspace/lib/c/include/ipc/ip.h
===================================================================
--- uspace/lib/c/include/ipc/ip.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/ipc/ip.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -93,5 +93,5 @@
 #define IP_SET_HEADERLEN(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG2(*answer, argument); \
 	} while (0)
Index: uspace/lib/c/include/ipc/ipc.h
===================================================================
--- uspace/lib/c/include/ipc/ipc.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/ipc/ipc.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -44,9 +44,7 @@
 #define IPC_FLAG_BLOCKING  0x01
 
-typedef sysarg_t ipcarg_t;
-
 typedef struct {
-	ipcarg_t args[IPC_CALL_LEN];
-	ipcarg_t in_phone_hash;
+	sysarg_t args[IPC_CALL_LEN];
+	sysarg_t in_phone_hash;
 } ipc_call_t;
 
@@ -183,10 +181,10 @@
 	    (arg4), (arg5), (res1), (res2), (res3), (res4), (res5))
 
-extern int ipc_call_sync_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *);
-
-extern int ipc_call_sync_slow(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t, ipcarg_t, ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *,
-    ipcarg_t *);
+extern int ipc_call_sync_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *);
+
+extern int ipc_call_sync_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
+    sysarg_t *);
 
 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int);
@@ -220,8 +218,8 @@
 	ipc_answer_slow((callid), (retval), (arg1), (arg2), (arg3), (arg4), (arg5))
 
-extern ipcarg_t ipc_answer_fast(ipc_callid_t, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t, ipcarg_t);
-extern ipcarg_t ipc_answer_slow(ipc_callid_t, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t, ipcarg_t, ipcarg_t);
+extern sysarg_t ipc_answer_fast(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t);
+extern sysarg_t ipc_answer_slow(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t);
 
 /*
@@ -255,10 +253,10 @@
 	    (arg4), (arg5), (private), (callback), (can_preempt))
 
-extern void ipc_call_async_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t, void *, ipc_async_callback_t, int);
-extern void ipc_call_async_slow(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
-    ipcarg_t, ipcarg_t, void *, ipc_async_callback_t, int);
-
-extern int ipc_connect_to_me(int, int, int, int, ipcarg_t *);
+extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, void *, ipc_async_callback_t, int);
+extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, void *, ipc_async_callback_t, int);
+
+extern int ipc_connect_to_me(int, int, int, int, sysarg_t *);
 extern int ipc_connect_me_to(int, int, int, int);
 extern int ipc_connect_me_to_blocking(int, int, int, int);
@@ -266,7 +264,7 @@
 extern int ipc_register_irq(int, int, int, irq_code_t *);
 extern int ipc_unregister_irq(int, int);
-extern int ipc_forward_fast(ipc_callid_t, int, int, ipcarg_t, ipcarg_t, int);
-extern int ipc_forward_slow(ipc_callid_t, int, int, ipcarg_t, ipcarg_t,
-    ipcarg_t, ipcarg_t, ipcarg_t, int);
+extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int);
+extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t, int);
 
 /*
@@ -282,5 +280,5 @@
 	ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
 
-extern int ipc_share_in_start(int, void *, size_t, ipcarg_t, int *);
+extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);
 extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
 extern int ipc_share_out_start(int, void *, int);
Index: uspace/lib/c/include/ipc/net.h
===================================================================
--- uspace/lib/c/include/ipc/net.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/ipc/net.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -192,5 +192,5 @@
  */
 #define IS_NET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_FIRST, NET_LAST)
 
 /** Returns a value indicating whether the IPC call is an ARP message.
@@ -198,5 +198,5 @@
  */
 #define IS_NET_ARP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
 
 /** Returns a value indicating whether the IPC call is an Ethernet message.
@@ -204,5 +204,5 @@
  */
 #define IS_NET_ETH_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
 
 /** Returns a value indicating whether the IPC call is an ICMP message.
@@ -210,5 +210,5 @@
  */
 #define IS_NET_ICMP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
 
 /** Returns a value indicating whether the IPC call is an inter-network layer
@@ -217,5 +217,5 @@
  */
 #define IS_NET_IL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_IL_FIRST, NET_IL_LAST)
 
 /** Returns a value indicating whether the IPC call is an IP message.
@@ -223,5 +223,5 @@
  */
 #define IS_NET_IP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_IP_FIRST, NET_IP_LAST)
 
 /** Returns a value indicating whether the IPC call is a generic networking
@@ -230,5 +230,5 @@
  */
 #define IS_NET_NET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NET_FIRST, NET_NET_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_NET_FIRST, NET_NET_LAST)
 
 /** Returns a value indicating whether the IPC call is a network interface layer
@@ -237,5 +237,5 @@
  */
 #define IS_NET_NIL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
 
 /** Returns a value indicating whether the IPC call is a packet manaagement
@@ -244,5 +244,5 @@
  */
 #define IS_NET_PACKET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
 
 /** Returns a value indicating whether the IPC call is a socket message.
@@ -250,5 +250,5 @@
  */
 #define IS_NET_SOCKET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
 
 /** Returns a value indicating whether the IPC call is a TCP message.
@@ -256,5 +256,5 @@
  */
 #define IS_NET_TCP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
 
 /** Returns a value indicating whether the IPC call is a transport layer message.
@@ -262,5 +262,5 @@
  */
 #define IS_NET_TL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TL_FIRST, NET_TL_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_TL_FIRST, NET_TL_LAST)
 
 /** Returns a value indicating whether the IPC call is a UDP message.
@@ -268,5 +268,5 @@
  */
 #define IS_NET_UDP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
 
 /*@}*/
@@ -370,5 +370,5 @@
 #define IPC_SET_DEVICE(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG1(*answer, argument); \
 	} while (0)
@@ -379,5 +379,5 @@
 #define IPC_SET_ADDR(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG1(*answer, argument); \
 	} while (0)
@@ -388,5 +388,5 @@
 #define IPC_SET_PREFIX(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG2(*answer, argument); \
 	} while (0)
@@ -397,5 +397,5 @@
 #define IPC_SET_CONTENT(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG3(*answer, argument); \
 	} while (0)
@@ -406,5 +406,5 @@
 #define IPC_SET_SUFFIX(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG4(*answer, argument); \
 	} while (0)
Index: uspace/lib/c/include/ipc/socket.h
===================================================================
--- uspace/lib/c/include/ipc/socket.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/ipc/socket.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -84,5 +84,5 @@
 #define SOCKET_SET_SOCKET_ID(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG1(answer, argument); \
 	} while (0)
@@ -102,5 +102,5 @@
 #define SOCKET_SET_READ_DATA_LENGTH(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG1(answer, argument); \
 	} while (0)
@@ -147,5 +147,5 @@
 #define SOCKET_SET_DATA_FRAGMENT_SIZE(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG2(answer, argument); \
 	} while (0)
@@ -156,5 +156,5 @@
 #define SOCKET_SET_ADDRESS_LENGTH(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG3(answer, argument);\
 	} while (0)
@@ -174,5 +174,5 @@
 #define SOCKET_SET_HEADER_SIZE(answer, value) \
 	do { \
-		ipcarg_t argument = (ipcarg_t) (value); \
+		sysarg_t argument = (sysarg_t) (value); \
 		IPC_SET_ARG3(answer, argument); \
 	} while (0)
Index: uspace/lib/c/include/libc.h
===================================================================
--- uspace/lib/c/include/libc.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/libc.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -40,4 +40,11 @@
 #include <libarch/syscall.h>
 
+#ifdef __32_BITS__
+
+/** Explicit 64-bit arguments passed to syscalls. */
+typedef uint64_t sysarg64_t;
+
+#endif /* __32_BITS__ */
+
 #define __SYSCALL0(id) \
 	__syscall0(0, 0, 0, 0, 0, 0, id)
@@ -53,5 +60,5 @@
 	__syscall5(p1, p2, p3, p4, p5, 0, id)
 #define __SYSCALL6(id, p1, p2, p3, p4, p5, p6) \
-    __syscall6(p1, p2, p3, p4, p5, p6, id)
+	__syscall6(p1, p2, p3, p4, p5, p6, id)
 
 extern void __main(void *pcb_ptr);
Index: pace/lib/c/include/limits.h
===================================================================
--- uspace/lib/c/include/limits.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup libc
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_LIMITS_H_
-#define LIBC_LIMITS_H_
-
-#include <stdint.h>
-#include <libarch/limits.h>
-
-/* char */
-#define SCHAR_MIN MIN_INT8
-#define SCHAR_MAX MAX_INT8
-#define UCHAR_MIN MIN_UINT8
-#define UCHAR_MAX MAX_UINT8
-
-#ifdef __CHAR_UNSIGNED__
-# define CHAR_MIN UCHAR_MIN
-# define CHAR_MAX UCHAR_MAX
-#else
-# define CHAR_MIN SCHAR_MIN
-# define CHAR_MAX SCHAR_MAX
-#endif
-
-/* short int */
-#define SHRT_MIN MIN_INT16
-#define SHRT_MAX MAX_INT16
-#define USHRT_MIN MIN_UINT16
-#define USHRT_MAX MAX_UINT16
-
-#define INT_MIN MIN_INT32
-#define INT_MAX MAX_INT32
-#define UINT_MIN MIN_UINT32
-#define UINT_MAX MAX_UINT32
-
-#define LLONG_MIN MIN_INT64
-#define LLONG_MAX MAX_INT64
-#define ULLONG_MIN MIN_UINT64
-#define ULLONG_MAX MAX_UINT64
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/net/modules.h
===================================================================
--- uspace/lib/c/include/net/modules.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/c/include/net/modules.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -49,21 +49,4 @@
 #include <sys/time.h>
 
-/** Converts the data length between different types.
- *
- * @param[in] type_from	The source type.
- * @param[in] type_to	The destination type.
- * @param[in] count	The number units of the source type size.
- */
-#define CONVERT_SIZE(type_from, type_to, count) \
-	((sizeof(type_from) / sizeof(type_to)) * (count))
-
-/** Registers the module service at the name server.
- *
- * @param[in] me	The module service.
- * @param[out] phonehash The created phone hash.
- */
-#define REGISTER_ME(me, phonehash) \
-	ipc_connect_to_me(PHONE_NS, (me), 0, 0, (phonehash))
-
 /** Connect to the needed module function type definition.
  *
@@ -74,11 +57,10 @@
 
 extern void answer_call(ipc_callid_t, int, ipc_call_t *, int);
-extern int bind_service(services_t, ipcarg_t, ipcarg_t, ipcarg_t,
+extern int bind_service(services_t, sysarg_t, sysarg_t, sysarg_t,
     async_client_conn_t);
-extern int bind_service_timeout(services_t, ipcarg_t, ipcarg_t, ipcarg_t,
+extern int bind_service_timeout(services_t, sysarg_t, sysarg_t, sysarg_t,
     async_client_conn_t, suseconds_t);
 extern int connect_to_service(services_t);
 extern int connect_to_service_timeout(services_t, suseconds_t);
-extern int data_receive(void **, size_t *);
 extern int data_reply(void *, size_t);
 extern void refresh_answer(ipc_call_t *, int *);
Index: uspace/lib/clui/tinput.c
===================================================================
--- uspace/lib/clui/tinput.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/clui/tinput.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -140,6 +140,6 @@
 static void tinput_update_origin(tinput_t *ti)
 {
-	ipcarg_t width = ti->col0 + ti->nc;
-	ipcarg_t rows = (width / ti->con_cols) + 1;
+	sysarg_t width = ti->col0 + ti->nc;
+	sysarg_t rows = (width / ti->con_cols) + 1;
 	
 	/* Update row0 if the screen scrolled. */
@@ -153,8 +153,8 @@
 		return;
 	
-	ipcarg_t new_width = ti->col0 + ti->nc + 1;
+	sysarg_t new_width = ti->col0 + ti->nc + 1;
 	if (new_width % ti->con_cols == 0) {
 		/* Advancing to new line. */
-		ipcarg_t new_height = (new_width / ti->con_cols) + 1;
+		sysarg_t new_height = (new_width / ti->con_cols) + 1;
 		if (new_height >= ti->con_rows) {
 			/* Disallow text longer than 1 page for now. */
@@ -184,6 +184,6 @@
 		return;
 	
-	ipcarg_t new_width = ti->col0 + ti->nc + ilen;
-	ipcarg_t new_height = (new_width / ti->con_cols) + 1;
+	sysarg_t new_width = ti->col0 + ti->nc + ilen;
+	sysarg_t new_height = (new_width / ti->con_cols) + 1;
 	if (new_height >= ti->con_rows) {
 		/* Disallow text longer than 1 page for now. */
Index: uspace/lib/clui/tinput.h
===================================================================
--- uspace/lib/clui/tinput.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/clui/tinput.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -51,10 +51,10 @@
 	
 	/** Screen coordinates of the top-left corner of the text field */
-	ipcarg_t col0;
-	ipcarg_t row0;
+	sysarg_t col0;
+	sysarg_t row0;
 	
 	/** Screen dimensions */
-	ipcarg_t con_cols;
-	ipcarg_t con_rows;
+	sysarg_t con_cols;
+	sysarg_t con_rows;
 	
 	/** Number of characters in @c buffer */
Index: uspace/lib/drv/generic/dev_iface.c
===================================================================
--- uspace/lib/drv/generic/dev_iface.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/drv/generic/dev_iface.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -54,5 +54,5 @@
 
 remote_iface_func_ptr_t
-get_remote_method(remote_iface_t *rem_iface, ipcarg_t iface_method_idx)
+get_remote_method(remote_iface_t *rem_iface, sysarg_t iface_method_idx)
 {
 	if (iface_method_idx >= rem_iface->method_count) {
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/drv/generic/driver.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -81,5 +81,5 @@
 static void driver_irq_handler(ipc_callid_t iid, ipc_call_t *icall)
 {
-	int id = (int)IPC_GET_METHOD(*icall);
+	int id = (int)IPC_GET_IMETHOD(*icall);
 	interrupt_context_t *ctx;
 	
@@ -165,4 +165,6 @@
 	
 	devman_handle_t dev_handle =  IPC_GET_ARG1(*icall);
+    	devman_handle_t parent_dev_handle = IPC_GET_ARG2(*icall);
+    
 	device_t *dev = create_device();
 	dev->handle = dev_handle;
@@ -172,4 +174,6 @@
 	
 	add_to_devices_list(dev);
+	dev->parent = driver_get_device(&devices, parent_dev_handle);
+	
 	res = driver->driver_ops->add_device(dev);
 	if (0 == res) {
@@ -196,5 +200,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			cont = false;
@@ -250,5 +254,5 @@
 		ipc_call_t call;
 		callid = async_get_call(&call);
-		ipcarg_t method = IPC_GET_METHOD(call);
+		sysarg_t method = IPC_GET_IMETHOD(call);
 		int iface_idx;
 		
@@ -304,5 +308,5 @@
 
 			/* get the method of the remote interface */
-			ipcarg_t iface_method_idx = IPC_GET_ARG1(call);
+			sysarg_t iface_method_idx = IPC_GET_ARG1(call);
 			remote_iface_func_ptr_t iface_method_ptr =
 			    get_remote_method(rem_iface, iface_method_idx);
@@ -342,5 +346,5 @@
 {
 	/* Select interface */
-	switch ((ipcarg_t) (IPC_GET_ARG1(*icall))) {
+	switch ((sysarg_t) (IPC_GET_ARG1(*icall))) {
 	case DRIVER_DEVMAN:
 		/* handle PnP events from device manager */
@@ -377,4 +381,57 @@
 }
 
+/** Wrapper for child_device_register for devices with single match id.
+ *
+ * @param parent Parent device.
+ * @param child_name Child device name.
+ * @param child_match_id Child device match id.
+ * @param child_match_score Child device match score.
+ * @return Error code.
+ */
+int child_device_register_wrapper(device_t *parent, const char *child_name,
+    const char *child_match_id, int child_match_score)
+{
+	device_t *child = NULL;
+	match_id_t *match_id = NULL;
+	int rc;
+
+	child = create_device();
+	if (child == NULL) {
+		rc = ENOMEM;
+		goto failure;
+	}
+
+	child->name = child_name;
+
+	match_id = create_match_id();
+	if (match_id == NULL) {
+		rc = ENOMEM;
+		goto failure;
+	}
+
+	match_id->id = child_match_id;
+	match_id->score = child_match_score;
+	add_match_id(&child->match_ids, match_id);
+
+	rc = child_device_register(child, parent);
+	if (EOK != rc)
+		goto failure;
+
+	return EOK;
+
+failure:
+	if (match_id != NULL) {
+		match_id->id = NULL;
+		delete_match_id(match_id);
+	}
+
+	if (child != NULL) {
+		child->name = NULL;
+		delete_device(child);
+	}
+
+	return rc;
+}
+
 int driver_main(driver_t *drv)
 {
Index: uspace/lib/drv/include/driver.h
===================================================================
--- uspace/lib/drv/include/driver.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/drv/include/driver.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -79,5 +79,5 @@
 
 remote_iface_t *get_remote_iface(int);
-remote_iface_func_ptr_t get_remote_method(remote_iface_t *, ipcarg_t);
+remote_iface_func_ptr_t get_remote_method(remote_iface_t *, sysarg_t);
 
 
@@ -199,4 +199,5 @@
 
 int child_device_register(device_t *, device_t *);
+int child_device_register_wrapper(device_t *, const char *, const char *, int);
 
 
Index: uspace/lib/fs/libfs.c
===================================================================
--- uspace/lib/fs/libfs.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/fs/libfs.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -155,5 +155,5 @@
 	devmap_handle_t mr_devmap_handle = (devmap_handle_t) IPC_GET_ARG4(*request);
 	int res;
-	ipcarg_t rc;
+	sysarg_t rc;
 	
 	ipc_call_t call;
@@ -163,5 +163,5 @@
 	callid = async_get_call(&call);
 	int mountee_phone = (int) IPC_GET_ARG1(call);
-	if ((IPC_GET_METHOD(call) != IPC_M_CONNECTION_CLONE) ||
+	if ((IPC_GET_IMETHOD(call) != IPC_M_CONNECTION_CLONE) ||
 	    (mountee_phone < 0)) {
 		ipc_answer_0(callid, EINVAL);
Index: uspace/lib/fs/libfs.h
===================================================================
--- uspace/lib/fs/libfs.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/fs/libfs.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -86,5 +86,5 @@
 typedef struct {
 	int fs_handle;           /**< File system handle. */
-	ipcarg_t vfs_phonehash;  /**< Initial VFS phonehash. */
+	sysarg_t vfs_phonehash;  /**< Initial VFS phonehash. */
 	uint8_t *plb_ro;         /**< Read-only PLB view. */
 } fs_reg_t;
Index: pace/lib/libpci/Makefile.build
===================================================================
--- uspace/lib/libpci/Makefile.build	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,64 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 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.
-#
-
-## Setup toolchain
-#
-
-include Makefile.common
-include $(LIBC_PREFIX)/Makefile.toolchain
-
-## Sources
-#
-
-SOURCES = \
-	access.c \
-	generic.c \
-	names.c \
-	i386-ports.c
-
-OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
-
-.PHONY: all
-
-all: $(LIBPCI)
-
--include $(DEPEND)
-
-$(LIBPCI): $(OBJECTS)
-	$(AR) rc $@ $(OBJECTS)
-
-%.o: %.c $(DEPEND)
-	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
-ifeq ($(PRECHECK),y)
-	$(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
-endif
-
-$(DEPEND):
-	makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
-	-[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
Index: pace/lib/libpci/Makefile.common
===================================================================
--- uspace/lib/libpci/Makefile.common	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#
-# Copyright (c) 2005 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.
-#
-
-
-## Common names
-#
-
-LIBC_PREFIX = ../../../../../lib/libc
-DEPEND = Makefile.depend
-DEPEND_PREV = $(DEPEND).prev
-JOB = libpci.job
-LIBPCI = libpci.a
Index: uspace/lib/net/generic/generic.c
===================================================================
--- uspace/lib/net/generic/generic.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/net/generic/generic.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -59,6 +59,6 @@
     int state, services_t target)
 {
-	async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
-	    (ipcarg_t) state, target);
+	async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
+	    (sysarg_t) state, target);
 	
 	return EOK;
@@ -81,6 +81,6 @@
     int arg2, services_t service)
 {
-	return (int) async_req_3_0(phone, (ipcarg_t) message,
-	    (ipcarg_t) device_id, (ipcarg_t) arg2, (ipcarg_t) service);
+	return (int) async_req_3_0(phone, (sysarg_t) message,
+	    (sysarg_t) device_id, (sysarg_t) arg2, (sysarg_t) service);
 }
 
@@ -103,5 +103,5 @@
 {
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 	int string;
 
@@ -110,6 +110,6 @@
 
 	// request the address
-	message_id = async_send_1(phone, (ipcarg_t) message,
-	    (ipcarg_t) device_id, NULL);
+	message_id = async_send_1(phone, (sysarg_t) message,
+	    (sysarg_t) device_id, NULL);
 	string = measured_strings_return(phone, address, data, 1);
 	async_wait_for(message_id, &result);
@@ -143,11 +143,11 @@
 		return EBADMEM;
 	
-	ipcarg_t addr_len;
-	ipcarg_t prefix;
-	ipcarg_t content;
-	ipcarg_t suffix;
-	
-	ipcarg_t result = async_req_1_4(phone, (ipcarg_t) message,
-	    (ipcarg_t) device_id, &addr_len, &prefix, &content, &suffix);
+	sysarg_t addr_len;
+	sysarg_t prefix;
+	sysarg_t content;
+	sysarg_t suffix;
+	
+	sysarg_t result = async_req_1_4(phone, (sysarg_t) message,
+	    (sysarg_t) device_id, &addr_len, &prefix, &content, &suffix);
 	
 	packet_dimension->prefix = (size_t) prefix;
@@ -175,9 +175,9 @@
 {
 	if (error) {
-		async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
-		    (ipcarg_t) packet_id, (ipcarg_t) target, (ipcarg_t) error);
+		async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
+		    (sysarg_t) packet_id, (sysarg_t) target, (sysarg_t) error);
 	} else {
-		async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
-		    (ipcarg_t) packet_id, (ipcarg_t) target);
+		async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
+		    (sysarg_t) packet_id, (sysarg_t) target);
 	}
 	
@@ -201,9 +201,9 @@
 {
 	if (error) {
-		async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
-		    (ipcarg_t) packet_id, (ipcarg_t) sender, (ipcarg_t) error);
+		async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
+		    (sysarg_t) packet_id, (sysarg_t) sender, (sysarg_t) error);
 	} else {
-		async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
-		    (ipcarg_t) packet_id, (ipcarg_t) sender);
+		async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
+		    (sysarg_t) packet_id, (sysarg_t) sender);
 	}
 	
@@ -237,5 +237,5 @@
 {
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 	int string;
 
@@ -246,6 +246,6 @@
 
 	// request the translation
-	message_id = async_send_3(phone, (ipcarg_t) message,
-	    (ipcarg_t) device_id, (ipcarg_t) count, (ipcarg_t) service, NULL);
+	message_id = async_send_3(phone, (sysarg_t) message,
+	    (sysarg_t) device_id, (sysarg_t) count, (sysarg_t) service, NULL);
 	measured_strings_send(phone, configuration, count);
 	string = measured_strings_return(phone, translation, data, count);
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/net/generic/packet_remote.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -86,5 +86,5 @@
 	}
 	
-	ipcarg_t result;
+	sysarg_t result;
 	async_wait_for(message, &result);
 	
@@ -116,5 +116,5 @@
 	*packet = pm_find(packet_id);
 	if (!*packet) {
-		ipcarg_t size;
+		sysarg_t size;
 		
 		rc = async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id,
@@ -151,6 +151,6 @@
     size_t max_prefix, size_t max_suffix)
 {
-	ipcarg_t packet_id;
-	ipcarg_t size;
+	sysarg_t packet_id;
+	sysarg_t size;
 	int rc;
 	
@@ -182,6 +182,6 @@
 packet_t *packet_get_1_remote(int phone, size_t content)
 {
-	ipcarg_t packet_id;
-	ipcarg_t size;
+	sysarg_t packet_id;
+	sysarg_t size;
 	int rc;
 	
Index: uspace/lib/net/il/arp_remote.c
===================================================================
--- uspace/lib/net/il/arp_remote.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/net/il/arp_remote.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -86,8 +86,8 @@
 {
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 
 	message_id = async_send_2(arp_phone, NET_ARP_CLEAR_ADDRESS,
-	    (ipcarg_t) device_id, protocol, NULL);
+	    (sysarg_t) device_id, protocol, NULL);
 	measured_strings_send(arp_phone, address, 1);
 	async_wait_for(message_id, &result);
@@ -106,5 +106,5 @@
 {
 	return (int) async_req_1_0(arp_phone, NET_ARP_CLEAR_DEVICE,
-	    (ipcarg_t) device_id);
+	    (sysarg_t) device_id);
 }
 
@@ -136,8 +136,8 @@
 {
 	aid_t message_id;
-	ipcarg_t result;
+	sysarg_t result;
 
 	message_id = async_send_3(arp_phone, NET_ARP_DEVICE,
-	    (ipcarg_t) device_id, protocol, netif, NULL);
+	    (sysarg_t) device_id, protocol, netif, NULL);
 	measured_strings_send(arp_phone, address, 1);
 	async_wait_for(message_id, &result);
Index: uspace/lib/net/il/ip_remote.c
===================================================================
--- uspace/lib/net/il/ip_remote.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/net/il/ip_remote.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -67,6 +67,6 @@
 {
 	return (int) async_req_4_0(ip_phone, NET_IP_ADD_ROUTE,
-	    (ipcarg_t) device_id, (ipcarg_t) gateway.s_addr,
-	    (ipcarg_t) address.s_addr, (ipcarg_t) netmask.s_addr);
+	    (sysarg_t) device_id, (sysarg_t) gateway.s_addr,
+	    (sysarg_t) address.s_addr, (sysarg_t) netmask.s_addr);
 }
 
@@ -86,5 +86,5 @@
     async_client_conn_t receiver)
 {
-	return (int) bind_service(service, (ipcarg_t) protocol, me, service,
+	return (int) bind_service(service, (sysarg_t) protocol, me, service,
 	    receiver);
 }
@@ -151,5 +151,5 @@
 	ipc_call_t answer;
 	aid_t message_id = async_send_1(ip_phone, NET_IP_GET_ROUTE,
-	    (ipcarg_t) protocol, &answer);
+	    (sysarg_t) protocol, &answer);
 	
 	if ((async_data_write_start(ip_phone, destination, addrlen) == EOK) &&
@@ -164,5 +164,5 @@
 	}
 	
-	ipcarg_t result;
+	sysarg_t result;
 	async_wait_for(message_id, &result);
 	
@@ -244,5 +244,5 @@
 {
 	return (int) async_req_2_0(ip_phone, NET_IP_SET_GATEWAY,
-	    (ipcarg_t) device_id, (ipcarg_t) gateway.s_addr);
+	    (sysarg_t) device_id, (sysarg_t) gateway.s_addr);
 }
 
Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/net/netif/netif_local.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -366,5 +366,5 @@
 	
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_PHONE_HUNGUP:
 		return EOK;
Index: uspace/lib/net/netif/netif_remote.c
===================================================================
--- uspace/lib/net/netif/netif_remote.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/net/netif/netif_remote.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -144,8 +144,8 @@
 	
 	aid_t message_id = async_send_1(netif_phone, NET_NETIF_STATS,
-	    (ipcarg_t) device_id, NULL);
+	    (sysarg_t) device_id, NULL);
 	async_data_read_start(netif_phone, stats, sizeof(*stats));
 	
-	ipcarg_t result;
+	sysarg_t result;
 	async_wait_for(message_id, &result);
 	
Index: uspace/lib/net/tl/icmp_remote.c
===================================================================
--- uspace/lib/net/tl/icmp_remote.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/net/tl/icmp_remote.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -65,6 +65,6 @@
     icmp_param_t mtu, packet_t *packet)
 {
-	async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (ipcarg_t) code,
-	    (ipcarg_t) packet_get_id(packet), (ipcarg_t) mtu);
+	async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
+	    (sysarg_t) packet_get_id(packet), (sysarg_t) mtu);
 	return EOK;
 }
@@ -85,5 +85,5 @@
 {
 	async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0,
-	    (ipcarg_t) packet_get_id(packet));
+	    (sysarg_t) packet_get_id(packet));
 	return EOK;
 }
@@ -104,6 +104,6 @@
 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet)
 {
-	async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (ipcarg_t) code,
-	    (ipcarg_t) packet_get_id(packet));
+	async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
+	    (sysarg_t) packet_get_id(packet));
 	return EOK;
 }
@@ -126,6 +126,6 @@
     icmp_param_t pointer, packet_t *packet)
 {
-	async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (ipcarg_t) code,
-	    (ipcarg_t) packet_get_id(packet), (ipcarg_t) pointer);
+	async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
+	    (sysarg_t) packet_get_id(packet), (sysarg_t) pointer);
 	return EOK;
 }
Index: uspace/lib/packet/generic/packet_server.c
===================================================================
--- uspace/lib/packet/generic/packet_server.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/lib/packet/generic/packet_server.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -135,6 +135,4 @@
 /** Creates a new packet of dimensions at least as given.
  *
- * Should be used only when the global data are locked.
- *
  * @param[in] length	The total length of the packet, including the header,
  *			the addresses and the data of the packet.
@@ -153,4 +151,6 @@
 	packet_t *packet;
 	int rc;
+
+	assert(fibril_mutex_is_locked(&ps_globals.lock));
 
 	// already locked
@@ -233,6 +233,4 @@
 /** Release the packet and returns it to the appropriate free packet queue.
  *
- * Should be used only when the global data are locked.
- *
  * @param[in] packet	The packet to be released.
  *
@@ -242,4 +240,6 @@
 	int index;
 	int result;
+
+	assert(fibril_mutex_is_locked(&ps_globals.lock));
 
 	for (index = 0; (index < FREE_QUEUES_COUNT - 1) &&
@@ -327,5 +327,5 @@
 
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_PHONE_HUNGUP:
 		return EOK;
@@ -337,6 +337,6 @@
 			return ENOMEM;
 		*answer_count = 2;
-		IPC_SET_ARG1(*answer, (ipcarg_t) packet->packet_id);
-		IPC_SET_ARG2(*answer, (ipcarg_t) packet->length);
+		IPC_SET_ARG1(*answer, (sysarg_t) packet->packet_id);
+		IPC_SET_ARG2(*answer, (sysarg_t) packet->length);
 		return EOK;
 	
@@ -351,6 +351,6 @@
 			return ENOMEM;
 		*answer_count = 2;
-		IPC_SET_ARG1(*answer, (ipcarg_t) packet->packet_id);
-		IPC_SET_ARG2(*answer, (ipcarg_t) packet->length);
+		IPC_SET_ARG1(*answer, (sysarg_t) packet->packet_id);
+		IPC_SET_ARG2(*answer, (sysarg_t) packet->length);
 		return EOK;
 	
@@ -365,5 +365,5 @@
 		if (!packet_is_valid(packet))
 			return ENOENT;
-		IPC_SET_ARG1(*answer, (ipcarg_t) packet->length);
+		IPC_SET_ARG1(*answer, (sysarg_t) packet->length);
 		*answer_count = 1;
 		return EOK;
Index: pace/lib/packet/include/net_byteorder.h
===================================================================
--- uspace/lib/packet/include/net_byteorder.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * 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.
- */
-
-/** @addtogroup net
- *  @{
- */
-
-/** @file
- *  Host - network byte order manipulation functions.
- */
-
-#ifndef __NET_BYTEORDER_H__
-#define __NET_BYTEORDER_H__
-
-#include <byteorder.h>
-#include <sys/types.h>
-
-
-/** Converts the given short number (16 bit) from the host byte order to the network byte order (big endian).
- *  @param[in] number The number in the host byte order to be converted.
- *  @returns The number in the network byte order.
- */
-#define htons(number)		host2uint16_t_be(number)
-
-/** Converts the given long number (32 bit) from the host byte order to the network byte order (big endian).
- *  @param[in] number The number in the host byte order to be converted.
- *  @returns The number in the network byte order.
- */
-#define htonl(number)		host2uint32_t_be(number)
-
-/** Converts the given short number (16 bit) from the network byte order (big endian) to the host byte order.
- *  @param[in] number The number in the network byte order to be converted.
- *  @returns The number in the host byte order.
- */
-#define ntohs(number) 	uint16_t_be2host(number)
-
-/** Converts the given long number (32 bit) from the network byte order (big endian) to the host byte order.
- *  @param[in] number The number in the network byte order to be converted.
- *  @returns The number in the host byte order.
- */
-#define ntohl(number)		uint32_t_be2host(number)
-
-#endif
-
-/** @}
- */
Index: pace/lib/packet/include/net_err.h
===================================================================
--- uspace/lib/packet/include/net_err.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * 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.
- */
-
-/** @addtogroup net
- * @{
- */
-
-/** @file
- * Common error processing codes and routines.
- */
-
-#ifndef __NET_ERR_H__
-#define __NET_ERR_H__
-
-#include <errno.h>
-
-#ifdef CONFIG_DEBUG
-	#include <stdio.h>
-	#include <str_error.h>
-#endif
-
-/** An actual stored error code.
- *
- */
-#define ERROR_CODE  error_check_return_value
-
-/** An error processing routines declaration.
- *
- * This has to be declared in the block where the error processing
- * is desired.
- *
- */
-#define ERROR_DECLARE  int ERROR_CODE
-
-/** Store the value as an error code and checks if an error occurred.
- *
- * @param[in] value The value to be checked. May be a function call.
- * @return False if the value indicates success (EOK).
- * @return True otherwise.
- *
- */
-#ifdef CONFIG_DEBUG
-
-#define ERROR_OCCURRED(value) \
-	(((ERROR_CODE = (value)) != EOK) \
-	&& ({ \
-		fprintf(stderr, "libsocket error at %s:%d (%s)\n", \
-		__FILE__, __LINE__, str_error(ERROR_CODE)); \
-		1; \
-	}))
-
-#else
-
-#define ERROR_OCCURRED(value)  ((ERROR_CODE = (value)) != EOK)
-
-#endif
-
-/** Error propagation
- *
- * Check if an error occurred and immediately exit the actual
- * function returning the error code.
- *
- * @param[in] value The value to be checked. May be a function call.
- *
- */
-
-#define ERROR_PROPAGATE(value) \
-	if (ERROR_OCCURRED(value)) \
-		return ERROR_CODE
-
-#endif
-
-/** @}
- */
Index: pace/lib/packet/include/socket_errno.h
===================================================================
--- uspace/lib/packet/include/socket_errno.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * 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.
- */
-
-/** @addtogroup net
- *  @{
- */
-
-/** @file
- *  Socket error codes.
- *  Based on BSD.
- */
-
-#ifndef __NET_SOCKET_ERR_H__
-#define __NET_SOCKET_ERR_H__
-
-#include <errno.h>
-
-/** @name Socket error codes definitions
- */
-/*@{*/
-
-////#define EINTR			(-10004)
-////#define EBADF			(-10009)
-//#define EACCES			(-10013)
-//#define EFAULT			(-10014)
-////#define EINVAL			(-10022)
-////#define EMFILE			(-10024)
-//#define EWOULDBLOCK		(-10035)
-
-/** An API function is called while another blocking function is in progress.
- */
-#define EINPROGRESS		(-10036)
-
-//#define EALREADY		(-10037)
-
-/** The socket identifier is not valid.
- */
-#define ENOTSOCK		(-10038)
-
-/** The destination address required.
- */
-#define EDESTADDRREQ	(-10039)
-
-//#define EMSGSIZE		(-10040)
-//#define EPROTOTYPE		(-10041)
-//#define ENOPROTOOPT		(-10042)
-
-/** Protocol is not supported.
- */
-#define EPROTONOSUPPORT	(-10043)
-
-/** Socket type is not supported.
- */
-#define ESOCKTNOSUPPORT	(-10044)
-
-//#define EOPNOTSUPP		(-10045)
-
-/** Protocol family is not supported.
- */
-#define EPFNOSUPPORT	(-10046)
-
-/** Address family is not supported.
- */
-#define EAFNOSUPPORT	(-10047)
-
-/** Address is already in use.
- */
-#define EADDRINUSE		(-10048)
-
-//#define EADDRNOTAVAIL	(-10049)
-/* May be reported at any time if the implementation detects an underlying failure.
- */
-//#define ENETDOWN		(-10050)
-//#define ENETUNREACH		(-10051)
-//#define ENETRESET		(-10052)
-//#define ECONNABORTED	(-10053)
-//#define ECONNRESET		(-10054)
-//#define ENOBUFS			(-10055)
-//#define EISCONN			(-10056)
-
-/** The socket is not connected or bound.
- */
-#define ENOTCONN		(-10057)
-
-//#define ESHUTDOWN		(-10058)
-//#define ETOOMANYREFS	(-10059)
-//#define ETIMEDOUT		(-10060)
-//#define ECONNREFUSED	(-10061)
-//#define ELOOP			(-10062)
-////#define ENAMETOOLONG	(-10063)
-//#define EHOSTDOWN		(-10064)
-//#define EHOSTUNREACH	(-10065)
-//#define HOST_NOT_FOUND	(-11001)
-
-/** The requested operation was not performed.
- *  Try again later.
- */
-#define TRY_AGAIN		(-11002)
-
-//#define NO_RECOVERY		(-11003)
-
-/** No data.
- */
-#define NO_DATA			(-11004)
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/srv/bd/ata_bd/ata_bd.c
===================================================================
--- uspace/srv/bd/ata_bd/ata_bd.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/bd/ata_bd/ata_bd.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -229,5 +229,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	devmap_handle_t dh;
 	int flags;
@@ -269,5 +269,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/bd/file_bd/file_bd.c
===================================================================
--- uspace/srv/bd/file_bd/file_bd.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/bd/file_bd/file_bd.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -177,5 +177,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	size_t comm_size;
 	int flags;
@@ -202,5 +202,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/bd/gxe_bd/gxe_bd.c
===================================================================
--- uspace/srv/bd/gxe_bd/gxe_bd.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/bd/gxe_bd/gxe_bd.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -160,5 +160,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	devmap_handle_t dh;
 	int flags;
@@ -205,5 +205,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/bd/part/guid_part/guid_part.c
===================================================================
--- uspace/srv/bd/part/guid_part/guid_part.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/bd/part/guid_part/guid_part.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -315,5 +315,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	devmap_handle_t dh;
 	int flags;
@@ -360,5 +360,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/bd/part/mbr_part/mbr_part.c
===================================================================
--- uspace/srv/bd/part/mbr_part/mbr_part.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/bd/part/mbr_part/mbr_part.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -393,5 +393,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	devmap_handle_t dh;
 	int flags;
@@ -438,5 +438,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/bd/rd/rd.c
===================================================================
--- uspace/srv/bd/rd/rd.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/bd/rd/rd.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -124,5 +124,5 @@
 	while (true) {
 		callid = async_get_call(&call);
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			/*
Index: uspace/srv/clip/clip.c
===================================================================
--- uspace/srv/clip/clip.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/clip/clip.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -118,5 +118,5 @@
 		}
 		
-		ipcarg_t retval = async_data_read_finalize(callid, clip_data, size);
+		sysarg_t retval = async_data_read_finalize(callid, clip_data, size);
 		if (retval != EOK) {
 			ipc_answer_0(rid, retval);
@@ -145,5 +145,5 @@
 	
 	fibril_mutex_unlock(&clip_mtx);
-	ipc_answer_2(rid, EOK, (ipcarg_t) size, (ipcarg_t) tag);
+	ipc_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag);
 }
 
@@ -158,5 +158,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			cont = false;
@@ -183,5 +183,5 @@
 	async_set_client_connection(clip_connection);
 	
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	if (ipc_connect_to_me(PHONE_NS, SERVICE_CLIPBOARD, 0, 0, &phonead) != 0) 
 		return -1;
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/devman/devman.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -62,4 +62,14 @@
 }
 
+static int devmap_devices_class_compare(unsigned long key[], hash_count_t keys,
+    link_t *item)
+{
+	dev_class_info_t *class_info
+	    = hash_table_get_instance(item, dev_class_info_t, devmap_link);
+	assert(class_info != NULL);
+
+	return (class_info->devmap_handle == (devmap_handle_t) key[0]);
+}
+
 static void devices_remove_callback(link_t *item)
 {
@@ -75,4 +85,10 @@
 	.hash = devices_hash,
 	.compare = devmap_devices_compare,
+	.remove_callback = devices_remove_callback
+};
+
+static hash_table_operations_t devmap_devices_class_ops = {
+	.hash = devices_hash,
+	.compare = devmap_devices_class_compare,
 	.remove_callback = devices_remove_callback
 };
@@ -368,4 +384,5 @@
 	printf(NAME ": create_root_node\n");
 
+	fibril_rwlock_write_lock(&tree->rwlock);
 	node = create_dev_node();
 	if (node != NULL) {
@@ -377,4 +394,5 @@
 		tree->root_node = node;
 	}
+	fibril_rwlock_write_unlock(&tree->rwlock);
 
 	return node != NULL;
@@ -439,6 +457,4 @@
 /** Start a driver
  *
- * The driver's mutex is assumed to be locked.
- *
  * @param drv		The driver's structure.
  * @return		True if the driver's task is successfully spawned, false
@@ -449,4 +465,6 @@
 	int rc;
 
+	assert(fibril_mutex_is_locked(&drv->driver_mutex));
+	
 	printf(NAME ": start_driver '%s'\n", drv->name);
 	
@@ -498,5 +516,5 @@
  * @param phone		The phone to the driver.
  */
-void set_driver_phone(driver_t *driver, ipcarg_t phone)
+void set_driver_phone(driver_t *driver, sysarg_t phone)
 {
 	fibril_mutex_lock(&driver->driver_mutex);
@@ -508,6 +526,4 @@
 /** Notify driver about the devices to which it was assigned.
  *
- * The driver's mutex must be locked.
- *
  * @param driver	The driver to which the devices are passed.
  */
@@ -518,18 +534,75 @@
 	int phone;
 
-	printf(NAME ": pass_devices_to_driver\n");
-
-	phone = ipc_connect_me_to(driver->phone, DRIVER_DEVMAN, 0, 0);
-	if (phone > 0) {
-		
+	printf(NAME ": pass_devices_to_driver(`%s')\n", driver->name);
+
+	fibril_mutex_lock(&driver->driver_mutex);
+
+	phone = async_connect_me_to(driver->phone, DRIVER_DEVMAN, 0, 0);
+
+	if (phone < 0) {
+		fibril_mutex_unlock(&driver->driver_mutex);
+		return;
+	}
+
+	/*
+	 * Go through devices list as long as there is some device
+	 * that has not been passed to the driver.
+	 */
+	link = driver->devices.next;
+	while (link != &driver->devices) {
+		dev = list_get_instance(link, node_t, driver_devices);
+		if (dev->passed_to_driver) {
+			link = link->next;
+			continue;
+		}
+
+		/*
+		 * We remove the device from the list to allow safe adding
+		 * of new devices (no one will touch our item this way).
+		 */
+		list_remove(link);
+
+		/*
+		 * Unlock to avoid deadlock when adding device
+		 * handled by itself.
+		 */
+		fibril_mutex_unlock(&driver->driver_mutex);
+
+		add_device(phone, driver, dev, tree);
+
+		/*
+		 * Lock again as we will work with driver's
+		 * structure.
+		 */
+		fibril_mutex_lock(&driver->driver_mutex);
+
+		/*
+		 * Insert the device back.
+		 * The order is not relevant here so no harm is done
+		 * (actually, the order would be preserved in most cases).
+		 */
+		list_append(link, &driver->devices);
+
+		/*
+		 * Restart the cycle to go through all devices again.
+		 */
 		link = driver->devices.next;
-		while (link != &driver->devices) {
-			dev = list_get_instance(link, node_t, driver_devices);
-			add_device(phone, driver, dev, tree);
-			link = link->next;
-		}
-		
-		ipc_hangup(phone);
-	}
+	}
+
+	ipc_hangup(phone);
+
+	/*
+	 * Once we passed all devices to the driver, we need to mark the
+	 * driver as running.
+	 * It is vital to do it here and inside critical section.
+	 *
+	 * If we would change the state earlier, other devices added to
+	 * the driver would be added to the device list and started
+	 * immediately and possibly started here as well.
+	 */
+	printf(NAME ": driver %s goes into running state.\n", driver->name);
+	driver->state = DRIVER_RUNNING;
+
+	fibril_mutex_unlock(&driver->driver_mutex);
 }
 
@@ -545,6 +618,5 @@
 void initialize_running_driver(driver_t *driver, dev_tree_t *tree)
 {
-	printf(NAME ": initialize_running_driver\n");
-	fibril_mutex_lock(&driver->driver_mutex);
+	printf(NAME ": initialize_running_driver (`%s')\n", driver->name);
 	
 	/*
@@ -553,9 +625,4 @@
 	 */
 	pass_devices_to_driver(driver, tree);
-	
-	/* Change driver's state to running. */
-	driver->state = DRIVER_RUNNING;
-	
-	fibril_mutex_unlock(&driver->driver_mutex);
 }
 
@@ -621,5 +688,6 @@
 	}
 	
-	devmap_device_register(devmap_pathname, &node->devmap_handle);
+	devmap_device_register_with_iface(devmap_pathname,
+	    &node->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP);
 	
 	tree_add_devmap_device(tree, node);
@@ -629,5 +697,4 @@
 }
 
-
 /** Pass a device to running driver.
  *
@@ -637,12 +704,24 @@
 void add_device(int phone, driver_t *drv, node_t *node, dev_tree_t *tree)
 {
-	printf(NAME ": add_device\n");
-	
-	ipcarg_t rc;
+	/*
+	 * We do not expect to have driver's mutex locked as we do not
+	 * access any structures that would affect driver_t.
+	 */
+	printf(NAME ": add_device (driver `%s', device `%s')\n", drv->name,
+	    node->name);
+	
+	sysarg_t rc;
 	ipc_call_t answer;
 	
 	/* Send the device to the driver. */
-	aid_t req = async_send_1(phone, DRIVER_ADD_DEVICE, node->handle,
-	    &answer);
+	devman_handle_t parent_handle;
+	if (node->parent) {
+		parent_handle = node->parent->handle;
+	} else {
+		parent_handle = 0;
+	}
+
+	aid_t req = async_send_2(phone, DRIVER_ADD_DEVICE, node->handle,
+	    parent_handle, &answer);
 	
 	/* Send the device's name to the driver. */
@@ -652,7 +731,8 @@
 		/* TODO handle error */
 	}
-	
+
 	/* Wait for answer from the driver. */
 	async_wait_for(req, &rc);
+
 	switch(rc) {
 	case EOK:
@@ -667,4 +747,6 @@
 	}
 	
+	node->passed_to_driver = true;
+
 	return;
 }
@@ -692,12 +774,15 @@
 	attach_driver(node, drv);
 	
+	fibril_mutex_lock(&drv->driver_mutex);
 	if (drv->state == DRIVER_NOT_STARTED) {
 		/* Start the driver. */
 		start_driver(drv);
 	}
-	
-	if (drv->state == DRIVER_RUNNING) {
+	bool is_running = drv->state == DRIVER_RUNNING;
+	fibril_mutex_unlock(&drv->driver_mutex);
+
+	if (is_running) {
 		/* Notify the driver about the new device. */
-		int phone = ipc_connect_me_to(drv->phone, DRIVER_DEVMAN, 0, 0);
+		int phone = async_connect_me_to(drv->phone, DRIVER_DEVMAN, 0, 0);
 		if (phone > 0) {
 			add_device(phone, drv, node, tree);
@@ -776,6 +861,4 @@
 /** Find the device node structure of the device witch has the specified handle.
  *
- * Device tree's rwlock should be held at least for reading.
- *
  * @param tree		The device tree where we look for the device node.
  * @param handle	The handle of the device.
@@ -785,5 +868,9 @@
 {
 	unsigned long key = handle;
-	link_t *link = hash_table_find(&tree->devman_devices, &key);
+	link_t *link;
+	
+	assert(fibril_rwlock_is_locked(&tree->rwlock));
+	
+	link = hash_table_find(&tree->devman_devices, &key);
 	return hash_table_get_instance(link, node_t, devman_link);
 }
@@ -841,7 +928,4 @@
 /** Insert new device into device tree.
  *
- * The device tree's rwlock should be already held exclusively when calling this
- * function.
- *
  * @param tree		The device tree.
  * @param node		The newly added device node. 
@@ -858,8 +942,8 @@
 	assert(tree != NULL);
 	assert(dev_name != NULL);
+	assert(fibril_rwlock_is_write_locked(&tree->rwlock));
 	
 	node->name = dev_name;
 	if (!set_dev_path(node, parent)) {
-		fibril_rwlock_write_unlock(&tree->rwlock);
 		return false;
 	}
@@ -977,6 +1061,10 @@
 	
 	info = (dev_class_info_t *) malloc(sizeof(dev_class_info_t));
-	if (info != NULL)
+	if (info != NULL) {
 		memset(info, 0, sizeof(dev_class_info_t));
+		list_initialize(&info->dev_classes);
+		list_initialize(&info->devmap_link);
+		list_initialize(&info->link);
+	}
 	
 	return info;
@@ -1083,6 +1171,8 @@
 	while (link != &class_list->classes) {
 		cl = list_get_instance(link, dev_class_t, link);
-		if (str_cmp(cl->name, class_name) == 0)
+		if (str_cmp(cl->name, class_name) == 0) {
 			return cl;
+		}
+		link = link->next;
 	}
 	
@@ -1100,5 +1190,5 @@
 	fibril_rwlock_initialize(&class_list->rwlock);
 	hash_table_create(&class_list->devmap_devices, DEVICE_BUCKETS, 1,
-	    &devmap_devices_ops);
+	    &devmap_devices_class_ops);
 }
 
@@ -1148,4 +1238,6 @@
 	hash_table_insert(&class_list->devmap_devices, &key, &cli->devmap_link);
 	fibril_rwlock_write_unlock(&class_list->rwlock);
+
+	assert(find_devmap_class_device(class_list, cli->devmap_handle) != NULL);
 }
 
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/devman/devman.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -86,5 +86,5 @@
 	
 	/** Phone asociated with this driver. */
-	ipcarg_t phone;
+	sysarg_t phone;
 	/** Name of the device driver. */
 	char *name;
@@ -168,4 +168,9 @@
 	 */
 	link_t devmap_link;
+
+	/**
+	 * Whether this device was already passed to the driver.
+	 */
+	bool passed_to_driver;
 };
 
@@ -297,5 +302,5 @@
 
 extern driver_t *find_driver(driver_list_t *, const char *);
-extern void set_driver_phone(driver_t *, ipcarg_t);
+extern void set_driver_phone(driver_t *, sysarg_t);
 extern void initialize_running_driver(driver_t *, dev_tree_t *);
 
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/devman/main.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -74,5 +74,5 @@
 	
 	iid = async_get_call(&icall);
-	if (IPC_GET_METHOD(icall) != DEVMAN_DRIVER_REGISTER) {
+	if (IPC_GET_IMETHOD(icall) != DEVMAN_DRIVER_REGISTER) {
 		ipc_answer_0(iid, EREFUSED);
 		return NULL;
@@ -109,5 +109,5 @@
 	ipc_call_t call;
 	ipc_callid_t callid = async_get_call(&call);
-	if (IPC_GET_METHOD(call) != IPC_M_CONNECT_TO_ME) {
+	if (IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) {
 		ipc_answer_0(callid, ENOTSUP);
 		ipc_answer_0(iid, ENOTSUP);
@@ -141,5 +141,5 @@
 	
 	callid = async_get_call(&call);
-	if (DEVMAN_ADD_MATCH_ID != IPC_GET_METHOD(call)) {
+	if (DEVMAN_ADD_MATCH_ID != IPC_GET_IMETHOD(call)) {
 		printf(NAME ": ERROR: devman_receive_match_id - invalid "
 		    "protocol.\n");
@@ -184,5 +184,5 @@
  * @return		Zero on success, negative error code otherwise.
  */
-static int devman_receive_match_ids(ipcarg_t match_count,
+static int devman_receive_match_ids(sysarg_t match_count,
     match_id_list_t *match_ids)
 {
@@ -197,4 +197,11 @@
 }
 
+static int assign_driver_fibril(void *arg)
+{
+	node_t *node = (node_t *) arg;
+	assign_driver(node, &drivers_list, &device_tree);
+	return EOK;
+}
+
 /** Handle child device registration.
  *
@@ -204,5 +211,5 @@
 {
 	devman_handle_t parent_handle = IPC_GET_ARG1(*call);
-	ipcarg_t match_count = IPC_GET_ARG2(*call);
+	sysarg_t match_count = IPC_GET_ARG2(*call);
 	dev_tree_t *tree = &device_tree;
 	
@@ -237,10 +244,25 @@
 	
 	devman_receive_match_ids(match_count, &node->match_ids);
-	
+
+	/*
+	 * Try to find a suitable driver and assign it to the device.  We do
+	 * not want to block the current fibril that is used for processing
+	 * incoming calls: we will launch a separate fibril to handle the
+	 * driver assigning. That is because assign_driver can actually include
+	 * task spawning which could take some time.
+	 */
+	fid_t assign_fibril = fibril_create(assign_driver_fibril, node);
+	if (assign_fibril == 0) {
+		/*
+		 * Fallback in case we are out of memory.
+		 * Probably not needed as we will die soon anyway ;-).
+		 */
+		(void) assign_driver_fibril(node);
+	} else {
+		fibril_add_ready(assign_fibril);
+	}
+
 	/* Return device handle to parent's driver. */
 	ipc_answer_1(callid, EOK, node->handle);
-	
-	/* Try to find suitable driver and assign it to the device. */
-	assign_driver(node, &drivers_list, &device_tree);
 }
 
@@ -259,5 +281,6 @@
 	 * handle.
 	 */
-	devmap_device_register(devmap_pathname, &cli->devmap_handle);
+	devmap_device_register_with_iface(devmap_pathname,
+	    &cli->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP);
 	
 	/*
@@ -297,5 +320,5 @@
 	printf(NAME ": device '%s' added to class '%s', class name '%s' was "
 	    "asigned to it\n", dev->pathname, class_name, class_info->dev_name);
-	
+
 	ipc_answer_0(callid, EOK);
 }
@@ -345,5 +368,5 @@
 		callid = async_get_call(&call);
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			cont = false;
@@ -398,5 +421,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			cont = false;
@@ -464,5 +487,5 @@
 static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall)
 {
-	devmap_handle_t devmap_handle = IPC_GET_METHOD(*icall);
+	devmap_handle_t devmap_handle = IPC_GET_ARG2(*icall);
 	node_t *dev;
 
@@ -481,8 +504,8 @@
 	}
 	
-	printf(NAME ": devman_connection_devmapper: forward connection to "
-	    "device %s to driver %s.\n", dev->pathname, dev->drv->name);
 	ipc_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0,
 	    IPC_FF_NONE);
+	printf(NAME ": devman_connection_devmapper: forwarded connection to "
+	    "device %s to driver %s.\n", dev->pathname, dev->drv->name);
 }
 
@@ -490,24 +513,6 @@
 static void devman_connection(ipc_callid_t iid, ipc_call_t *icall)
 {
-	/*
-	 * Silly hack to enable the device manager to register as a driver by
-	 * the device mapper. If the ipc method is not IPC_M_CONNECT_ME_TO, this
-	 * is not the forwarded connection from naming service, so it must be a
-	 * connection from the devmapper which thinks this is a devmapper-style
-	 * driver. So pretend this is a devmapper-style driver. (This does not
-	 * work for device with handle == IPC_M_CONNECT_ME_TO, because devmapper
-	 * passes device handle to the driver as an ipc method.)
-	 */
-	if (IPC_GET_METHOD(*icall) != IPC_M_CONNECT_ME_TO)
-		devman_connection_devmapper(iid, icall);
-
-	/*
-	 * ipc method is IPC_M_CONNECT_ME_TO, so this is forwarded connection
-	 * from naming service by which we registered as device manager, so be
-	 * device manager.
-	 */
-	
 	/* Select interface. */
-	switch ((ipcarg_t) (IPC_GET_ARG1(*icall))) {
+	switch ((sysarg_t) (IPC_GET_ARG1(*icall))) {
 	case DEVMAN_DRIVER:
 		devman_connection_driver(iid, icall);
@@ -520,4 +525,8 @@
 		devman_forward(iid, icall, false);
 		break;
+	case DEVMAN_CONNECT_FROM_DEVMAP:
+		/* Someone connected through devmap node. */
+		devman_connection_devmapper(iid, icall);
+		break;
 	case DEVMAN_CONNECT_TO_PARENTS_DEVICE:
 		/* Connect client to selected device. */
@@ -577,5 +586,5 @@
 
 	/* Register device manager at naming service. */
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAN, 0, 0, &phonead) != 0)
 		return -1;
Index: uspace/srv/devman/match.c
===================================================================
--- uspace/srv/devman/match.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/devman/match.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -35,4 +35,26 @@
 #include "devman.h"
 
+/** Compute compound score of driver and device.
+ *
+ * @param driver Match id of the driver.
+ * @param device Match id of the device.
+ * @return Compound score.
+ * @retval 0 No match at all.
+ */
+static int compute_match_score(match_id_t *driver, match_id_t *device)
+{
+	if (str_cmp(driver->id, device->id) == 0) {
+		/*
+		 * The strings match, return the product of their scores.
+		 */
+		return driver->score * device->score;
+	} else {
+		/*
+		 * Different strings, return zero.
+		 */
+		return 0;
+	}
+}
+
 int get_match_score(driver_t *drv, node_t *dev)
 {
@@ -43,63 +65,28 @@
 		return 0;
 	
+	/*
+	 * Go through all pairs, return the highest score obtained.
+	 */
+	int highest_score = 0;
+	
 	link_t *drv_link = drv->match_ids.ids.next;
-	link_t *dev_link = dev->match_ids.ids.next;
-	
-	match_id_t *drv_id = list_get_instance(drv_link, match_id_t, link);
-	match_id_t *dev_id = list_get_instance(dev_link, match_id_t, link);
-	
-	int score_next_drv = 0;
-	int score_next_dev = 0;
-	
-	do {
-		match_id_t *tmp_ma_id;
-	
-		if (str_cmp(drv_id->id, dev_id->id) == 0) {
-		 	/*
-		 	 * We found a match.
-		 	 * Return the score of the match.
-		 	 */
-			return drv_id->score * dev_id->score;
+	while (drv_link != drv_head) {
+		link_t *dev_link = dev_head->next;
+		while (dev_link != dev_head) {
+			match_id_t *drv_id = list_get_instance(drv_link, match_id_t, link);
+			match_id_t *dev_id = list_get_instance(dev_link, match_id_t, link);
+			
+			int score = compute_match_score(drv_id, dev_id);
+			if (score > highest_score) {
+				highest_score = score;
+			}
+
+			dev_link = dev_link->next;
 		}
 		
-		/*
-		 * Compute the next score we get, if we advance in the driver's
-		 * list of match ids.
-		 */
-		if (drv_link->next != drv_head) {
-			tmp_ma_id = list_get_instance(drv_link->next,
-			    match_id_t, link);
-			score_next_drv = dev_id->score * tmp_ma_id->score;
-		} else {
-			score_next_drv = 0;
-		}
-		
-		/*
-		 * Compute the next score we get, if we advance in the device's
-		 * list of match ids.
-		 */
-		if (dev_link->next != dev_head) {
-			tmp_ma_id = list_get_instance(dev_link->next,
-			    match_id_t, link);
-			score_next_dev = drv_id->score * tmp_ma_id->score;
-		} else {
-			score_next_dev = 0;
-		}
-		
-		/*
-		 * Advance in one of the two lists, so we get the next highest
-		 * score.
-		 */
-		if (score_next_drv > score_next_dev) {
-			drv_link = drv_link->next;
-			drv_id = list_get_instance(drv_link, match_id_t, link);
-		} else {
-			dev_link = dev_link->next;
-			dev_id = list_get_instance(dev_link, match_id_t, link);
-		}
-		
-	} while (drv_link->next != drv_head && dev_link->next != dev_head);
+		drv_link = drv_link->next;
+	}
 	
-	return 0;
+	return highest_score;
 }
 
Index: uspace/srv/devmap/devmap.c
===================================================================
--- uspace/srv/devmap/devmap.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/devmap/devmap.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -46,4 +46,5 @@
 #include <str.h>
 #include <ipc/devmap.h>
+#include <assert.h>
 
 #define NAME          "devmap"
@@ -61,5 +62,5 @@
 	link_t devices;
 	/** Phone asociated with this driver */
-	ipcarg_t phone;
+	sysarg_t phone;
 	/** Device driver name */
 	char *name;
@@ -99,4 +100,6 @@
 	/** Device driver handling this device */
 	devmap_driver_t *driver;
+	/** Use this interface when forwarding to driver. */
+	sysarg_t forward_interface;
 } devmap_device_t;
 
@@ -206,13 +209,11 @@
 }
 
-/** Find namespace with given name.
- *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
- */
+/** Find namespace with given name. */
 static devmap_namespace_t *devmap_namespace_find_name(const char *name)
 {
 	link_t *item;
+	
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+	
 	for (item = namespaces_list.next; item != &namespaces_list; item = item->next) {
 		devmap_namespace_t *namespace =
@@ -227,7 +228,4 @@
 /** Find namespace with given handle.
  *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
  * @todo: use hash table
  *
@@ -236,4 +234,7 @@
 {
 	link_t *item;
+	
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+	
 	for (item = namespaces_list.next; item != &namespaces_list; item = item->next) {
 		devmap_namespace_t *namespace =
@@ -246,14 +247,12 @@
 }
 
-/** Find device with given name.
- *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
- */
+/** Find device with given name. */
 static devmap_device_t *devmap_device_find_name(const char *ns_name,
     const char *name)
 {
 	link_t *item;
+	
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+	
 	for (item = devices_list.next; item != &devices_list; item = item->next) {
 		devmap_device_t *device =
@@ -269,7 +268,4 @@
 /** Find device with given handle.
  *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
  * @todo: use hash table
  *
@@ -278,4 +274,7 @@
 {
 	link_t *item;
+	
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+	
 	for (item = devices_list.next; item != &devices_list; item = item->next) {
 		devmap_device_t *device =
@@ -288,13 +287,12 @@
 }
 
-/** Create a namespace (if not already present)
- *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
- */
+/** Create a namespace (if not already present). */
 static devmap_namespace_t *devmap_namespace_create(const char *ns_name)
 {
-	devmap_namespace_t *namespace = devmap_namespace_find_name(ns_name);
+	devmap_namespace_t *namespace;
+	
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+	
+	namespace = devmap_namespace_find_name(ns_name);
 	if (namespace != NULL)
 		return namespace;
@@ -321,12 +319,9 @@
 }
 
-/** Destroy a namespace (if it is no longer needed)
- *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
- */
+/** Destroy a namespace (if it is no longer needed). */
 static void devmap_namespace_destroy(devmap_namespace_t *namespace)
 {
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+
 	if (namespace->refcnt == 0) {
 		list_remove(&(namespace->namespaces));
@@ -337,37 +332,28 @@
 }
 
-/** Increase namespace reference count by including device
- *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
- */
+/** Increase namespace reference count by including device. */
 static void devmap_namespace_addref(devmap_namespace_t *namespace,
     devmap_device_t *device)
 {
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+
 	device->namespace = namespace;
 	namespace->refcnt++;
 }
 
-/** Decrease namespace reference count
- *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
- */
+/** Decrease namespace reference count. */
 static void devmap_namespace_delref(devmap_namespace_t *namespace)
 {
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+
 	namespace->refcnt--;
 	devmap_namespace_destroy(namespace);
 }
 
-/** Unregister device and free it
- *
- * The devices_list_mutex should be already held when
- * calling this function.
- *
- */
+/** Unregister device and free it. */
 static void devmap_device_unregister_core(devmap_device_t *device)
 {
+	assert(fibril_mutex_is_locked(&devices_list_mutex));
+
 	devmap_namespace_delref(device->namespace);
 	list_remove(&(device->devices));
@@ -387,5 +373,5 @@
 	ipc_callid_t iid = async_get_call(&icall);
 	
-	if (IPC_GET_METHOD(icall) != DEVMAP_DRIVER_REGISTER) {
+	if (IPC_GET_IMETHOD(icall) != DEVMAP_DRIVER_REGISTER) {
 		ipc_answer_0(iid, EREFUSED);
 		return NULL;
@@ -416,5 +402,5 @@
 	ipc_callid_t callid = async_get_call(&call);
 	
-	if (IPC_GET_METHOD(call) != IPC_M_CONNECT_TO_ME) {
+	if (IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) {
 		free(driver->name);
 		free(driver);
@@ -517,4 +503,7 @@
 	}
 	
+	/* Set the interface, if any. */
+	device->forward_interface = IPC_GET_ARG1(*icall);
+
 	/* Get fqdn */
 	char *fqdn;
@@ -566,5 +555,5 @@
 	/* Get unique device handle */
 	device->handle = devmap_create_handle();
-	
+
 	devmap_namespace_addref(namespace, device);
 	device->driver = driver;
@@ -617,6 +606,13 @@
 	}
 	
-	ipc_forward_fast(callid, dev->driver->phone, dev->handle,
-	    IPC_GET_ARG3(*call), 0, IPC_FF_NONE);
+	if (dev->forward_interface == 0) {
+		ipc_forward_fast(callid, dev->driver->phone,
+		    dev->handle, 0, 0,
+		    IPC_FF_NONE);
+	} else {
+		ipc_forward_fast(callid, dev->driver->phone,
+		    dev->forward_interface, dev->handle, 0,
+		    IPC_FF_NONE);
+	}
 	
 	fibril_mutex_unlock(&devices_list_mutex);
@@ -823,5 +819,5 @@
 	}
 	
-	ipcarg_t retval = async_data_read_finalize(callid, desc, size);
+	sysarg_t retval = async_data_read_finalize(callid, desc, size);
 	
 	free(desc);
@@ -890,5 +886,5 @@
 	}
 	
-	ipcarg_t retval = async_data_read_finalize(callid, desc, size);
+	sysarg_t retval = async_data_read_finalize(callid, desc, size);
 	
 	free(desc);
@@ -964,10 +960,10 @@
 	fibril_mutex_unlock(&null_devices_mutex);
 	
-	ipc_answer_1(iid, EOK, (ipcarg_t) i);
+	ipc_answer_1(iid, EOK, (sysarg_t) i);
 }
 
 static void devmap_null_destroy(ipc_callid_t iid, ipc_call_t *icall)
 {
-	ipcarg_t i = IPC_GET_ARG1(*icall);
+	sysarg_t i = IPC_GET_ARG1(*icall);
 	if (i >= NULL_DEVICES) {
 		ipc_answer_0(iid, ELIMIT);
@@ -1027,5 +1023,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			cont = false;
@@ -1078,5 +1074,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			cont = false;
@@ -1121,5 +1117,5 @@
 {
 	/* Select interface */
-	switch ((ipcarg_t) (IPC_GET_ARG1(*icall))) {
+	switch ((sysarg_t) (IPC_GET_ARG1(*icall))) {
 	case DEVMAP_DRIVER:
 		devmap_connection_driver(iid, icall);
@@ -1154,5 +1150,5 @@
 	
 	/* Register device mapper at naming service */
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAP, 0, 0, &phonead) != 0) 
 		return -1;
Index: uspace/srv/fs/devfs/devfs.c
===================================================================
--- uspace/srv/fs/devfs/devfs.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/fs/devfs/devfs.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -68,5 +68,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 		
-		switch  (IPC_GET_METHOD(call)) {
+		switch  (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			return;
Index: uspace/srv/fs/devfs/devfs_ops.c
===================================================================
--- uspace/srv/fs/devfs/devfs_ops.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/fs/devfs/devfs_ops.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -420,5 +420,5 @@
 	
 	/* Accept the mount options */
-	ipcarg_t retval = async_data_write_accept((void **) &opts, true, 0, 0,
+	sysarg_t retval = async_data_write_accept((void **) &opts, true, 0, 0,
 	    0, NULL);
 	if (retval != EOK) {
@@ -575,5 +575,5 @@
 		/* Make a request at the driver */
 		ipc_call_t answer;
-		aid_t msg = async_send_3(dev->phone, IPC_GET_METHOD(*request),
+		aid_t msg = async_send_3(dev->phone, IPC_GET_IMETHOD(*request),
 		    IPC_GET_ARG1(*request), IPC_GET_ARG2(*request),
 		    IPC_GET_ARG3(*request), &answer);
@@ -584,5 +584,5 @@
 		
 		/* Wait for reply from the driver. */
-		ipcarg_t rc;
+		sysarg_t rc;
 		async_wait_for(msg, &rc);
 		size_t bytes = IPC_GET_ARG1(answer);
@@ -638,5 +638,5 @@
 		/* Make a request at the driver */
 		ipc_call_t answer;
-		aid_t msg = async_send_3(dev->phone, IPC_GET_METHOD(*request),
+		aid_t msg = async_send_3(dev->phone, IPC_GET_IMETHOD(*request),
 		    IPC_GET_ARG1(*request), IPC_GET_ARG2(*request),
 		    IPC_GET_ARG3(*request), &answer);
@@ -648,5 +648,5 @@
 		
 		/* Wait for reply from the driver. */
-		ipcarg_t rc;
+		sysarg_t rc;
 		async_wait_for(msg, &rc);
 		size_t bytes = IPC_GET_ARG1(answer);
@@ -746,5 +746,5 @@
 		/* Make a request at the driver */
 		ipc_call_t answer;
-		aid_t msg = async_send_2(dev->phone, IPC_GET_METHOD(*request),
+		aid_t msg = async_send_2(dev->phone, IPC_GET_IMETHOD(*request),
 		    IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), &answer);
 		
@@ -752,5 +752,5 @@
 		
 		/* Wait for reply from the driver */
-		ipcarg_t rc;
+		sysarg_t rc;
 		async_wait_for(msg, &rc);
 		
Index: uspace/srv/fs/fat/fat.c
===================================================================
--- uspace/srv/fs/fat/fat.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/fs/fat/fat.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -93,5 +93,5 @@
 	
 		callid = async_get_call(&call);
-		switch  (IPC_GET_METHOD(call)) {
+		switch  (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			return;
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -1257,5 +1257,5 @@
 
 	rc = fat_node_put(fn);
-	ipc_answer_1(rid, rc, (ipcarg_t)bytes);
+	ipc_answer_1(rid, rc, (sysarg_t)bytes);
 }
 
Index: uspace/srv/fs/tmpfs/tmpfs.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/fs/tmpfs/tmpfs.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -99,5 +99,5 @@
 	
 		callid = async_get_call(&call);
-		switch  (IPC_GET_METHOD(call)) {
+		switch  (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			return;
Index: uspace/srv/hid/adb_mouse/adb_dev.c
===================================================================
--- uspace/srv/hid/adb_mouse/adb_dev.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/adb_mouse/adb_dev.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -68,5 +68,5 @@
 
 	/* NB: The callback connection is slotted for removal */
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &phonehash) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
@@ -89,5 +89,5 @@
 		int retval;
 
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			/* TODO: Handle hangup */
Index: uspace/srv/hid/adb_mouse/adb_mouse.c
===================================================================
--- uspace/srv/hid/adb_mouse/adb_mouse.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/adb_mouse/adb_mouse.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -102,5 +102,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			if (client_phone != -1) {
Index: uspace/srv/hid/char_mouse/char_mouse.c
===================================================================
--- uspace/srv/hid/char_mouse/char_mouse.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/char_mouse/char_mouse.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -87,5 +87,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			if (client_phone != -1) {
Index: uspace/srv/hid/char_mouse/chardev.c
===================================================================
--- uspace/srv/hid/char_mouse/chardev.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/char_mouse/chardev.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -70,5 +70,5 @@
 
 	/* NB: The callback connection is slotted for removal */
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &phonehash) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
@@ -104,5 +104,5 @@
 		int retval;
 
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			/* TODO: Handle hangup */
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/console/console.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -74,7 +74,7 @@
 struct {
 	int phone;           /**< Framebuffer phone */
-	ipcarg_t cols;       /**< Framebuffer columns */
-	ipcarg_t rows;       /**< Framebuffer rows */
-	ipcarg_t color_cap;  /**< Color capabilities (FB_CCAP_xxx) */
+	sysarg_t cols;       /**< Framebuffer columns */
+	sysarg_t rows;       /**< Framebuffer rows */
+	sysarg_t color_cap;  /**< Color capabilities (FB_CCAP_xxx) */
 } fb_info;
 
@@ -101,7 +101,7 @@
 /** Information on row-span yet unsent to FB driver. */
 struct {
-	ipcarg_t col;  /**< Leftmost column of the span. */
-	ipcarg_t row;  /**< Row where the span lies. */
-	ipcarg_t cnt;  /**< Width of the span. */
+	sysarg_t col;  /**< Leftmost column of the span. */
+	sysarg_t row;  /**< Row where the span lies. */
+	sysarg_t cnt;  /**< Width of the span. */
 } fb_pending;
 
@@ -119,5 +119,5 @@
 }
 
-static void curs_goto(ipcarg_t x, ipcarg_t y)
+static void curs_goto(sysarg_t x, sysarg_t y)
 {
 	async_msg_2(fb_info.phone, FB_CURSOR_GOTO, x, y);
@@ -180,5 +180,5 @@
 }
 
-static int ccap_fb_to_con(ipcarg_t ccap_fb, ipcarg_t *ccap_con)
+static int ccap_fb_to_con(sysarg_t ccap_fb, sysarg_t *ccap_con)
 {
 	switch (ccap_fb) {
@@ -203,9 +203,9 @@
 
 /** Send an area of screenbuffer to the FB driver. */
-static void fb_update_area(console_t *cons, ipcarg_t x0, ipcarg_t y0, ipcarg_t width, ipcarg_t height)
+static void fb_update_area(console_t *cons, sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height)
 {
 	if (interbuffer) {
-		ipcarg_t x;
-		ipcarg_t y;
+		sysarg_t x;
+		sysarg_t y;
 		
 		for (y = 0; y < height; y++) {
@@ -237,5 +237,5 @@
  *
  */
-static void cell_mark_changed(ipcarg_t col, ipcarg_t row)
+static void cell_mark_changed(sysarg_t col, sysarg_t row)
 {
 	if (fb_pending.cnt != 0) {
@@ -255,5 +255,5 @@
 
 /** Print a character to the active VC with buffering. */
-static void fb_putchar(wchar_t c, ipcarg_t col, ipcarg_t row)
+static void fb_putchar(wchar_t c, sysarg_t col, sysarg_t row)
 {
 	async_msg_3(fb_info.phone, FB_PUTCHAR, c, col, row);
@@ -352,6 +352,6 @@
 		curs_visibility(false);
 		
-		ipcarg_t x;
-		ipcarg_t y;
+		sysarg_t x;
+		sysarg_t y;
 		int rc = 0;
 		
@@ -408,5 +408,5 @@
 		console_event_t ev;
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			/* TODO: Handle hangup */
@@ -451,5 +451,5 @@
 		int retval;
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			/* TODO: Handle hangup */
@@ -584,7 +584,7 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t arg1;
-	ipcarg_t arg2;
-	ipcarg_t arg3;
+	sysarg_t arg1;
+	sysarg_t arg2;
+	sysarg_t arg3;
 	
 	int rc;
@@ -608,5 +608,5 @@
 		arg3 = 0;
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			cons->refcount--;
@@ -726,5 +726,5 @@
 	
 	/* NB: The callback connection is slotted for removal */
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) {
 		printf(NAME ": Failed to create callback from input device\n");
Index: uspace/srv/hid/console/gcons.c
===================================================================
--- uspace/srv/hid/console/gcons.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/console/gcons.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -82,6 +82,6 @@
 
 static bool use_gcons = false;
-static ipcarg_t xres;
-static ipcarg_t yres;
+static sysarg_t xres;
+static sysarg_t yres;
 
 enum butstate {
@@ -107,10 +107,10 @@
 static size_t active_console = 0;
 
-static ipcarg_t mouse_x = 0;
-static ipcarg_t mouse_y= 0;
+static sysarg_t mouse_x = 0;
+static sysarg_t mouse_y= 0;
 
 static bool btn_pressed = false;
-static ipcarg_t btn_x = 0;
-static ipcarg_t btn_y = 0;
+static sysarg_t btn_x = 0;
+static sysarg_t btn_y = 0;
 
 static void vp_switch(int vp)
@@ -120,5 +120,5 @@
 
 /** Create view port */
-static int vp_create(ipcarg_t x, ipcarg_t y, ipcarg_t width, ipcarg_t height)
+static int vp_create(sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height)
 {
 	return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y,
@@ -137,5 +137,5 @@
 
 /** Transparent putchar */
-static void tran_putch(wchar_t ch, ipcarg_t col, ipcarg_t row)
+static void tran_putch(wchar_t ch, sysarg_t col, sysarg_t row)
 {
 	async_msg_3(fbphone, FB_PUTCHAR, ch, col, row);
@@ -297,7 +297,7 @@
 }
 
-static int gcons_find_conbut(ipcarg_t x, ipcarg_t y)
-{
-	ipcarg_t status_start = STATUS_START + (xres - 800) / 2;
+static int gcons_find_conbut(sysarg_t x, sysarg_t y)
+{
+	sysarg_t status_start = STATUS_START + (xres - 800) / 2;
 	
 	if ((y < STATUS_TOP) || (y >= STATUS_TOP + STATUS_HEIGHT))
@@ -313,5 +313,5 @@
 		return -1;
 	
-	ipcarg_t btn = (x - status_start) / (STATUS_WIDTH + STATUS_SPACE);
+	sysarg_t btn = (x - status_start) / (STATUS_WIDTH + STATUS_SPACE);
 	
 	if (btn < CONSOLE_COUNT)
@@ -363,5 +363,5 @@
  *
  */
-static void draw_pixmap(char *logo, size_t size, ipcarg_t x, ipcarg_t y)
+static void draw_pixmap(char *logo, size_t size, sysarg_t x, sysarg_t y)
 {
 	/* Create area */
@@ -374,5 +374,5 @@
 	
 	/* Send area */
-	int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
+	int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
 	if (rc)
 		goto exit;
@@ -436,5 +436,5 @@
 	
 	/* Send area */
-	int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
+	int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
 	if (rc)
 		goto exit;
@@ -513,5 +513,5 @@
 	
 	/* Create status buttons */
-	ipcarg_t status_start = STATUS_START + (xres - 800) / 2;
+	sysarg_t status_start = STATUS_START + (xres - 800) / 2;
 	size_t i;
 	for (i = 0; i < CONSOLE_COUNT; i++) {
Index: uspace/srv/hid/fb/ega.c
===================================================================
--- uspace/srv/hid/fb/ega.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/fb/ega.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -230,5 +230,5 @@
 static int save_screen(void)
 {
-	ipcarg_t i;
+	sysarg_t i;
 	
 	/* Find empty screen */
@@ -245,5 +245,5 @@
 }
 
-static int print_screen(ipcarg_t i)
+static int print_screen(sysarg_t i)
 {
 	if ((i >= MAX_SAVED_SCREENS) || (saved_screens[i].data))
@@ -276,8 +276,8 @@
 		wchar_t c;
 		
-		ipcarg_t col;
-		ipcarg_t row;
-		ipcarg_t w;
-		ipcarg_t h;
+		sysarg_t col;
+		sysarg_t row;
+		sysarg_t w;
+		sysarg_t h;
 		
 		ssize_t rows;
@@ -290,8 +290,8 @@
 		uint32_t bg_rgb;
 		
-		ipcarg_t scr;
+		sysarg_t scr;
 		int retval;
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			client_connected = 0;
@@ -370,10 +370,10 @@
 			
 			if (rows >= 0) {
-				if ((ipcarg_t) rows > scr_height) {
+				if ((sysarg_t) rows > scr_height) {
 					retval = EINVAL;
 					break;
 				}
 			} else {
-				if ((ipcarg_t) (-rows) > scr_height) {
+				if ((sysarg_t) (-rows) > scr_height) {
 					retval = EINVAL;
 					break;
Index: uspace/srv/hid/fb/fb.c
===================================================================
--- uspace/srv/hid/fb/fb.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/fb/fb.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -199,9 +199,9 @@
 static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a);
 static int rgb_from_style(attr_rgb_t *rgb, int style);
-static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color,
-    ipcarg_t bg_color, ipcarg_t flags);
-
-static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,
-    ipcarg_t bg_color, ipcarg_t attr);
+static int rgb_from_idx(attr_rgb_t *rgb, sysarg_t fg_color,
+    sysarg_t bg_color, sysarg_t flags);
+
+static int fb_set_color(viewport_t *vport, sysarg_t fg_color,
+    sysarg_t bg_color, sysarg_t attr);
 
 static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor,
@@ -1072,5 +1072,5 @@
 	
 	static unsigned char *shm = NULL;
-	static ipcarg_t shm_id = 0;
+	static sysarg_t shm_id = 0;
 	static size_t shm_size;
 	
@@ -1083,5 +1083,5 @@
 	unsigned int h;
 	
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_SHARE_OUT:
 		/* We accept one area for data interchange */
@@ -1360,5 +1360,5 @@
 	int newval;
 	
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case FB_ANIM_CREATE:
 		nvp = IPC_GET_ARG1(*call);
@@ -1435,5 +1435,5 @@
 			break;
 		}
-		newval = (IPC_GET_METHOD(*call) == FB_ANIM_START);
+		newval = (IPC_GET_IMETHOD(*call) == FB_ANIM_START);
 		if (newval ^ animations[i].enabled) {
 			animations[i].enabled = newval;
@@ -1459,5 +1459,5 @@
 	int i, nvp;
 	
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case FB_VP_DRAW_PIXMAP:
 		nvp = IPC_GET_ARG1(*call);
@@ -1529,6 +1529,6 @@
 }
 
-static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color,
-    ipcarg_t bg_color, ipcarg_t flags)
+static int rgb_from_idx(attr_rgb_t *rgb, sysarg_t fg_color,
+    sysarg_t bg_color, sysarg_t flags)
 {
 	fg_color = (fg_color & 7) | ((flags & CATTR_BRIGHT) ? 8 : 0);
@@ -1562,11 +1562,11 @@
 }
 
-static int fb_set_style(viewport_t *vport, ipcarg_t style)
+static int fb_set_style(viewport_t *vport, sysarg_t style)
 {
 	return rgb_from_style(&vport->attr, (int) style);
 }
 
-static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,
-    ipcarg_t bg_color, ipcarg_t flags)
+static int fb_set_color(viewport_t *vport, sysarg_t fg_color,
+    sysarg_t bg_color, sysarg_t flags)
 {
 	return rgb_from_idx(&vport->attr, fg_color, bg_color, flags);
@@ -1621,5 +1621,5 @@
 			continue;
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			client_connected = false;
Index: uspace/srv/hid/fb/main.c
===================================================================
--- uspace/srv/hid/fb/main.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/fb/main.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -114,5 +114,5 @@
 		return -1;
 	
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0) 
 		return -1;
Index: uspace/srv/hid/fb/serial_console.c
===================================================================
--- uspace/srv/hid/fb/serial_console.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/fb/serial_console.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -55,12 +55,12 @@
 #define MAX_CONTROL 20
 
-static ipcarg_t scr_width;
-static ipcarg_t scr_height;
+static sysarg_t scr_width;
+static sysarg_t scr_height;
 static bool color = true;    /**< True if producing color output. */
 static bool utf8 = false;    /**< True if producing UTF8 output. */
 static putc_function_t putc_function;
 
-static ipcarg_t lastcol = 0;
-static ipcarg_t lastrow = 0;
+static sysarg_t lastcol = 0;
+static sysarg_t lastrow = 0;
 static attrs_t cur_attr = {
 	.t = at_style,
@@ -130,5 +130,5 @@
 }
 
-void serial_goto(const ipcarg_t col, const ipcarg_t row)
+void serial_goto(const sysarg_t col, const sysarg_t row)
 {
 	if ((col > scr_width) || (row > scr_height))
@@ -252,5 +252,5 @@
 
 /** Set scrolling region. */
-void serial_set_scroll_region(ipcarg_t last_row)
+void serial_set_scroll_region(sysarg_t last_row)
 {
 	char control[MAX_CONTROL];
@@ -269,5 +269,5 @@
 }
 
-void serial_console_init(putc_function_t putc_fn, ipcarg_t w, ipcarg_t h)
+void serial_console_init(putc_function_t putc_fn, sysarg_t w, sysarg_t h)
 {
 	scr_width = w;
@@ -286,15 +286,15 @@
  *
  */
-static void draw_text_data(keyfield_t *data, ipcarg_t x0, ipcarg_t y0,
-    ipcarg_t width, ipcarg_t height)
+static void draw_text_data(keyfield_t *data, sysarg_t x0, sysarg_t y0,
+    sysarg_t width, sysarg_t height)
 {
 	attrs_t *a0 = &data[0].attrs;
 	serial_set_attrs(a0);
 	
-	ipcarg_t y;
+	sysarg_t y;
 	for (y = 0; y < height; y++) {
 		serial_goto(x0, y0 + y);
 		
-		ipcarg_t x;
+		sysarg_t x;
 		for (x = 0; x < width; x++) {
 			attrs_t *attr = &data[y * width + x].attrs;
@@ -337,13 +337,13 @@
 		
 		wchar_t c;
-		ipcarg_t col;
-		ipcarg_t row;
-		ipcarg_t w;
-		ipcarg_t h;
+		sysarg_t col;
+		sysarg_t row;
+		sysarg_t w;
+		sysarg_t h;
 		ssize_t rows;
 		
 		int retval;
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			client_connected = 0;
@@ -442,10 +442,10 @@
 			
 			if (rows >= 0) {
-				if ((ipcarg_t) rows > scr_height) {
+				if ((sysarg_t) rows > scr_height) {
 					retval = EINVAL;
 					break;
 				}
 			} else {
-				if ((ipcarg_t) (-rows) > scr_height) {
+				if ((sysarg_t) (-rows) > scr_height) {
 					retval = EINVAL;
 					break;
Index: uspace/srv/hid/fb/serial_console.h
===================================================================
--- uspace/srv/hid/fb/serial_console.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/fb/serial_console.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -44,11 +44,11 @@
 
 extern void serial_puts(const char *);
-extern void serial_goto(const ipcarg_t, const ipcarg_t);
+extern void serial_goto(const sysarg_t, const sysarg_t);
 extern void serial_clrscr(void);
 extern void serial_scroll(ssize_t);
 extern void serial_cursor_disable(void);
 extern void serial_cursor_enable(void);
-extern void serial_set_scroll_region(ipcarg_t);
-extern void serial_console_init(putc_function_t, ipcarg_t, ipcarg_t);
+extern void serial_set_scroll_region(sysarg_t);
+extern void serial_console_init(putc_function_t, sysarg_t, sysarg_t);
 extern void serial_client_connection(ipc_callid_t, ipc_call_t *);
 
Index: uspace/srv/hid/kbd/generic/kbd.c
===================================================================
--- uspace/srv/hid/kbd/generic/kbd.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/kbd/generic/kbd.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -177,5 +177,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			if (client_phone != -1) {
Index: uspace/srv/hid/kbd/port/adb.c
===================================================================
--- uspace/srv/hid/kbd/port/adb.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/kbd/port/adb.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -71,5 +71,5 @@
 
 	/* NB: The callback connection is slotted for removal */
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &phonehash) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
@@ -105,5 +105,5 @@
 		int retval;
 
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			/* TODO: Handle hangup */
Index: uspace/srv/hid/kbd/port/chardev.c
===================================================================
--- uspace/srv/hid/kbd/port/chardev.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/kbd/port/chardev.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -91,5 +91,5 @@
 
 	/* NB: The callback connection is slotted for removal */
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &phonehash) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
@@ -125,5 +125,5 @@
 		int retval;
 
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			/* TODO: Handle hangup */
Index: pace/srv/hid/kbd/port/i8042.h
===================================================================
--- uspace/srv/hid/kbd/port/i8042.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * 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.
- */
-
-/** @addtogroup kbd_port
- * @ingroup  kbd
- * @{
- */
-
-/** @file
- * @brief i8042 port driver.
- */
-
-#ifndef KBD_PORT_i8042_H_
-#define KBD_PORT_i8042_H_
-
-#include <libarch/ddi.h>
-#include <libarch/types.h>
-
-struct i8042 {
-	ioport8_t data;
-	uint8_t pad[3];
-	ioport8_t status;
-} __attribute__ ((packed));
-typedef struct i8042 i8042_t;
-
-#endif
-
-/**
- * @}
- */ 
Index: uspace/srv/hid/kbd/port/ns16550.c
===================================================================
--- uspace/srv/hid/kbd/port/ns16550.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/kbd/port/ns16550.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -123,5 +123,5 @@
 	if (cir_service)
 		async_msg_1(cir_phone, BUS_CLEAR_INTERRUPT,
-		    IPC_GET_METHOD(*call));
+		    IPC_GET_IMETHOD(*call));
 }
 
Index: uspace/srv/hid/kbd/port/z8530.c
===================================================================
--- uspace/srv/hid/kbd/port/z8530.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/kbd/port/z8530.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -111,5 +111,5 @@
 	if (cir_service)
 		async_msg_1(cir_phone, BUS_CLEAR_INTERRUPT,
-		    IPC_GET_METHOD(*call));
+		    IPC_GET_IMETHOD(*call));
 }
 
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -382,5 +382,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			if (ts->client_phone != -1) {
Index: uspace/srv/hw/bus/cuda_adb/cuda_adb.c
===================================================================
--- uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -195,5 +195,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	devmap_handle_t dh;
 	int retval;
@@ -220,5 +220,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/hw/char/i8042/i8042.c
===================================================================
--- uspace/srv/hw/char/i8042/i8042.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hw/char/i8042/i8042.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -219,5 +219,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	devmap_handle_t dh;
 	int retval;
@@ -248,5 +248,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
===================================================================
--- uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -116,5 +116,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	ipcarg_t method;
+	sysarg_t method;
 	int retval;
 
@@ -124,5 +124,5 @@
 	while (1) {
 		callid = async_get_call(&call);
-		method = IPC_GET_METHOD(call);
+		method = IPC_GET_IMETHOD(call);
 		switch (method) {
 		case IPC_M_PHONE_HUNGUP:
Index: uspace/srv/hw/cir/fhc/fhc.c
===================================================================
--- uspace/srv/hw/cir/fhc/fhc.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hw/cir/fhc/fhc.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -82,5 +82,5 @@
 	
 		callid = async_get_call(&call);
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case BUS_CLEAR_INTERRUPT:
 			inr = IPC_GET_ARG1(call);
@@ -133,5 +133,5 @@
 	
 	async_set_client_connection(fhc_connection);
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead);
 	
Index: uspace/srv/hw/cir/obio/obio.c
===================================================================
--- uspace/srv/hw/cir/obio/obio.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hw/cir/obio/obio.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -92,5 +92,5 @@
 	
 		callid = async_get_call(&call);
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case BUS_CLEAR_INTERRUPT:
 			inr = IPC_GET_ARG1(call);
@@ -134,5 +134,5 @@
 	
 	async_set_client_connection(obio_connection);
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead);
 	
Index: uspace/srv/hw/netif/dp8390/dp8390_module.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -63,5 +63,5 @@
  *  @param[in] call The interrupt call.
  */
-#define IRQ_GET_DEVICE(call)			(device_id_t) IPC_GET_METHOD(*call)
+#define IRQ_GET_DEVICE(call)			(device_id_t) IPC_GET_IMETHOD(*call)
 
 /** Returns the interrupt status register from the interrupt call.
@@ -197,5 +197,5 @@
 		return rc;
 	address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
-	address->length = CONVERT_SIZE(ether_addr_t, char, 1);
+	address->length = sizeof(ether_addr_t);
 	return EOK;
 }
@@ -306,9 +306,9 @@
 
 int netif_initialize(void){
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 
 	async_set_interrupt_received(irq_handler);
 
-	return REGISTER_ME(SERVICE_DP8390, &phonehash);
+	return ipc_connect_to_me(PHONE_NS, SERVICE_DP8390, 0, 0, &phonehash);
 }
 
@@ -343,5 +343,5 @@
 		
 		/* End if said to either by the message or the processing result */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
 			return;
 		
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/loader/main.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -383,5 +383,5 @@
 		callid = async_get_call(&call);
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			exit(0);
@@ -411,7 +411,7 @@
 			break;
 		}
-		if (IPC_GET_METHOD(call) != IPC_M_PHONE_HUNGUP) {
+		if (IPC_GET_IMETHOD(call) != IPC_M_PHONE_HUNGUP) {
 			DPRINTF("Responding EINVAL to method %d.\n",
-			    IPC_GET_METHOD(call));
+			    IPC_GET_IMETHOD(call));
 			ipc_answer_0(callid, EINVAL);
 		}
@@ -423,5 +423,5 @@
 int main(int argc, char *argv[])
 {
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	task_id_t id;
 	int rc;
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/il/arp/arp.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -72,4 +72,7 @@
 #define NAME  "arp"
 
+/** Number of microseconds to wait for an ARP reply. */
+#define ARP_TRANS_WAIT	1000000
+
 /** ARP global data. */
 arp_globals_t arp_globals;
@@ -77,5 +80,27 @@
 DEVICE_MAP_IMPLEMENT(arp_cache, arp_device_t);
 INT_MAP_IMPLEMENT(arp_protos, arp_proto_t);
-GENERIC_CHAR_MAP_IMPLEMENT(arp_addr, measured_string_t);
+GENERIC_CHAR_MAP_IMPLEMENT(arp_addr, arp_trans_t);
+
+static void arp_clear_trans(arp_trans_t *trans)
+{
+	if (trans->hw_addr) {
+		free(trans->hw_addr);
+		trans->hw_addr = NULL;
+	}
+	fibril_condvar_broadcast(&trans->cv);
+}
+
+static void arp_clear_addr(arp_addr_t *addresses)
+{
+	int count;
+	arp_trans_t *trans;
+
+	for (count = arp_addr_count(addresses) - 1; count >= 0; count--) {
+		trans = arp_addr_items_get_index(&addresses->values, count);
+		if (trans)
+			arp_clear_trans(trans);
+	}
+}
+
 
 /** Clears the device specific data.
@@ -96,4 +121,5 @@
 			if (proto->addr_data)
 				free(proto->addr_data);
+			arp_clear_addr(&proto->addresses);
 			arp_addr_destroy(&proto->addresses);
 		}
@@ -107,5 +133,5 @@
 	arp_device_t *device;
 
-	fibril_rwlock_write_lock(&arp_globals.lock);
+	fibril_mutex_lock(&arp_globals.lock);
 	for (count = arp_cache_count(&arp_globals.cache) - 1; count >= 0;
 	    count--) {
@@ -120,5 +146,5 @@
 	}
 	arp_cache_clear(&arp_globals.cache);
-	fibril_rwlock_write_unlock(&arp_globals.lock);
+	fibril_mutex_unlock(&arp_globals.lock);
 	printf("Cache cleaned\n");
 	return EOK;
@@ -130,18 +156,22 @@
 	arp_device_t *device;
 	arp_proto_t *proto;
-
-	fibril_rwlock_write_lock(&arp_globals.lock);
+	arp_trans_t *trans;
+
+	fibril_mutex_lock(&arp_globals.lock);
 	device = arp_cache_find(&arp_globals.cache, device_id);
 	if (!device) {
-		fibril_rwlock_write_unlock(&arp_globals.lock);
+		fibril_mutex_unlock(&arp_globals.lock);
 		return ENOENT;
 	}
 	proto = arp_protos_find(&device->protos, protocol);
 	if (!proto) {
-		fibril_rwlock_write_unlock(&arp_globals.lock);
+		fibril_mutex_unlock(&arp_globals.lock);
 		return ENOENT;
 	}
+	trans = arp_addr_find(&proto->addresses, address->value, address->length);
+	if (trans)
+		arp_clear_trans(trans);
 	arp_addr_exclude(&proto->addresses, address->value, address->length);
-	fibril_rwlock_write_unlock(&arp_globals.lock);
+	fibril_mutex_unlock(&arp_globals.lock);
 	return EOK;
 }
@@ -152,13 +182,13 @@
 	arp_device_t *device;
 
-	fibril_rwlock_write_lock(&arp_globals.lock);
+	fibril_mutex_lock(&arp_globals.lock);
 	device = arp_cache_find(&arp_globals.cache, device_id);
 	if (!device) {
-		fibril_rwlock_write_unlock(&arp_globals.lock);
+		fibril_mutex_unlock(&arp_globals.lock);
 		return ENOENT;
 	}
 	arp_clear_device(device);
 	printf("Device %d cleared\n", device_id);
-	fibril_rwlock_write_unlock(&arp_globals.lock);
+	fibril_mutex_unlock(&arp_globals.lock);
 	return EOK;
 }
@@ -221,5 +251,5 @@
 	int rc;
 
-	fibril_rwlock_write_lock(&arp_globals.lock);
+	fibril_mutex_lock(&arp_globals.lock);
 
 	/* An existing device? */
@@ -229,5 +259,5 @@
 		if (device->service != service) {
 			printf("Device %d already exists\n", device->device_id);
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			return EEXIST;
 		}
@@ -241,5 +271,5 @@
 			rc = arp_proto_create(&proto, protocol, address);
 			if (rc != EOK) {
-				fibril_rwlock_write_unlock(&arp_globals.lock);
+				fibril_mutex_unlock(&arp_globals.lock);
 				return rc;
 			}
@@ -247,5 +277,5 @@
 			    proto);
 			if (index < 0) {
-				fibril_rwlock_write_unlock(&arp_globals.lock);
+				fibril_mutex_unlock(&arp_globals.lock);
 				free(proto);
 				return index;
@@ -262,5 +292,5 @@
 		device = (arp_device_t *) malloc(sizeof(arp_device_t));
 		if (!device) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			return ENOMEM;
 		}
@@ -269,5 +299,5 @@
 		rc = arp_protos_initialize(&device->protos);
 		if (rc != EOK) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			free(device);
 			return rc;
@@ -275,5 +305,5 @@
 		rc = arp_proto_create(&proto, protocol, address);
 		if (rc != EOK) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			free(device);
 			return rc;
@@ -281,5 +311,5 @@
 		index = arp_protos_add(&device->protos, proto->service, proto);
 		if (index < 0) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
 			free(device);
@@ -290,8 +320,8 @@
 		/* Bind the new one */
 		device->phone = nil_bind_service(device->service,
-		    (ipcarg_t) device->device_id, SERVICE_ARP,
+		    (sysarg_t) device->device_id, SERVICE_ARP,
 		    arp_globals.client_connection);
 		if (device->phone < 0) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
 			free(device);
@@ -303,5 +333,5 @@
 		    &device->packet_dimension);
 		if (rc != EOK) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
 			free(device);
@@ -313,5 +343,5 @@
 		    &device->addr_data);
 		if (rc != EOK) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
 			free(device);
@@ -323,5 +353,5 @@
 		    &device->broadcast_addr, &device->broadcast_data);
 		if (rc != EOK) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			free(device->addr);
 			free(device->addr_data);
@@ -334,5 +364,5 @@
 		    device);
 		if (rc != EOK) {
-			fibril_rwlock_write_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			free(device->addr);
 			free(device->addr_data);
@@ -347,5 +377,5 @@
 		    device->service, protocol);
 	}
-	fibril_rwlock_write_unlock(&arp_globals.lock);
+	fibril_mutex_unlock(&arp_globals.lock);
 	
 	return EOK;
@@ -363,9 +393,9 @@
 	int rc;
 
-	fibril_rwlock_initialize(&arp_globals.lock);
-	fibril_rwlock_write_lock(&arp_globals.lock);
+	fibril_mutex_initialize(&arp_globals.lock);
+	fibril_mutex_lock(&arp_globals.lock);
 	arp_globals.client_connection = client_connection;
 	rc = arp_cache_initialize(&arp_globals.cache);
-	fibril_rwlock_write_unlock(&arp_globals.lock);
+	fibril_mutex_unlock(&arp_globals.lock);
 	
 	return rc;
@@ -383,12 +413,12 @@
 	arp_device_t *device;
 
-	fibril_rwlock_write_lock(&arp_globals.lock);
+	fibril_mutex_lock(&arp_globals.lock);
 	device = arp_cache_find(&arp_globals.cache, device_id);
 	if (!device) {
-		fibril_rwlock_write_unlock(&arp_globals.lock);
+		fibril_mutex_unlock(&arp_globals.lock);
 		return ENOENT;
 	}
 	device->packet_dimension.content = mtu;
-	fibril_rwlock_write_unlock(&arp_globals.lock);
+	fibril_mutex_unlock(&arp_globals.lock);
 	printf("arp - device %d changed mtu to %zu\n\n", device_id, mtu);
 	return EOK;
@@ -421,5 +451,5 @@
 	arp_device_t *device;
 	arp_proto_t *proto;
-	measured_string_t *hw_source;
+	arp_trans_t *trans;
 	uint8_t *src_hw;
 	uint8_t *src_proto;
@@ -452,34 +482,39 @@
 	des_hw = src_proto + header->protocol_length;
 	des_proto = des_hw + header->hardware_length;
-	hw_source = arp_addr_find(&proto->addresses, (char *) src_proto,
-	    CONVERT_SIZE(uint8_t, char, header->protocol_length));
+	trans = arp_addr_find(&proto->addresses, (char *) src_proto,
+	    header->protocol_length);
 	/* Exists? */
-	if (hw_source) {
-		if (hw_source->length != CONVERT_SIZE(uint8_t, char,
-		    header->hardware_length)) {
+	if (trans && trans->hw_addr) {
+		if (trans->hw_addr->length != header->hardware_length)
 			return EINVAL;
-		}
-		memcpy(hw_source->value, src_hw, hw_source->length);
+		memcpy(trans->hw_addr->value, src_hw, trans->hw_addr->length);
 	}
 	/* Is my protocol address? */
-	if (proto->addr->length != CONVERT_SIZE(uint8_t, char,
-	    header->protocol_length)) {
+	if (proto->addr->length != header->protocol_length)
 		return EINVAL;
-	}
 	if (!str_lcmp(proto->addr->value, (char *) des_proto,
 	    proto->addr->length)) {
 		/* Not already updated? */
-		if (!hw_source) {
-			hw_source = measured_string_create_bulk((char *) src_hw,
-			    CONVERT_SIZE(uint8_t, char,
-			    header->hardware_length));
-			if (!hw_source)
+		if (!trans) {
+			trans = (arp_trans_t *) malloc(sizeof(arp_trans_t));
+			if (!trans)
 				return ENOMEM;
-
+			trans->hw_addr = NULL;
+			fibril_condvar_initialize(&trans->cv);
 			rc = arp_addr_add(&proto->addresses, (char *) src_proto,
-			    CONVERT_SIZE(uint8_t, char,
-			    header->protocol_length), hw_source);
-			if (rc != EOK)
+			    header->protocol_length, trans);
+			if (rc != EOK) {
+				/* The generic char map has already freed trans! */
 				return rc;
+			}
+		}
+		if (!trans->hw_addr) {
+			trans->hw_addr = measured_string_create_bulk(
+			    (char *) src_hw, header->hardware_length);
+			if (!trans->hw_addr)
+				return ENOMEM;
+
+			/* Notify the fibrils that wait for the translation. */
+			fibril_condvar_broadcast(&trans->cv);
 		}
 		if (ntohs(header->operation) == ARPOP_REQUEST) {
@@ -490,5 +525,5 @@
 			memcpy(src_hw, device->addr->value,
 			    device->packet_dimension.addr_len);
-			memcpy(des_hw, hw_source->value,
+			memcpy(des_hw, trans->hw_addr->value,
 			    header->hardware_length);
 			
@@ -516,42 +551,56 @@
  * @param[in] protocol	The protocol service.
  * @param[in] target	The target protocol address.
- * @return		The hardware address of the target.
- * @return		NULL if the target parameter is NULL.
- * @return		NULL if the device is not found.
- * @return		NULL if the device packet is too small to send a
- *			request.
- * @return		NULL if the hardware address is not found in the cache.
- */
-static measured_string_t *
+ * @param[out] translation Where the hardware address of the target is stored.
+ * @return		EOK on success.
+ * @return		EAGAIN if the caller should try again.
+ * @return		Other error codes in case of error.
+ */
+static int
 arp_translate_message(device_id_t device_id, services_t protocol,
-    measured_string_t *target)
+    measured_string_t *target, measured_string_t **translation)
 {
 	arp_device_t *device;
 	arp_proto_t *proto;
-	measured_string_t *addr;
+	arp_trans_t *trans;
 	size_t length;
 	packet_t *packet;
 	arp_header_t *header;
-
-	if (!target)
-		return NULL;
+	bool retry = false;
+	int rc;
+
+restart:
+	if (!target || !translation)
+		return EBADMEM;
 
 	device = arp_cache_find(&arp_globals.cache, device_id);
 	if (!device)
-		return NULL;
+		return ENOENT;
 
 	proto = arp_protos_find(&device->protos, protocol);
 	if (!proto || (proto->addr->length != target->length))
-		return NULL;
-
-	addr = arp_addr_find(&proto->addresses, target->value, target->length);
-	if (addr)
-		return addr;
+		return ENOENT;
+
+	trans = arp_addr_find(&proto->addresses, target->value, target->length);
+	if (trans) {
+		if (trans->hw_addr) {
+			*translation = trans->hw_addr;
+			return EOK;
+		}
+		if (retry)
+			return EAGAIN;
+		rc = fibril_condvar_wait_timeout(&trans->cv, &arp_globals.lock,
+		    ARP_TRANS_WAIT);
+		if (rc == ETIMEOUT)
+			return ENOENT;
+		retry = true;
+		goto restart;
+	}
+	if (retry)
+		return EAGAIN;
 
 	/* ARP packet content size = header + (address + translation) * 2 */
-	length = 8 + 2 * (CONVERT_SIZE(char, uint8_t, proto->addr->length) +
-	    CONVERT_SIZE(char, uint8_t, device->addr->length));
+	length = 8 + 2 * (proto->addr->length + device->addr->length);
 	if (length > device->packet_dimension.content)
-		return NULL;
+		return ELIMIT;
 
 	packet = packet_get_4_remote(arp_globals.net_phone,
@@ -559,10 +608,10 @@
 	    length, device->packet_dimension.suffix);
 	if (!packet)
-		return NULL;
+		return ENOMEM;
 
 	header = (arp_header_t *) packet_suffix(packet, length);
 	if (!header) {
 		pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
-		return NULL;
+		return ENOMEM;
 	}
 
@@ -583,13 +632,31 @@
 	memcpy(((uint8_t *) header) + length, target->value, target->length);
 
-	if (packet_set_addr(packet, (uint8_t *) device->addr->value,
-	    (uint8_t *) device->broadcast_addr->value,
-	    CONVERT_SIZE(char, uint8_t, device->addr->length)) != EOK) {
+	rc = packet_set_addr(packet, (uint8_t *) device->addr->value,
+	    (uint8_t *) device->broadcast_addr->value, device->addr->length);
+	if (rc != EOK) {
 		pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
-		return NULL;
+		return rc;
 	}
 
 	nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
-	return NULL;
+
+	trans = (arp_trans_t *) malloc(sizeof(arp_trans_t));
+	if (!trans)
+		return ENOMEM;
+	trans->hw_addr = NULL;
+	fibril_condvar_initialize(&trans->cv);
+	rc = arp_addr_add(&proto->addresses, target->value, target->length,
+	    trans);
+	if (rc != EOK) {
+		/* The generic char map has already freed trans! */
+		return rc;
+	}
+	
+	rc = fibril_condvar_wait_timeout(&trans->cv, &arp_globals.lock,
+	    ARP_TRANS_WAIT);
+	if (rc == ETIMEOUT)
+		return ENOENT;
+	retry = true;
+	goto restart;
 }
 
@@ -620,5 +687,5 @@
 	
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_PHONE_HUNGUP:
 		return EOK;
@@ -642,15 +709,19 @@
 			return rc;
 		
-		fibril_rwlock_read_lock(&arp_globals.lock);
-		translation = arp_translate_message(IPC_GET_DEVICE(call),
-		    IPC_GET_SERVICE(call), address);
+		fibril_mutex_lock(&arp_globals.lock);
+		rc = arp_translate_message(IPC_GET_DEVICE(call),
+		    IPC_GET_SERVICE(call), address, &translation);
 		free(address);
 		free(data);
+		if (rc != EOK) {
+			fibril_mutex_unlock(&arp_globals.lock);
+			return rc;
+		}
 		if (!translation) {
-			fibril_rwlock_read_unlock(&arp_globals.lock);
+			fibril_mutex_unlock(&arp_globals.lock);
 			return ENOENT;
 		}
 		rc = measured_strings_reply(translation, 1);
-		fibril_rwlock_read_unlock(&arp_globals.lock);
+		fibril_mutex_unlock(&arp_globals.lock);
 		return rc;
 
@@ -682,5 +753,5 @@
 			return rc;
 		
-		fibril_rwlock_read_lock(&arp_globals.lock);
+		fibril_mutex_lock(&arp_globals.lock);
 		do {
 			next = pq_detach(packet);
@@ -692,5 +763,5 @@
 			packet = next;
 		} while (packet);
-		fibril_rwlock_read_unlock(&arp_globals.lock);
+		fibril_mutex_unlock(&arp_globals.lock);
 		
 		return EOK;
@@ -736,5 +807,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP))
 			return;
Index: uspace/srv/net/il/arp/arp.h
===================================================================
--- uspace/srv/net/il/arp/arp.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/il/arp/arp.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -65,4 +65,9 @@
 typedef struct arp_proto arp_proto_t;
 
+/** Type definition of the ARP address translation record.
+ * @see arp_trans
+ */
+typedef struct arp_trans arp_trans_t;
+
 /** ARP address map.
  *
@@ -70,5 +75,5 @@
  * @see generic_char_map.h
  */
-GENERIC_CHAR_MAP_DECLARE(arp_addr, measured_string_t);
+GENERIC_CHAR_MAP_DECLARE(arp_addr, arp_trans_t);
 
 /** ARP address cache.
@@ -89,9 +94,9 @@
 struct arp_device {
 	/** Actual device hardware address. */
-	measured_string_t * addr;
+	measured_string_t *addr;
 	/** Actual device hardware address data. */
 	char *addr_data;
 	/** Broadcast device hardware address. */
-	measured_string_t * broadcast_addr;
+	measured_string_t *broadcast_addr;
 	/** Broadcast device hardware address data. */
 	char *broadcast_data;
@@ -129,5 +134,5 @@
 	int net_phone;
 	/** Safety lock. */
-	fibril_rwlock_t lock;
+	fibril_mutex_t lock;
 };
 
@@ -144,6 +149,18 @@
 };
 
+/** ARP address translation record. */
+struct arp_trans {
+	/**
+	 * Hardware address for the translation. NULL denotes an incomplete
+	 * record with possible waiters.
+	 */ 
+	measured_string_t *hw_addr;
+	/** Condition variable used for waiting for completion of the record. */
+	fibril_condvar_t cv;
+};
+
 #endif
 
 /** @}
  */
+
Index: uspace/srv/net/il/arp/arp_module.c
===================================================================
--- uspace/srv/net/il/arp/arp_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/il/arp/arp_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -65,5 +65,5 @@
 int il_module_start_standalone(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 	
@@ -79,5 +79,5 @@
 		goto out;
 	
-	rc = REGISTER_ME(SERVICE_ARP, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_ARP, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
Index: uspace/srv/net/il/ip/ip.c
===================================================================
--- uspace/srv/net/il/ip/ip.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/il/ip/ip.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -430,5 +430,5 @@
 	// binds the netif service which also initializes the device
 	ip_netif->phone = nil_bind_service(ip_netif->service,
-	    (ipcarg_t) ip_netif->device_id, SERVICE_IP,
+	    (sysarg_t) ip_netif->device_id, SERVICE_IP,
 	    ip_globals.client_connection);
 	if (ip_netif->phone < 0) {
@@ -442,5 +442,5 @@
 		if (route) {
 			address.value = (char *) &route->address.s_addr;
-			address.length = CONVERT_SIZE(in_addr_t, char, 1);
+			address.length = sizeof(in_addr_t);
 			
 			rc = arp_device_req(ip_netif->arp->phone,
@@ -639,5 +639,5 @@
 	if (destination) {
 		rc = packet_set_addr(packet, NULL, (uint8_t *) destination->value,
-		    CONVERT_SIZE(char, uint8_t, destination->length));
+		    destination->length);
 	} else {
 		rc = packet_set_addr(packet, NULL, NULL, 0);
@@ -687,6 +687,5 @@
 				rc = packet_set_addr(next, NULL,
 				    (uint8_t *) destination->value,
-				    CONVERT_SIZE(char, uint8_t,
-				    destination->length));
+				    destination->length);
 				if (rc != EOK) {
 				    	free(last_header);
@@ -718,5 +717,5 @@
 			rc = packet_set_addr(next, NULL,
 			    (uint8_t *) destination->value,
-			    CONVERT_SIZE(char, uint8_t, destination->length));
+			    destination->length);
 			if (rc != EOK) {
 				free(last_header);
@@ -1006,5 +1005,5 @@
 		destination.value = route->gateway.s_addr ?
 		    (char *) &route->gateway.s_addr : (char *) &dest.s_addr;
-		destination.length = CONVERT_SIZE(dest.s_addr, char, 1);
+		destination.length = sizeof(dest.s_addr);
 
 		rc = arp_translate_req(netif->arp->phone, netif->device_id,
@@ -1758,6 +1757,5 @@
 			// clear the ARP mapping if any
 			address.value = (char *) &header->destination_address;
-			address.length = CONVERT_SIZE(uint8_t, char,
-			    sizeof(header->destination_address));
+			address.length = sizeof(header->destination_address);
 			arp_clear_address_req(netif->arp->phone,
 			    netif->device_id, SERVICE_IP, &address);
@@ -1902,5 +1900,5 @@
 	
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_PHONE_HUNGUP:
 		return EOK;
@@ -1951,5 +1949,6 @@
 
 	case NET_IP_GET_ROUTE:
-		rc = data_receive((void **) &addr, &addrlen);
+		rc = async_data_write_accept((void **) &addr, false, 0, 0, 0,
+		    &addrlen);
 		if (rc != EOK)
 			return rc;
@@ -2025,5 +2024,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP)) {
 			return;
Index: uspace/srv/net/il/ip/ip_module.c
===================================================================
--- uspace/srv/net/il/ip/ip_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/il/ip/ip_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -66,5 +66,5 @@
 int il_module_start_standalone(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 	
@@ -80,5 +80,5 @@
 		goto out;
 	
-	rc = REGISTER_ME(SERVICE_IP, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_IP, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/net/net.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -322,5 +322,5 @@
 static int net_module_start(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 	
@@ -335,5 +335,5 @@
 		goto out;
 	
-	rc = REGISTER_ME(SERVICE_NETWORKING, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
@@ -632,5 +632,5 @@
 	
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_PHONE_HUNGUP:
 		return EOK;
@@ -697,5 +697,5 @@
 		
 		/* End if told to either by the message or the processing result */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
 			return;
 		
Index: uspace/srv/net/netif/lo/lo.c
===================================================================
--- uspace/srv/net/netif/lo/lo.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/netif/lo/lo.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -164,7 +164,7 @@
 int netif_initialize(void)
 {
-	ipcarg_t phonehash;
-
-	return REGISTER_ME(SERVICE_LO, &phonehash);
+	sysarg_t phonehash;
+
+	return ipc_connect_to_me(PHONE_NS, SERVICE_LO, 0, 0, &phonehash);
 }
 
@@ -262,5 +262,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP))
 			return;
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/nil/eth/eth.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -201,6 +201,5 @@
 
 	eth_globals.broadcast_addr =
-	    measured_string_create_bulk("\xFF\xFF\xFF\xFF\xFF\xFF",
-	    CONVERT_SIZE(uint8_t, char, ETH_ADDR));
+	    measured_string_create_bulk("\xFF\xFF\xFF\xFF\xFF\xFF", ETH_ADDR);
 	if (!eth_globals.broadcast_addr) {
 		rc = ENOMEM;
@@ -238,5 +237,5 @@
 
 	while (true) {
-		switch (IPC_GET_METHOD(*icall)) {
+		switch (IPC_GET_IMETHOD(*icall)) {
 		case NET_NIL_DEVICE_STATE:
 			nil_device_state_msg_local(0, IPC_GET_DEVICE(icall),
@@ -251,8 +250,8 @@
 				    IPC_GET_DEVICE(icall), packet, 0);
 			}
-			ipc_answer_0(iid, (ipcarg_t) rc);
+			ipc_answer_0(iid, (sysarg_t) rc);
 			break;
 		default:
-			ipc_answer_0(iid, (ipcarg_t) ENOTSUP);
+			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
@@ -849,5 +848,5 @@
 	
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_PHONE_HUNGUP:
 		return EOK;
@@ -926,5 +925,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP))
 			return;
Index: uspace/srv/net/nil/eth/eth_module.c
===================================================================
--- uspace/srv/net/nil/eth/eth_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/nil/eth/eth_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -52,5 +52,5 @@
 int nil_module_start_standalone(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 	
@@ -66,5 +66,5 @@
 		goto out;
 
-	rc = REGISTER_ME(SERVICE_ETHERNET, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_ETHERNET, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
Index: uspace/srv/net/nil/nildummy/nildummy.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/nil/nildummy/nildummy.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -110,9 +110,9 @@
 
 	while (true) {
-		switch (IPC_GET_METHOD(*icall)) {
+		switch (IPC_GET_IMETHOD(*icall)) {
 		case NET_NIL_DEVICE_STATE:
 			rc = nil_device_state_msg_local(0,
 			    IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
-			ipc_answer_0(iid, (ipcarg_t) rc);
+			ipc_answer_0(iid, (sysarg_t) rc);
 			break;
 		
@@ -124,9 +124,9 @@
 				    IPC_GET_DEVICE(icall), packet, 0);
 			}
-			ipc_answer_0(iid, (ipcarg_t) rc);
+			ipc_answer_0(iid, (sysarg_t) rc);
 			break;
 		
 		default:
-			ipc_answer_0(iid, (ipcarg_t) ENOTSUP);
+			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
@@ -386,5 +386,5 @@
 	
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case IPC_M_PHONE_HUNGUP:
 		return EOK;
@@ -466,5 +466,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP))
 			return;
Index: uspace/srv/net/nil/nildummy/nildummy_module.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/nil/nildummy/nildummy_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -52,5 +52,5 @@
 int nil_module_start_standalone(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 	
@@ -67,5 +67,5 @@
 		goto out;
 	
-	rc = REGISTER_ME(SERVICE_NILDUMMY, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_NILDUMMY, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -693,5 +693,5 @@
 	int rc;
 
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case NET_ICMP_DEST_UNREACH:
 		rc = packet_translate_remote(icmp_globals.net_phone, &packet,
@@ -824,5 +824,5 @@
 
 		/* Process the call */
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			keep_on_going = false;
@@ -900,5 +900,5 @@
 
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case NET_TL_RECEIVED:
 		rc = packet_translate_remote(icmp_globals.net_phone, &packet,
@@ -953,5 +953,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP))
 			return;
Index: uspace/srv/net/tl/icmp/icmp_module.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/tl/icmp/icmp_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -58,5 +58,5 @@
 int tl_module_start_standalone(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 
@@ -74,5 +74,5 @@
 		goto out;
 
-	rc = REGISTER_ME(SERVICE_ICMP, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_ICMP, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -829,8 +829,8 @@
 	/* Notify the destination socket */
 	async_msg_5(socket->phone, NET_SOCKET_RECEIVED,
-	    (ipcarg_t) socket->socket_id,
+	    (sysarg_t) socket->socket_id,
 	    ((packet_dimension->content < socket_data->data_fragment_size) ?
 	    packet_dimension->content : socket_data->data_fragment_size), 0, 0,
-	    (ipcarg_t) fragments);
+	    (sysarg_t) fragments);
 
 	return EOK;
@@ -1090,7 +1090,7 @@
 			/* Notify the destination socket */
 			async_msg_5(socket->phone, NET_SOCKET_ACCEPTED,
-			    (ipcarg_t) listening_socket->socket_id,
+			    (sysarg_t) listening_socket->socket_id,
 			    socket_data->data_fragment_size, TCP_HEADER_SIZE,
-			    0, (ipcarg_t) socket->socket_id);
+			    0, (sysarg_t) socket->socket_id);
 
 			fibril_rwlock_write_unlock(socket_data->local_lock);
@@ -1240,5 +1240,5 @@
 
 	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case NET_TL_RECEIVED:
 //		fibril_rwlock_read_lock(&tcp_globals.lock);
@@ -1323,5 +1323,5 @@
 
 		/* Process the call */
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			keep_on_going = false;
@@ -1365,5 +1365,6 @@
 
 		case NET_SOCKET_BIND:
-			res = data_receive((void **) &addr, &addrlen);
+			res = async_data_write_accept((void **) &addr, false,
+			    0, 0, 0, &addrlen);
 			if (res != EOK)
 				break;
@@ -1402,5 +1403,6 @@
 
 		case NET_SOCKET_CONNECT:
-			res = data_receive((void **) &addr, &addrlen);
+			res = async_data_write_accept((void **) &addr, false,
+			    0, 0, 0, &addrlen);
 			if (res != EOK)
 				break;
@@ -1453,5 +1455,6 @@
 
 		case NET_SOCKET_SENDTO:
-			res = data_receive((void **) &addr, &addrlen);
+			res = async_data_write_accept((void **) &addr, false,
+			    0, 0, 0, &addrlen);
 			if (res != EOK)
 				break;
@@ -2082,6 +2085,7 @@
 	if (!fibril) {
 		free(operation_timeout);
-		return EPARTY;	/* FIXME: use another EC */
-	}
+		return ENOMEM;
+	}
+
 //      fibril_mutex_lock(&socket_data->operation.mutex);
 	/* Start the timeout fibril */
@@ -2481,5 +2485,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP))
 			return;
Index: uspace/srv/net/tl/tcp/tcp_module.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/tl/tcp/tcp_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -61,5 +61,5 @@
 int tl_module_start_standalone(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 
@@ -75,5 +75,5 @@
 		goto out;
 
-	rc = REGISTER_ME(SERVICE_TCP, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_TCP, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/tl/udp/udp.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -393,6 +393,6 @@
 	fibril_rwlock_write_unlock(&udp_globals.lock);
 	async_msg_5(socket->phone, NET_SOCKET_RECEIVED,
-	    (ipcarg_t) socket->socket_id, packet_dimension->content, 0, 0,
-	    (ipcarg_t) fragments);
+	    (sysarg_t) socket->socket_id, packet_dimension->content, 0, 0,
+	    (sysarg_t) fragments);
 
 	return EOK;
@@ -742,5 +742,5 @@
 
 		/* Process the call */
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			keep_on_going = false;
@@ -771,5 +771,6 @@
 
 		case NET_SOCKET_BIND:
-			res = data_receive((void **) &addr, &addrlen);
+			res = async_data_write_accept((void **) &addr, false,
+			    0, 0, 0, &addrlen);
 			if (res != EOK)
 				break;
@@ -784,5 +785,6 @@
 
 		case NET_SOCKET_SENDTO:
-			res = data_receive((void **) &addr, &addrlen);
+			res = async_data_write_accept((void **) &addr, false,
+			    0, 0, 0, &addrlen);
 			if (res != EOK)
 				break;
@@ -866,5 +868,5 @@
 	*answer_count = 0;
 
-	switch (IPC_GET_METHOD(*call)) {
+	switch (IPC_GET_IMETHOD(*call)) {
 	case NET_TL_RECEIVED:
 		rc = packet_translate_remote(udp_globals.net_phone, &packet,
@@ -913,5 +915,5 @@
 		 * result.
 		 */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
 		    (res == EHANGUP))
 			return;
Index: uspace/srv/net/tl/udp/udp_module.c
===================================================================
--- uspace/srv/net/tl/udp/udp_module.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/net/tl/udp/udp_module.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -59,5 +59,5 @@
 int tl_module_start_standalone(async_client_conn_t client_connection)
 {
-	ipcarg_t phonehash;
+	sysarg_t phonehash;
 	int rc;
 
@@ -75,5 +75,5 @@
 		goto out;
 	
-	rc = REGISTER_ME(SERVICE_UDP, &phonehash);
+	rc = ipc_connect_to_me(PHONE_NS, SERVICE_UDP, 0, 0, &phonehash);
 	if (rc != EOK)
 		goto out;
Index: uspace/srv/ns/clonable.c
===================================================================
--- uspace/srv/ns/clonable.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/ns/clonable.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -46,5 +46,5 @@
 typedef struct {
 	link_t link;
-	ipcarg_t service;
+	sysarg_t service;
 	ipc_call_t call;
 	ipc_callid_t callid;
@@ -73,5 +73,5 @@
  *
  */
-void register_clonable(ipcarg_t service, ipcarg_t phone, ipc_call_t *call,
+void register_clonable(sysarg_t service, sysarg_t phone, ipc_call_t *call,
     ipc_callid_t callid)
 {
@@ -107,5 +107,5 @@
  *
  */
-void connect_to_clonable(ipcarg_t service, ipc_call_t *call,
+void connect_to_clonable(sysarg_t service, ipc_call_t *call,
     ipc_callid_t callid)
 {
Index: uspace/srv/ns/clonable.h
===================================================================
--- uspace/srv/ns/clonable.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/ns/clonable.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -40,7 +40,7 @@
 
 extern bool service_clonable(int service);
-extern void register_clonable(ipcarg_t service, ipcarg_t phone,
+extern void register_clonable(sysarg_t service, sysarg_t phone,
     ipc_call_t *call, ipc_callid_t callid);
-extern void connect_to_clonable(ipcarg_t service, ipc_call_t *call,
+extern void connect_to_clonable(sysarg_t service, ipc_call_t *call,
     ipc_callid_t callid);
 
Index: uspace/srv/ns/ns.c
===================================================================
--- uspace/srv/ns/ns.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/ns/ns.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -78,5 +78,5 @@
 	}
 	
-	ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ);
+	ipc_answer_2(callid, EOK, (sysarg_t) *addr, AS_AREA_READ);
 }
 
@@ -135,7 +135,7 @@
 		
 		task_id_t id;
-		ipcarg_t retval;
-		
-		switch (IPC_GET_METHOD(call)) {
+		sysarg_t retval;
+		
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_SHARE_IN:
 			switch (IPC_GET_ARG3(call)) {
Index: uspace/srv/ns/service.c
===================================================================
--- uspace/srv/ns/service.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/ns/service.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -43,7 +43,7 @@
 typedef struct {
 	link_t link;
-	ipcarg_t service;        /**< Number of the service. */
-	ipcarg_t phone;          /**< Phone registered with the service. */
-	ipcarg_t in_phone_hash;  /**< Incoming phone hash. */
+	sysarg_t service;        /**< Number of the service. */
+	sysarg_t phone;          /**< Phone registered with the service. */
+	sysarg_t in_phone_hash;  /**< Incoming phone hash. */
 } hashed_service_t;
 
@@ -115,8 +115,8 @@
 typedef struct {
 	link_t link;
-	ipcarg_t service;        /**< Number of the service. */
+	sysarg_t service;        /**< Number of the service. */
 	ipc_callid_t callid;     /**< Call ID waiting for the connection */
-	ipcarg_t arg2;           /**< Second argument */
-	ipcarg_t arg3;           /**< Third argument */
+	sysarg_t arg2;           /**< Second argument */
+	sysarg_t arg3;           /**< Third argument */
 } pending_conn_t;
 
@@ -174,5 +174,5 @@
  *
  */
-int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call)
+int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call)
 {
 	unsigned long keys[3] = {
@@ -207,7 +207,7 @@
  *
  */
-void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid)
-{
-	ipcarg_t retval;
+void connect_to_service(sysarg_t service, ipc_call_t *call, ipc_callid_t callid)
+{
+	sysarg_t retval;
 	unsigned long keys[3] = {
 		service,
Index: uspace/srv/ns/service.h
===================================================================
--- uspace/srv/ns/service.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/ns/service.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -39,6 +39,6 @@
 extern void process_pending_conn(void);
 
-extern int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call);
-extern void connect_to_service(ipcarg_t service, ipc_call_t *call,
+extern int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call);
+extern void connect_to_service(sysarg_t service, ipc_call_t *call,
      ipc_callid_t callid);
 
Index: uspace/srv/ns/task.c
===================================================================
--- uspace/srv/ns/task.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/ns/task.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -45,5 +45,5 @@
 #define P2I_HASH_TABLE_CHAINS  256
 
-static int get_id_by_phone(ipcarg_t phone_hash, task_id_t *id);
+static int get_id_by_phone(sysarg_t phone_hash, task_id_t *id);
 
 /* TODO:
@@ -124,5 +124,5 @@
 typedef struct {
 	link_t link;
-	ipcarg_t phash;    /**< Task ID. */
+	sysarg_t phash;    /**< Task ID. */
 	task_id_t id;    /**< Task ID. */
 } p2i_entry_t;
@@ -248,5 +248,5 @@
 void wait_for_task(task_id_t id, ipc_call_t *call, ipc_callid_t callid)
 {
-	ipcarg_t retval;
+	sysarg_t retval;
 	task_exit_t texit;
 
@@ -393,5 +393,5 @@
 }
 
-static int get_id_by_phone(ipcarg_t phone_hash, task_id_t *id)
+static int get_id_by_phone(sysarg_t phone_hash, task_id_t *id)
 {
 	unsigned long keys[1];
Index: uspace/srv/vfs/vfs.c
===================================================================
--- uspace/srv/vfs/vfs.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/vfs/vfs.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -73,5 +73,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 		
-		switch (IPC_GET_METHOD(call)) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
 			keep_on_going = false;
@@ -173,5 +173,5 @@
 	 * Register at the naming service.
 	 */
-	ipcarg_t phonead;
+	sysarg_t phonead;
 	ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, 0, &phonead);
 	
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/vfs/vfs.h	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -54,5 +54,5 @@
 	fs_handle_t fs_handle;
 	fibril_mutex_t phone_lock;
-	ipcarg_t phone;
+	sysarg_t phone;
 } fs_info_t;
 
Index: uspace/srv/vfs/vfs_lookup.c
===================================================================
--- uspace/srv/vfs/vfs_lookup.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/vfs/vfs_lookup.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -161,10 +161,10 @@
 	ipc_call_t answer;
 	int phone = vfs_grab_phone(root->fs_handle);
-	aid_t req = async_send_5(phone, VFS_OUT_LOOKUP, (ipcarg_t) first,
-	    (ipcarg_t) (first + len - 1) % PLB_SIZE,
-	    (ipcarg_t) root->devmap_handle, (ipcarg_t) lflag, (ipcarg_t) index,
+	aid_t req = async_send_5(phone, VFS_OUT_LOOKUP, (sysarg_t) first,
+	    (sysarg_t) (first + len - 1) % PLB_SIZE,
+	    (sysarg_t) root->devmap_handle, (sysarg_t) lflag, (sysarg_t) index,
 	    &answer);
 	
-	ipcarg_t rc;
+	sysarg_t rc;
 	async_wait_for(req, &rc);
 	vfs_release_phone(root->fs_handle, phone);
@@ -213,8 +213,8 @@
 	ipc_call_t answer;
 	aid_t req = async_send_2(phone, VFS_OUT_OPEN_NODE,
-	    (ipcarg_t) result->triplet.devmap_handle,
-	    (ipcarg_t) result->triplet.index, &answer);
-	
-	ipcarg_t rc;
+	    (sysarg_t) result->triplet.devmap_handle,
+	    (sysarg_t) result->triplet.index, &answer);
+	
+	sysarg_t rc;
 	async_wait_for(req, &rc);
 	vfs_release_phone(result->triplet.fs_handle, phone);
Index: uspace/srv/vfs/vfs_node.c
===================================================================
--- uspace/srv/vfs/vfs_node.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/vfs/vfs_node.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -129,7 +129,7 @@
 		 */
 		int phone = vfs_grab_phone(node->fs_handle);
-		ipcarg_t rc;
+		sysarg_t rc;
 		rc = async_req_2_0(phone, VFS_OUT_DESTROY,
-		    (ipcarg_t)node->devmap_handle, (ipcarg_t)node->index);
+		    (sysarg_t)node->devmap_handle, (sysarg_t)node->index);
 		assert(rc == EOK);
 		vfs_release_phone(node->fs_handle, phone);
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/vfs/vfs_ops.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -79,5 +79,5 @@
 	size_t rsize;
 	unsigned rlnkcnt;
-	ipcarg_t rc;
+	sysarg_t rc;
 	int phone;
 	aid_t msg;
@@ -126,5 +126,5 @@
 			phone = vfs_grab_phone(fs_handle);
 			msg = async_send_1(phone, VFS_OUT_MOUNTED,
-			    (ipcarg_t) devmap_handle, &answer);
+			    (sysarg_t) devmap_handle, &answer);
 			/* send the mount options */
 			rc = async_data_write_start(phone, (void *)opts,
@@ -188,8 +188,8 @@
 	phone = vfs_grab_phone(mp_res.triplet.fs_handle);
 	msg = async_send_4(phone, VFS_OUT_MOUNT,
-	    (ipcarg_t) mp_res.triplet.devmap_handle,
-	    (ipcarg_t) mp_res.triplet.index,
-	    (ipcarg_t) fs_handle,
-	    (ipcarg_t) devmap_handle, &answer);
+	    (sysarg_t) mp_res.triplet.devmap_handle,
+	    (sysarg_t) mp_res.triplet.index,
+	    (sysarg_t) fs_handle,
+	    (sysarg_t) devmap_handle, &answer);
 	
 	/* send connection */
@@ -309,5 +309,5 @@
 	ipc_call_t data;
 	ipc_callid_t callid = async_get_call(&data);
-	if (IPC_GET_METHOD(data) != IPC_M_PING) {
+	if (IPC_GET_IMETHOD(data) != IPC_M_PING) {
 		ipc_answer_0(callid, ENOTSUP);
 		ipc_answer_0(rid, ENOTSUP);
@@ -716,5 +716,5 @@
 
 	/* Wait for reply from the FS server. */
-	ipcarg_t rc;
+	sysarg_t rc;
 	async_wait_for(msg, &rc);
 	
@@ -747,5 +747,5 @@
 		
 		/* Wait for reply from the FS server. */
-		ipcarg_t rc;
+		sysarg_t rc;
 		async_wait_for(msg, &rc);
 		
@@ -839,5 +839,5 @@
 	 * don't have to bother.
 	 */
-	ipcarg_t rc;
+	sysarg_t rc;
 	ipc_call_t answer;
 	if (read) {
@@ -973,10 +973,10 @@
     fs_index_t index, aoff64_t size)
 {
-	ipcarg_t rc;
+	sysarg_t rc;
 	int fs_phone;
 	
 	fs_phone = vfs_grab_phone(fs_handle);
-	rc = async_req_4_0(fs_phone, VFS_OUT_TRUNCATE, (ipcarg_t) devmap_handle,
-	    (ipcarg_t) index, LOWER32(size), UPPER32(size));
+	rc = async_req_4_0(fs_phone, VFS_OUT_TRUNCATE, (sysarg_t) devmap_handle,
+	    (sysarg_t) index, LOWER32(size), UPPER32(size));
 	vfs_release_phone(fs_handle, fs_phone);
 	return (int)rc;
@@ -1005,5 +1005,5 @@
 
 	fibril_mutex_unlock(&file->lock);
-	ipc_answer_0(rid, (ipcarg_t)rc);
+	ipc_answer_0(rid, (sysarg_t)rc);
 }
 
@@ -1011,5 +1011,5 @@
 {
 	int fd = IPC_GET_ARG1(*request);
-	ipcarg_t rc;
+	sysarg_t rc;
 
 	vfs_file_t *file = vfs_file_get(fd);
@@ -1084,5 +1084,5 @@
 	ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
 	
-	ipcarg_t rv;
+	sysarg_t rv;
 	async_wait_for(msg, &rv);
 	vfs_release_phone(node->fs_handle, fs_phone);
Index: uspace/srv/vfs/vfs_register.c
===================================================================
--- uspace/srv/vfs/vfs_register.c	(revision cead2aabcdb4b57d944c23991ca13715b88348f5)
+++ uspace/srv/vfs/vfs_register.c	(revision 8b4e203e814436ee0c71d7631df8ffdd38fc11b2)
@@ -177,6 +177,6 @@
 	ipc_call_t call;
 	ipc_callid_t callid = async_get_call(&call);
-	if (IPC_GET_METHOD(call) != IPC_M_CONNECT_TO_ME) {
-		dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call));
+	if (IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) {
+		dprintf("Unexpected call, method = %d\n", IPC_GET_IMETHOD(call));
 		list_remove(&fs_info->fs_link);
 		fibril_mutex_unlock(&fs_head_lock);
@@ -197,5 +197,5 @@
 	size_t size;
 	if (!async_share_in_receive(&callid, &size)) {
-		dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call));
+		dprintf("Unexpected call, method = %d\n", IPC_GET_IMETHOD(call));
 		list_remove(&fs_info->fs_link);
 		fibril_mutex_unlock(&fs_head_lock);
@@ -235,5 +235,5 @@
 	 */
 	fs_info->fs_handle = (fs_handle_t) atomic_postinc(&fs_handle_next);
-	ipc_answer_1(rid, EOK, (ipcarg_t) fs_info->fs_handle);
+	ipc_answer_1(rid, EOK, (sysarg_t) fs_info->fs_handle);
 	
 	fibril_condvar_broadcast(&fs_head_cv);
