Index: .bzrignore
===================================================================
--- .bzrignore	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ .bzrignore	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -45,5 +45,4 @@
 uspace/app/nettest2/nettest2
 uspace/app/nettest3/nettest3
-uspace/app/nic/nic
 uspace/app/nterm/nterm
 uspace/app/ping/ping
@@ -95,5 +94,4 @@
 uspace/dist/app/nettest2
 uspace/dist/app/nettest3
-uspace/dist/app/nic
 uspace/dist/app/nterm
 uspace/dist/app/ping
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ boot/Makefile.common	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -190,5 +190,4 @@
 	$(USPACE_PATH)/app/mkexfat/mkexfat \
 	$(USPACE_PATH)/app/mkmfs/mkmfs \
-	$(USPACE_PATH)/app/nic/nic \
 	$(USPACE_PATH)/app/sbi/sbi \
 	$(USPACE_PATH)/app/sportdmp/sportdmp \
Index: kernel/arch/amd64/Makefile.inc
===================================================================
--- kernel/arch/amd64/Makefile.inc	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ kernel/arch/amd64/Makefile.inc	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -32,5 +32,5 @@
 
 FPU_NO_CFLAGS = -mno-sse -mno-sse2
-CMN1 = -m64 -mcmodel=kernel -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer
+CMN1 = -m64 -mcmodel=large -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer
 GCC_CFLAGS += $(CMN1)
 ICC_CFLAGS += $(CMN1)
Index: kernel/arch/amd64/include/arch/mm/km.h
===================================================================
--- kernel/arch/amd64/include/arch/mm/km.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ kernel/arch/amd64/include/arch/mm/km.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -38,9 +38,9 @@
 #include <typedefs.h>
 
-#define KM_AMD64_IDENTITY_START		UINT64_C(0xffffffff80000000)
-#define KM_AMD64_IDENTITY_SIZE		UINT64_C(0x0000000080000000)
+#define KM_AMD64_IDENTITY_START		UINT64_C(0xffff800000000000)
+#define KM_AMD64_IDENTITY_SIZE		UINT64_C(0x0000400000000000)
 
-#define KM_AMD64_NON_IDENTITY_START	UINT64_C(0xffff800000000000)
-#define KM_AMD64_NON_IDENTITY_SIZE	UINT64_C(0x00007fff80000000)
+#define KM_AMD64_NON_IDENTITY_START	UINT64_C(0xffffc00000000000)
+#define KM_AMD64_NON_IDENTITY_SIZE	UINT64_C(0x0000400000000000)
 
 extern void km_identity_arch_init(void);
Index: kernel/arch/amd64/include/arch/mm/page.h
===================================================================
--- kernel/arch/amd64/include/arch/mm/page.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ kernel/arch/amd64/include/arch/mm/page.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -44,11 +44,11 @@
 #ifndef __ASM__
 
-#define KA2PA(x)  (((uintptr_t) (x)) - UINT64_C(0xffffffff80000000))
-#define PA2KA(x)  (((uintptr_t) (x)) + UINT64_C(0xffffffff80000000))
+#define KA2PA(x)  (((uintptr_t) (x)) - UINT64_C(0xffff800000000000))
+#define PA2KA(x)  (((uintptr_t) (x)) + UINT64_C(0xffff800000000000))
 
 #else /* __ASM__ */
 
-#define KA2PA(x)  ((x) - 0xffffffff80000000)
-#define PA2KA(x)  ((x) + 0xffffffff80000000)
+#define KA2PA(x)  ((x) - 0xffff800000000000)
+#define PA2KA(x)  ((x) + 0xffff800000000000)
 
 #endif /* __ASM__ */
Index: kernel/arch/amd64/src/boot/multiboot.S
===================================================================
--- kernel/arch/amd64/src/boot/multiboot.S	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ kernel/arch/amd64/src/boot/multiboot.S	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -428,12 +428,17 @@
 	
 	/* Call arch_pre_main(multiboot_eax, multiboot_ebx) */
+	xorq %rdi, %rdi
 	movl multiboot_eax, %edi
+	xorq %rsi, %rsi
 	movl multiboot_ebx, %esi
-	callq arch_pre_main
-
+	
+	movabsq $arch_pre_main, %rax
+	callq *%rax
+	
 	long_status $status_main
 	
 	/* Call main_bsp() */
-	callq main_bsp 
+	movabsq $main_bsp, %rax
+	call *%rax
 	
 	/* Not reached */
@@ -633,9 +638,5 @@
 	.quad ptl_2_6g + (PTL_WRITABLE | PTL_PRESENT)
 	.quad ptl_2_7g + (PTL_WRITABLE | PTL_PRESENT)
-	.fill 502, 8, 0
-	/* Mapping of [0; 2G) at -2G */
-	.quad ptl_2_0g + (PTL_WRITABLE | PTL_PRESENT)
-	.quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT)
-
+	.fill 504, 8, 0
 
 .align 4096
@@ -643,6 +644,7 @@
 ptl_0:
 	.quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)
-	.fill 510, 8, 0
+	.fill 255, 8, 0
 	.quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)
+	.fill 255, 8, 0
 
 .section K_DATA_START, "aw", @progbits
Index: kernel/arch/amd64/src/boot/multiboot2.S
===================================================================
--- kernel/arch/amd64/src/boot/multiboot2.S	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ kernel/arch/amd64/src/boot/multiboot2.S	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -244,10 +244,15 @@
 	
 	/* Call arch_pre_main(multiboot_eax, multiboot_ebx) */
+	xorq %rdi, %rdi
 	movl multiboot_eax, %edi
+	xorq %rsi, %rsi
 	movl multiboot_ebx, %esi
-	callq arch_pre_main 
+	
+	movabsq $arch_pre_main, %rax
+	callq *%rax
 	
 	/* Call main_bsp() */
-	callq main_bsp 
+	movabsq $main_bsp, %rax
+	call *%rax
 	
 	/* Not reached */
Index: kernel/arch/amd64/src/mm/km.c
===================================================================
--- kernel/arch/amd64/src/mm/km.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ kernel/arch/amd64/src/mm/km.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -40,5 +40,5 @@
 {
 	config.identity_base = KM_AMD64_IDENTITY_START;
-	config.identity_size = KM_AMD64_IDENTITY_SIZE;
+	config.identity_size = KM_AMD64_IDENTITY_SIZE;	
 }
 
Index: kernel/genarch/src/mm/page_pt.c
===================================================================
--- kernel/genarch/src/mm/page_pt.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ kernel/genarch/src/mm/page_pt.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -384,15 +384,4 @@
 	    addr - 1 < base + size - 1;
 	    addr += ptl0_step) {
-		if (GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(addr))) {
-			ASSERT(overlaps(addr, ptl0_step,
-			    config.identity_base, config.identity_size));
-
-			/*
-			 * This PTL0 entry also maps the kernel identity region,
-			 * so it is already global and initialized.
-			 */
-			continue;
-		}
-
 		uintptr_t l1 = PA2KA(frame_alloc(frames, FRAME_LOWMEM, 0));
 		memsetb((void *) l1, FRAMES2SIZE(frames), 0);
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/Makefile	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -77,5 +77,4 @@
 	app/nettest2 \
 	app/nettest3 \
-	app/nic \
 	app/ping \
 	app/sysinfo \
Index: uspace/app/mixerctl/mixerctl.c
===================================================================
--- uspace/app/mixerctl/mixerctl.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/app/mixerctl/mixerctl.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -35,11 +35,11 @@
 #include <assert.h>
 #include <errno.h>
-#include <loc.h>
 #include <str_error.h>
 #include <str.h>
+#include <devman.h>
 #include <audio_mixer_iface.h>
 #include <stdio.h>
 
-#define DEFAULT_SERVICE "devices/\\hw\\pci0\\00:01.0\\sb16\\control"
+#define DEFAULT_DEVICE "/hw/pci0/00:01.0/sb16/control"
 
 /**
@@ -128,5 +128,5 @@
 int main(int argc, char *argv[])
 {
-	const char *service = DEFAULT_SERVICE;
+	const char *device = DEFAULT_DEVICE;
 	void (*command)(async_exch_t *, int, char*[]) = NULL;
 
@@ -134,5 +134,5 @@
 		command = set_level;
 		if (argc == 5)
-			service = argv[1];
+			device = argv[1];
 	}
 
@@ -140,23 +140,23 @@
 		command = get_level;
 		if (argc == 4)
-			service = argv[1];
+			device = argv[1];
 	}
 
 	if ((argc == 2 && command == NULL))
-		service = argv[1];
+		device = argv[1];
 
 
-	service_id_t mixer_sid;
-	int rc = loc_service_get_id(service, &mixer_sid, 0);
-	if (rc != EOK) {
-		printf("Failed to resolve service '%s': %s.\n",
-		    service, str_error(rc));
+	devman_handle_t mixer_handle;
+	int ret = devman_fun_get_handle(device, &mixer_handle, 0);
+	if (ret != EOK) {
+		printf("Failed to get device(%s) handle: %s.\n",
+		    device, str_error(ret));
 		return 1;
 	}
 
-	async_sess_t *session = loc_service_connect(
-	    EXCHANGE_ATOMIC, mixer_sid, 0);
+	async_sess_t *session = devman_device_connect(
+	    EXCHANGE_ATOMIC, mixer_handle, IPC_FLAG_BLOCKING);
 	if (!session) {
-		printf("Failed connecting mixer service '%s'.\n", service);
+		printf("Failed to connect to device.\n");
 		return 1;
 	}
Index: pace/app/nic/Makefile
===================================================================
--- uspace/app/nic/Makefile	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#
-# Copyright (c) 2014 Jiri Svoboda
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-USPACE_PREFIX = ../..
-BINARY = nic
-EXTRA_CFLAGS = -I$(LIBDRV_PREFIX)/include
-LIBS = $(LIBDRV_PREFIX)/libdrv.a
-
-SOURCES = \
-	nic.c
-
-include $(USPACE_PREFIX)/Makefile.common
Index: pace/app/nic/nic.c
===================================================================
--- uspace/app/nic/nic.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ 	(revision )
@@ -1,185 +1,0 @@
-/*
- * Copyright (c) 2014 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup nic
- * @{
- */
-/** @file NIC configuration utility.
- *
- */
-
-#include <errno.h>
-#include <loc.h>
-#include <nic_iface.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <str_error.h>
-#include <sys/types.h>
-
-#define NAME  "nic"
-
-typedef struct {
-	nic_address_t address;
-	nic_cable_state_t link_state;
-} nic_info_t;
-
-static void print_syntax(void)
-{
-	printf("syntax:\n");
-	printf("\t" NAME "\n");
-}
-
-static int nic_get_info(service_id_t svc_id, char *svc_name,
-    nic_info_t *info)
-{
-	async_sess_t *sess;
-	int rc;
-
-	sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id, 0);
-	if (sess == NULL) {
-		printf("Error connecting '%s'.\n", svc_name);
-		rc = EIO;
-		goto error;
-	}
-
-	rc = nic_get_address(sess, &info->address);
-	if (rc != EOK) {
-		printf("Error getting NIC address.\n");
-		rc = EIO;
-		goto error;
-	}
-
-	rc = nic_get_cable_state(sess, &info->link_state);
-	if (rc != EOK) {
-		printf("Error getting link state.\n");
-		rc = EIO;
-		goto error;
-	}
-
-	return EOK;
-error:
-	return rc;
-}
-
-static const char *nic_link_state_str(nic_cable_state_t link_state)
-{
-	switch (link_state) {
-	case NIC_CS_UNKNOWN: return "unknown";
-	case NIC_CS_PLUGGED: return "up";
-	case NIC_CS_UNPLUGGED: return "down";
-	default: assert(false); return NULL;
-	}
-}
-
-static char *nic_addr_format(nic_address_t *a)
-{
-	int rc;
-	char *s;
-
-	rc = asprintf(&s, "%02x:%02x:%02x:%02x:%02x:%02x",
-	    a->address[0], a->address[1], a->address[2],
-	    a->address[3], a->address[4], a->address[5]);
-	if (rc < 0)
-		return NULL;
-
-	return s;
-}
-
-static int nic_list(void)
-{
-	category_id_t nic_cat;
-	service_id_t *nics = NULL;
-	nic_info_t nic_info;
-	size_t count, i;
-	char *svc_name;
-	char *addr_str;
-	int rc;
-
-	rc = loc_category_get_id("nic", &nic_cat, 0);
-	if (rc != EOK) {
-		printf("Error resolving category 'nic'.\n");
-		goto error;
-	}
-
-	rc = loc_category_get_svcs(nic_cat, &nics, &count);
-	if (rc != EOK) {
-		printf("Error getting list of NICs.\n");
-		goto error;
-	}
-
-	printf("[Address] [Link State] [Service Name]\n");
-	for (i = 0; i < count; i++) {
-		rc = loc_service_get_name(nics[i], &svc_name);
-		if (rc != EOK) {
-			printf("Error getting service name.\n");
-			goto error;
-		}
-
-		rc = nic_get_info(nics[i], svc_name, &nic_info);
-		if (rc != EOK)
-			goto error;
-
-		addr_str = nic_addr_format(&nic_info.address);
-		if (addr_str == NULL) {
-			printf("Out of memory.\n");
-			rc = ENOMEM;
-			goto error;
-		}
-
-		printf("%s %s %s\n", addr_str,
-		    nic_link_state_str(nic_info.link_state), svc_name);
-
-		free(svc_name);
-		free(addr_str);
-	}
-
-	return EOK;
-error:
-	free(nics);
-	return rc;
-}
-
-int main(int argc, char *argv[])
-{
-	int rc;
-
-	if (argc == 1) {
-		rc = nic_list();
-		if (rc != EOK)
-			return 1;
-	} else {
-		printf(NAME ": Invalid argument.\n");
-		print_syntax();
-		return 1;
-	}
-
-	return 0;
-}
-
-/** @}
- */
Index: uspace/app/taskdump/Makefile
===================================================================
--- uspace/app/taskdump/Makefile	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/app/taskdump/Makefile	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -33,5 +33,4 @@
 SOURCES = \
 	elf_core.c \
-	fibrildump.c \
 	taskdump.c \
 	symtab.c
Index: pace/app/taskdump/fibrildump.c
===================================================================
--- uspace/app/taskdump/fibrildump.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ 	(revision )
@@ -1,115 +1,0 @@
-/*
- * Copyright (c) 2014 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup taskdump
- * @{
- */
-/** @file
- */
-
-#include <errno.h>
-#include <fibril.h>
-#include <fibrildump.h>
-#include <stacktrace.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <symtab.h>
-#include <taskdump.h>
-#include <udebug.h>
-
-static int fibrildump_read_uintptr(void *, uintptr_t, uintptr_t *);
-
-static stacktrace_ops_t fibrildump_st_ops = {
-	.read_uintptr = fibrildump_read_uintptr
-}; 
-
-static int fibrildump_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data)
-{
-	async_sess_t *sess = (async_sess_t *)arg;
-
-	return udebug_mem_read(sess, data, addr, sizeof(uintptr_t));
-}
-
-static int read_link(async_sess_t *sess, uintptr_t addr, link_t *link)
-{
-	int rc;
-
-	rc = udebug_mem_read(sess, (void *)link, addr, sizeof(link_t));
-	return rc;
-}
-
-static int read_fibril(async_sess_t *sess, uintptr_t addr, fibril_t *fibril)
-{
-	int rc;
-
-	rc = udebug_mem_read(sess, (void *)fibril, addr, sizeof(fibril_t));
-	return rc;
-}
-
-int fibrils_dump(symtab_t *symtab, async_sess_t *sess)
-{
-	uintptr_t fibril_list_addr;
-	link_t link;
-	fibril_t fibril;
-	uintptr_t addr, fibril_addr;
-	uintptr_t pc, fp;
-	int rc;
-
-	rc = symtab_name_to_addr(symtab, "fibril_list", &fibril_list_addr);
-	if (rc != EOK)
-		return EIO;
-
-	addr = fibril_list_addr;
-	while (true) {
-		rc = read_link(sess, addr, &link);
-		if (rc != EOK)
-			return EIO;
-
-		addr = (uintptr_t) link.next;
-		if (addr == fibril_list_addr)
-			break;
-
-		fibril_addr = (uintptr_t) list_get_instance((void *)addr,
-		    fibril_t, all_link);
-		printf("Fibril %p:\n", (void *) fibril_addr);
-		rc = read_fibril(sess, fibril_addr, &fibril);
-		if (rc != EOK)
-			return EIO;
-
-		pc = fibril.ctx.pc;
-		fp = context_get_fp(&fibril.ctx);
-		if (0) stacktrace_print_generic(&fibrildump_st_ops, sess,
-		    fp, pc);
-		td_stacktrace(fp, pc);
-	}
-
-	return EOK;
-}
-
-/** @}
- */
Index: pace/app/taskdump/include/fibrildump.h
===================================================================
--- uspace/app/taskdump/include/fibrildump.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2014 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup edit
- * @{
- */
-/**
- * @file
- */
-
-#ifndef FIBRILDUMP_H
-#define FIBRILDUMP_H
-
-#include <async.h>
-#include <symtab.h>
-
-extern int fibrils_dump(symtab_t *, async_sess_t *sess);
-
-#endif
-
-/** @}
- */
Index: uspace/app/taskdump/include/symtab.h
===================================================================
--- uspace/app/taskdump/include/symtab.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/app/taskdump/include/symtab.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -50,5 +50,5 @@
 extern int symtab_load(const char *file_name, symtab_t **symtab);
 extern void symtab_delete(symtab_t *st);
-extern int symtab_name_to_addr(symtab_t *st, const char *name, uintptr_t *addr);
+extern int symtab_name_to_addr(symtab_t *st, char *name, uintptr_t *addr);
 extern int symtab_addr_to_name(symtab_t *symtab, uintptr_t addr, char **name,
     size_t *offs);
Index: pace/app/taskdump/include/taskdump.h
===================================================================
--- uspace/app/taskdump/include/taskdump.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2014 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup edit
- * @{
- */
-/**
- * @file
- */
-
-#ifndef TASKDUMP_H
-#define TASKDUMP_H
-
-#include <stdint.h>
-
-extern int td_stacktrace(uintptr_t, uintptr_t);
-
-#endif
-
-/** @}
- */
Index: uspace/app/taskdump/symtab.c
===================================================================
--- uspace/app/taskdump/symtab.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/app/taskdump/symtab.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -202,5 +202,5 @@
  * @return	EOK on success, ENOENT if no such symbol was found.
  */
-int symtab_name_to_addr(symtab_t *st, const char *name, uintptr_t *addr)
+int symtab_name_to_addr(symtab_t *st, char *name, uintptr_t *addr)
 {
 	size_t i;
Index: uspace/app/taskdump/taskdump.c
===================================================================
--- uspace/app/taskdump/taskdump.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/app/taskdump/taskdump.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -35,5 +35,4 @@
 #include <async.h>
 #include <elf/elf_linux.h>
-#include <fibrildump.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -53,5 +52,4 @@
 #include <elf_core.h>
 #include <stacktrace.h>
-#include <taskdump.h>
 
 #define LINE_BYTES 16
@@ -78,8 +76,4 @@
 static istate_t reg_state;
 
-static stacktrace_ops_t td_stacktrace_ops = {
-	.read_uintptr = td_read_uintptr
-}; 
-
 int main(int argc, char *argv[])
 {
@@ -112,8 +106,4 @@
 	if (rc < 0)
 		printf("Failed dumping address space areas.\n");
-
-	rc = fibrils_dump(app_symtab, sess);
-	if (rc < 0)
-		printf("Failed dumping fibrils.\n");
 
 	udebug_end(sess);
@@ -321,13 +311,31 @@
 }
 
-int td_stacktrace(uintptr_t fp, uintptr_t pc)
-{
-	uintptr_t nfp;
+static int thread_dump(uintptr_t thash)
+{
+	istate_t istate;
+	uintptr_t pc, fp, nfp;
 	stacktrace_t st;
 	char *sym_pc;
 	int rc;
 
+	rc = udebug_regs_read(sess, thash, &istate);
+	if (rc < 0) {
+		printf("Failed reading registers (%d).\n", rc);
+		return EIO;
+	}
+
+	pc = istate_get_pc(&istate);
+	fp = istate_get_fp(&istate);
+
+	/* Save register state for dumping to core file later. */
+	reg_state = istate;
+
+	sym_pc = fmt_sym_address(pc);
+	printf("Thread %p: PC = %s. FP = %p\n", (void *) thash,
+	    sym_pc, (void *) fp);
+	free(sym_pc);
+
 	st.op_arg = NULL;
-	st.ops = &td_stacktrace_ops;
+	st.read_uintptr = td_read_uintptr;
 
 	while (stacktrace_fp_valid(&st, fp)) {
@@ -346,33 +354,4 @@
 		fp = nfp;
 	}
-
-	return EOK;
-}
-
-static int thread_dump(uintptr_t thash)
-{
-	istate_t istate;
-	uintptr_t pc, fp;
-	char *sym_pc;
-	int rc;
-
-	rc = udebug_regs_read(sess, thash, &istate);
-	if (rc < 0) {
-		printf("Failed reading registers (%d).\n", rc);
-		return EIO;
-	}
-
-	pc = istate_get_pc(&istate);
-	fp = istate_get_fp(&istate);
-
-	/* Save register state for dumping to core file later. */
-	reg_state = istate;
-
-	sym_pc = fmt_sym_address(pc);
-	printf("Thread %p: PC = %s. FP = %p\n", (void *) thash,
-	    sym_pc, (void *) fp);
-	free(sym_pc);
-
-	(void) td_stacktrace(fp, pc);
 
 	return EOK;
Index: uspace/app/vlaunch/vlaunch.c
===================================================================
--- uspace/app/vlaunch/vlaunch.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/app/vlaunch/vlaunch.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -200,5 +200,5 @@
 	}
 	
-	timer = fibril_timer_create(NULL);
+	timer = fibril_timer_create();
 	if (!timer) {
 		printf("Unable to create timer.\n");
Index: uspace/drv/bus/isa/isa.c
===================================================================
--- uspace/drv/bus/isa/isa.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/drv/bus/isa/isa.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -355,5 +355,5 @@
 
 	/* Get the name part of the rest of the line. */
-	str_tok(line, ":", NULL);
+	strtok(line, ":");
 	return line;
 }
Index: uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
===================================================================
--- uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -34,5 +34,4 @@
  */
 
-#include <align.h>
 #include <assert.h>
 #include <errno.h>
Index: uspace/drv/fb/amdm37x_dispc/main.c
===================================================================
--- uspace/drv/fb/amdm37x_dispc/main.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/drv/fb/amdm37x_dispc/main.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -35,9 +35,9 @@
  */
 
-#include <ddf/driver.h>
 #include <ddf/log.h>
 #include <errno.h>
 #include <str_error.h>
 #include <stdio.h>
+#include <ops/graph_dev.h>
 #include <graph.h>
 
@@ -46,11 +46,11 @@
 #define NAME  "amdm37x_dispc"
 
-static void graph_vsl_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
-{
-	visualizer_t *vsl;
+static graph_dev_ops_t graph_vsl_dev_ops = {
+	.connect = (connect_func) &graph_visualizer_connection
+};
 
-	vsl = (visualizer_t *) ddf_fun_data_get((ddf_fun_t *)arg);
-	graph_visualizer_connection(vsl, iid, icall, NULL);
-}
+static ddf_dev_ops_t graph_fun_ops = {
+	.interfaces[GRAPH_DEV_IFACE] = &graph_vsl_dev_ops
+};
 
 static int amdm37x_dispc_dev_add(ddf_dev_t *dev)
@@ -74,5 +74,5 @@
 	vis->reg_svc_handle = ddf_fun_get_handle(fun);
 
-	ddf_fun_set_conn_handler(fun, graph_vsl_connection);
+	ddf_fun_set_ops(fun, &graph_fun_ops);
 	/* Hw part */
 	amdm37x_dispc_t *dispc =
Index: uspace/drv/fb/kfb/kfb.c
===================================================================
--- uspace/drv/fb/kfb/kfb.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/drv/fb/kfb/kfb.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -40,4 +40,5 @@
 #include <task.h>
 #include <graph.h>
+#include <ops/graph_dev.h>
 #include "port.h"
 #include "kfb.h"
@@ -59,4 +60,20 @@
 };
 
+static graph_dev_ops_t graph_vsl_dev_ops = {
+	.connect = (connect_func) &graph_visualizer_connection
+};
+
+ddf_dev_ops_t graph_vsl_device_ops = {
+	.interfaces[GRAPH_DEV_IFACE] = &graph_vsl_dev_ops
+};
+
+static graph_dev_ops_t graph_rnd_dev_ops = {
+	.connect = (connect_func) &graph_renderer_connection
+};
+
+ddf_dev_ops_t graph_rnd_device_ops = {
+	.interfaces[GRAPH_DEV_IFACE] = &graph_rnd_dev_ops
+};
+
 int main(int argc, char *argv[])
 {
Index: uspace/drv/fb/kfb/port.c
===================================================================
--- uspace/drv/fb/kfb/port.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/drv/fb/kfb/port.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -207,12 +207,4 @@
 };
 
-static void graph_vsl_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
-{
-	visualizer_t *vsl;
-
-	vsl = (visualizer_t *) ddf_fun_data_get((ddf_fun_t *)arg);
-	graph_visualizer_connection(vsl, iid, icall, NULL);
-}
-
 int port_init(ddf_dev_t *dev)
 {
@@ -354,5 +346,5 @@
 		return ENOMEM;
 	}
-	ddf_fun_set_conn_handler(fun_vs, &graph_vsl_connection);
+	ddf_fun_set_ops(fun_vs, &graph_vsl_device_ops);
 
 	visualizer_t *vs = ddf_fun_data_alloc(fun_vs, sizeof(visualizer_t));
Index: uspace/lib/c/arch/amd64/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/amd64/src/stacktrace.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/arch/amd64/src/stacktrace.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -51,10 +51,10 @@
 int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
 }
 
 int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
 }
 
Index: uspace/lib/c/arch/arm32/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/arm32/src/stacktrace.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/arch/arm32/src/stacktrace.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -51,10 +51,10 @@
 int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
 }
 
 int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
 }
 
Index: uspace/lib/c/arch/ia32/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/ia32/src/stacktrace.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/arch/ia32/src/stacktrace.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -51,10 +51,10 @@
 int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
 }
 
 int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
 }
 
Index: uspace/lib/c/arch/ppc32/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/ppc32/src/stacktrace.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/arch/ppc32/src/stacktrace.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -51,10 +51,10 @@
 int stacktrace_fp_prev(stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, prev);
 }
 
 int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
 }
 
Index: uspace/lib/c/arch/sparc32/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/sparc32/src/stacktrace.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/arch/sparc32/src/stacktrace.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -53,5 +53,5 @@
 {
 	uintptr_t bprev;
-	int rc = (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV,
+	int rc = (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV,
 	    &bprev);
 	if (rc == EOK)
@@ -63,5 +63,5 @@
 int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
 }
 
Index: uspace/lib/c/arch/sparc64/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/sparc64/src/stacktrace.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/arch/sparc64/src/stacktrace.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -55,5 +55,5 @@
 	int rc;
 
-	rc = (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, &bprev);
+	rc = (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_FP_PREV, &bprev);
 	if (rc == EOK)
 		*prev = bprev + STACK_BIAS;
@@ -63,5 +63,5 @@
 int stacktrace_ra_get(stacktrace_t *st, uintptr_t fp, uintptr_t *ra)
 {
-	return (*st->ops->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
+	return (*st->read_uintptr)(st->op_arg, fp + FRAME_OFFSET_RA, ra);
 }
 
Index: uspace/lib/c/generic/fibril.c
===================================================================
--- uspace/lib/c/generic/fibril.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/generic/fibril.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -59,5 +59,4 @@
 static LIST_INITIALIZE(serialized_list);
 static LIST_INITIALIZE(manager_list);
-static LIST_INITIALIZE(fibril_list);
 
 /** Number of threads that are executing a manager fibril. */
@@ -117,5 +116,4 @@
 	
 	fibril->waits_for = NULL;
-	list_append(&fibril->all_link, &fibril_list);
 	
 	return fibril;
@@ -124,5 +122,4 @@
 void fibril_teardown(fibril_t *fibril)
 {
-	list_remove(&fibril->all_link);
 	tls_free(fibril->tcb);
 	free(fibril);
Index: uspace/lib/c/generic/fibril_synch.c
===================================================================
--- uspace/lib/c/generic/fibril_synch.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/generic/fibril_synch.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -448,36 +448,30 @@
 	int rc;
 
-	fibril_mutex_lock(timer->lockp);
-
-	while (timer->state != fts_cleanup) {
-		switch (timer->state) {
-		case fts_not_set:
-		case fts_fired:
-			fibril_condvar_wait(&timer->cv, timer->lockp);
+	fibril_mutex_lock(&timer->lock);
+
+	while (true) {
+		while (timer->state != fts_active &&
+		    timer->state != fts_cleanup) {
+
+			if (timer->state == fts_cleanup)
+				break;
+
+			fibril_condvar_wait(&timer->cv, &timer->lock);
+		}
+
+		if (timer->state == fts_cleanup)
 			break;
-		case fts_active:
-			rc = fibril_condvar_wait_timeout(&timer->cv,
-			    timer->lockp, timer->delay);
-			if (rc == ETIMEOUT && timer->state == fts_active) {
-				timer->state = fts_fired;
-				timer->handler_running = true;
-				fibril_mutex_unlock(timer->lockp);
-				timer->fun(timer->arg);
-				fibril_mutex_lock(timer->lockp);
-				timer->handler_running = false;
-			}
-			break;
-		case fts_cleanup:
-		case fts_clean:
-			assert(false);
-			break;
+
+		rc = fibril_condvar_wait_timeout(&timer->cv, &timer->lock,
+		    timer->delay);
+		if (rc == ETIMEOUT) {
+			timer->state = fts_fired;
+			fibril_mutex_unlock(&timer->lock);
+			timer->fun(timer->arg);
+			fibril_mutex_lock(&timer->lock);
 		}
 	}
 
-	/* Acknowledge timer fibril has finished cleanup. */
-	timer->state = fts_clean;
-	fibril_mutex_unlock(timer->lockp);
-	free(timer);
-
+	fibril_mutex_unlock(&timer->lock);
 	return 0;
 }
@@ -487,5 +481,5 @@
  * @return		New timer on success, @c NULL if out of memory.
  */
-fibril_timer_t *fibril_timer_create(fibril_mutex_t *lock)
+fibril_timer_t *fibril_timer_create(void)
 {
 	fid_t fid;
@@ -507,7 +501,7 @@
 	timer->fibril = fid;
 	timer->state = fts_not_set;
-	timer->lockp = (lock != NULL) ? lock : &timer->lock;
 
 	fibril_add_ready(fid);
+
 	return timer;
 }
@@ -519,11 +513,9 @@
 void fibril_timer_destroy(fibril_timer_t *timer)
 {
-	fibril_mutex_lock(timer->lockp);
-	assert(timer->state == fts_not_set || timer->state == fts_fired);
-
-	/* Request timer fibril to terminate. */
+	fibril_mutex_lock(&timer->lock);
+	assert(timer->state != fts_active);
 	timer->state = fts_cleanup;
 	fibril_condvar_broadcast(&timer->cv);
-	fibril_mutex_unlock(timer->lockp);
+	fibril_mutex_unlock(&timer->lock);
 }
 
@@ -541,24 +533,5 @@
     fibril_timer_fun_t fun, void *arg)
 {
-	fibril_mutex_lock(timer->lockp);
-	fibril_timer_set_locked(timer, delay, fun, arg);
-	fibril_mutex_unlock(timer->lockp);
-}
-
-/** Set locked timer.
- *
- * Set timer to execute a callback function after the specified
- * interval. Must be called when the timer is locked.
- *
- * @param timer		Timer
- * @param delay		Delay in microseconds
- * @param fun		Callback function
- * @param arg		Argument for @a fun
- */
-void fibril_timer_set_locked(fibril_timer_t *timer, suseconds_t delay,
-    fibril_timer_fun_t fun, void *arg)
-{
-	assert(fibril_mutex_is_locked(timer->lockp));
-	assert(timer->state == fts_not_set || timer->state == fts_fired);
+	fibril_mutex_lock(&timer->lock);
 	timer->state = fts_active;
 	timer->delay = delay;
@@ -566,4 +539,5 @@
 	timer->arg = arg;
 	fibril_condvar_broadcast(&timer->cv);
+	fibril_mutex_unlock(&timer->lock);
 }
 
@@ -583,32 +557,5 @@
 	fibril_timer_state_t old_state;
 
-	fibril_mutex_lock(timer->lockp);
-	old_state = fibril_timer_clear_locked(timer);
-	fibril_mutex_unlock(timer->lockp);
-
-	return old_state;
-}
-
-/** Clear locked timer.
- *
- * Clears (cancels) timer and returns last state of the timer.
- * This can be one of:
- *    - fts_not_set	If the timer has not been set or has been cleared
- *    - fts_active	Timer was set but did not fire
- *    - fts_fired	Timer fired
- * Must be called when the timer is locked.
- *
- * @param timer		Timer
- * @return		Last timer state
- */
-fibril_timer_state_t fibril_timer_clear_locked(fibril_timer_t *timer)
-{
-	fibril_timer_state_t old_state;
-
-	assert(fibril_mutex_is_locked(timer->lockp));
-
-	while (timer->handler_running)
-		fibril_condvar_wait(&timer->cv, timer->lockp);
-
+	fibril_mutex_lock(&timer->lock);
 	old_state = timer->state;
 	timer->state = fts_not_set;
@@ -618,4 +565,5 @@
 	timer->arg = NULL;
 	fibril_condvar_broadcast(&timer->cv);
+	fibril_mutex_unlock(&timer->lock);
 
 	return old_state;
Index: uspace/lib/c/generic/inet.c
===================================================================
--- uspace/lib/c/generic/inet.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/generic/inet.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2013 Jiri Svoboda
+ * Copyright (c) 2012 Jiri Svoboda
  * All rights reserved.
  *
@@ -34,5 +34,4 @@
 #include <ipc/services.h>
 #include <loc.h>
-#include <stdlib.h>
 
 static void inet_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg);
@@ -225,5 +224,4 @@
 	
 	rc = inet_ev_ops->recv(&dgram);
-	free(dgram.data);
 	async_answer_0(iid, rc);
 }
Index: uspace/lib/c/generic/stacktrace.c
===================================================================
--- uspace/lib/c/generic/stacktrace.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/generic/stacktrace.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -42,33 +42,18 @@
 static int stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data);
 
-static stacktrace_ops_t basic_ops = {
-	.read_uintptr = stacktrace_read_uintptr
-};
-
-void stacktrace_print_generic(stacktrace_ops_t *ops, void *arg, uintptr_t fp,
-    uintptr_t pc)
+void stacktrace_print_fp_pc(uintptr_t fp, uintptr_t pc)
 {
 	stacktrace_t st;
 	uintptr_t nfp;
-	int rc;
 
-	st.op_arg = arg;
-	st.ops = ops;
+	st.op_arg = NULL;
+	st.read_uintptr = stacktrace_read_uintptr;
 
 	while (stacktrace_fp_valid(&st, fp)) {
 		printf("%p: %p()\n", (void *) fp, (void *) pc);
-		rc =  stacktrace_ra_get(&st, fp, &pc);
-		if (rc != EOK)
-			break;
-		rc = stacktrace_fp_prev(&st, fp, &nfp);
-		if (rc != EOK)
-			break;
+		(void) stacktrace_ra_get(&st, fp, &pc);
+		(void) stacktrace_fp_prev(&st, fp, &nfp);
 		fp = nfp;
 	}
-}
-
-void stacktrace_print_fp_pc(uintptr_t fp, uintptr_t pc)
-{
-	stacktrace_print_generic(&basic_ops, NULL, fp, pc);
 }
 
Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/generic/str.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -1360,44 +1360,30 @@
 }
 
-/** Split string by delimiters.
- *
- * @param s             String to be tokenized. May not be NULL.
- * @param delim		String with the delimiters.
- * @param next		Variable which will receive the pointer to the
- *                      continuation of the string following the first
- *                      occurrence of any of the delimiter characters.
- *                      May be NULL.
- * @return              Pointer to the prefix of @a s before the first
- *                      delimiter character. NULL if no such prefix
- *                      exists.
- */
-char *str_tok(char *s, const char *delim, char **next)
+char *strtok(char *s, const char *delim)
+{
+	static char *next;
+
+	return strtok_r(s, delim, &next);
+}
+
+char *strtok_r(char *s, const char *delim, char **next)
 {
 	char *start, *end;
 
-	if (!s)
-		return NULL;
-	
-	size_t len = str_size(s);
-	size_t cur;
-	size_t tmp;
-	wchar_t ch;
+	if (s == NULL)
+		s = *next;
 
 	/* Skip over leading delimiters. */
-	for (tmp = cur = 0;
-	    (ch = str_decode(s, &tmp, len)) && str_chr(delim, ch); /**/)
-		cur = tmp;
-	start = &s[cur];
+	while (*s && (str_chr(delim, *s) != NULL)) ++s;
+	start = s;
 
 	/* Skip over token characters. */
-	for (tmp = cur;
-	    (ch = str_decode(s, &tmp, len)) && !str_chr(delim, ch); /**/)
-		cur = tmp;
-	end = &s[cur];
-	if (next)
-		*next = (ch ? &s[tmp] : &s[cur]);
-
-	if (start == end)
+	while (*s && (str_chr(delim, *s) == NULL)) ++s;
+	end = s;
+	*next = (*s ? s + 1 : s);
+
+	if (start == end) {
 		return NULL;	/* No more tokens. */
+	}
 
 	/* Overwrite delimiter with NULL terminator. */
Index: uspace/lib/c/include/fibril.h
===================================================================
--- uspace/lib/c/include/fibril.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/include/fibril.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -67,5 +67,4 @@
 typedef struct fibril {
 	link_t link;
-	link_t all_link;
 	context_t ctx;
 	void *stack;
Index: uspace/lib/c/include/fibril_synch.h
===================================================================
--- uspace/lib/c/include/fibril_synch.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/include/fibril_synch.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -116,8 +116,6 @@
 	/** Timer has fired and has not been cleared since */
 	fts_fired,
-	/** Timer fibril is requested to terminate */
-	fts_cleanup,
-	/** Timer fibril acknowledged termination */
-	fts_clean
+	/** Timer is being destroyed */
+	fts_cleanup
 } fibril_timer_state_t;
 
@@ -131,9 +129,7 @@
 typedef struct {
 	fibril_mutex_t lock;
-	fibril_mutex_t *lockp;
 	fibril_condvar_t cv;
 	fid_t fibril;
 	fibril_timer_state_t state;
-	bool handler_running;
 
 	suseconds_t delay;
@@ -164,12 +160,9 @@
 extern void fibril_condvar_broadcast(fibril_condvar_t *);
 
-extern fibril_timer_t *fibril_timer_create(fibril_mutex_t *);
+extern fibril_timer_t *fibril_timer_create(void);
 extern void fibril_timer_destroy(fibril_timer_t *);
 extern void fibril_timer_set(fibril_timer_t *, suseconds_t, fibril_timer_fun_t,
     void *);
-extern void fibril_timer_set_locked(fibril_timer_t *, suseconds_t,
-    fibril_timer_fun_t, void *);
 extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *);
-extern fibril_timer_state_t fibril_timer_clear_locked(fibril_timer_t *);
 
 #endif
Index: uspace/lib/c/include/ipc/dev_iface.h
===================================================================
--- uspace/lib/c/include/ipc/dev_iface.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/include/ipc/dev_iface.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -40,4 +40,7 @@
 	/** Character device interface */
 	CHAR_DEV_IFACE,
+
+	/** Graphic device interface */
+	GRAPH_DEV_IFACE,
 
 	/** Audio device mixer interface */
Index: uspace/lib/c/include/stacktrace.h
===================================================================
--- uspace/lib/c/include/stacktrace.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/include/stacktrace.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -41,16 +41,10 @@
 
 typedef struct {
+	void *op_arg;
 	int (*read_uintptr)(void *, uintptr_t, uintptr_t *);
-} stacktrace_ops_t;
-
-typedef struct {
-	void *op_arg;
-	stacktrace_ops_t *ops;
 } stacktrace_t;
 
 extern void stacktrace_print(void);
 extern void stacktrace_print_fp_pc(uintptr_t, uintptr_t);
-extern void stacktrace_print_generic(stacktrace_ops_t *, void *, uintptr_t,
-    uintptr_t);
 
 /*
Index: uspace/lib/c/include/str.h
===================================================================
--- uspace/lib/c/include/str.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/c/include/str.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -109,6 +109,4 @@
 extern char *str_ndup(const char *, size_t max_size);
 
-extern char *str_tok(char *, const char *, char **);
-
 extern int str_uint8_t(const char *, const char **, unsigned int, bool,
     uint8_t *);
@@ -134,4 +132,7 @@
 extern unsigned long strtoul(const char *, char **, int);
 
+extern char * strtok_r(char *, const char *, char **);
+extern char * strtok(char *, const char *);
+
 #endif
 
Index: uspace/lib/drv/Makefile
===================================================================
--- uspace/lib/drv/Makefile	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/drv/Makefile	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -47,4 +47,5 @@
 	generic/remote_pio_window.c \
 	generic/remote_char_dev.c \
+	generic/remote_graph_dev.c \
 	generic/remote_nic.c \
 	generic/remote_usb.c \
Index: uspace/lib/drv/generic/dev_iface.c
===================================================================
--- uspace/lib/drv/generic/dev_iface.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/drv/generic/dev_iface.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -45,4 +45,5 @@
 #include "remote_led_dev.h"
 #include "remote_battery_dev.h"
+#include "remote_graph_dev.h"
 #include "remote_nic.h"
 #include "remote_usb.h"
@@ -61,4 +62,5 @@
 		[PIO_WINDOW_DEV_IFACE] = &remote_pio_window_iface,
 		[CHAR_DEV_IFACE] = &remote_char_dev_iface,
+		[GRAPH_DEV_IFACE] = &remote_graph_dev_iface,
 		[NIC_DEV_IFACE] = &remote_nic_iface,
 		[PCI_DEV_IFACE] = &remote_pci_iface,
Index: uspace/lib/drv/generic/private/remote_graph_dev.h
===================================================================
--- uspace/lib/drv/generic/private/remote_graph_dev.h	(revision b8e75319061e813158de1af3c763230449de12cb)
+++ uspace/lib/drv/generic/private/remote_graph_dev.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Petr Koupy
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_REMOTE_GRAPH_DEV_H_
+#define LIBDRV_REMOTE_GRAPH_DEV_H_
+
+extern remote_iface_t remote_graph_dev_iface;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/remote_graph_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_graph_dev.c	(revision b8e75319061e813158de1af3c763230449de12cb)
+++ uspace/lib/drv/generic/remote_graph_dev.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2011 Petr Koupy
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#include <errno.h>
+#include <async.h>
+#include <macros.h>
+
+#include "ops/graph_dev.h"
+#include "graph_iface.h"
+#include "ddf/driver.h"
+
+typedef enum {
+	GRAPH_DEV_CONNECT = 0
+} graph_dev_method_t;
+
+int graph_dev_connect(async_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	int ret = async_req_1_0(exch, DEV_IFACE_ID(GRAPH_DEV_IFACE), GRAPH_DEV_CONNECT);
+	async_exchange_end(exch);
+
+	return ret;
+}
+
+static void remote_graph_connect(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
+
+static const remote_iface_func_ptr_t remote_graph_dev_iface_ops[] = {
+	[GRAPH_DEV_CONNECT] = remote_graph_connect
+};
+
+const remote_iface_t remote_graph_dev_iface = {
+	.method_count = ARRAY_SIZE(remote_graph_dev_iface_ops),
+	.methods = remote_graph_dev_iface_ops
+};
+
+static void remote_graph_connect(ddf_fun_t *fun, void *ops, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	graph_dev_ops_t *graph_dev_ops = (graph_dev_ops_t *) ops;
+
+	if (!graph_dev_ops->connect || !ddf_fun_data_get(fun)) {
+		async_answer_0(callid, ENOTSUP);
+		return;
+	}
+
+	(*graph_dev_ops->connect)(ddf_fun_data_get(fun), callid, call, NULL);
+}
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/include/graph_iface.h
===================================================================
--- uspace/lib/drv/include/graph_iface.h	(revision b8e75319061e813158de1af3c763230449de12cb)
+++ uspace/lib/drv/include/graph_iface.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 Petr Koupy
+ * 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_DEVICE_GRAPH_DEV_H_
+#define LIBC_DEVICE_GRAPH_DEV_H_
+
+#include <async.h>
+
+extern int graph_dev_connect(async_sess_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/drv/include/ops/graph_dev.h
===================================================================
--- uspace/lib/drv/include/ops/graph_dev.h	(revision b8e75319061e813158de1af3c763230449de12cb)
+++ uspace/lib/drv/include/ops/graph_dev.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011 Petr Koupy
+ * 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 libdrv
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBDRV_OPS_GRAPH_DEV_H_
+#define LIBDRV_OPS_GRAPH_DEV_H_
+
+#include <async.h>
+#include "../ddf/driver.h"
+
+typedef void (*connect_func)(void *, ipc_callid_t , ipc_call_t *, void *);
+
+typedef struct {
+	connect_func connect;
+} graph_dev_ops_t;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/graph/graph.c
===================================================================
--- uspace/lib/graph/graph.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/lib/graph/graph.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -58,5 +58,10 @@
 visualizer_t *graph_alloc_visualizer(void)
 {
-	return ((visualizer_t *) malloc(sizeof(visualizer_t)));
+	visualizer_t *vs = (visualizer_t *) malloc(sizeof(visualizer_t));
+	if (vs == NULL) {
+		return NULL;
+	}
+	
+	return vs;
 }
 
@@ -64,5 +69,10 @@
 {
 	// TODO
-	return ((renderer_t *) malloc(sizeof(renderer_t)));
+	renderer_t *rnd = (renderer_t *) malloc(sizeof(renderer_t));
+	if (rnd == NULL) {
+		return NULL;
+	}
+
+	return rnd;
 }
 
@@ -88,17 +98,21 @@
 int graph_register_visualizer(visualizer_t *vs)
 {
+	int rc = EOK;
+	
 	char node[LOC_NAME_MAXLEN + 1];
 	snprintf(node, LOC_NAME_MAXLEN, "%s%zu/%s%zu", NAMESPACE,
 	    namespace_idx, VISUALIZER_NAME, visualizer_idx++);
-	
+
 	category_id_t cat;
-	int rc = loc_category_get_id("visualizer", &cat, 0);
-	if (rc != EOK)
+	rc = loc_category_get_id("visualizer", &cat, 0);
+	if (rc != EOK) {
 		return rc;
-	
+	}
+
 	rc = loc_service_register(node, &vs->reg_svc_handle);
-	if (rc != EOK)
+	if (rc != EOK) {
 		return rc;
-	
+	}
+
 	rc = loc_service_add_to_cat(vs->reg_svc_handle, cat);
 	if (rc != EOK) {
@@ -106,9 +120,9 @@
 		return rc;
 	}
-	
+
 	fibril_mutex_lock(&visualizer_list_mtx);
 	list_append(&vs->link, &visualizer_list);
 	fibril_mutex_unlock(&visualizer_list_mtx);
-	
+
 	return rc;
 }
@@ -116,17 +130,21 @@
 int graph_register_renderer(renderer_t *rnd)
 {
+	int rc = EOK;
+
 	char node[LOC_NAME_MAXLEN + 1];
 	snprintf(node, LOC_NAME_MAXLEN, "%s%zu/%s%zu", NAMESPACE,
 	    namespace_idx, RENDERER_NAME, renderer_idx++);
-	
+
 	category_id_t cat;
-	int rc = loc_category_get_id("renderer", &cat, 0);
-	if (rc != EOK)
+	rc = loc_category_get_id("renderer", &cat, 0);
+	if (rc != EOK) {
 		return rc;
-	
+	}
+
 	rc = loc_service_register(node, &rnd->reg_svc_handle);
-	if (rc != EOK)
+	if (rc != EOK) {
 		return rc;
-	
+	}
+
 	rc = loc_service_add_to_cat(rnd->reg_svc_handle, cat);
 	if (rc != EOK) {
@@ -134,9 +152,9 @@
 		return rc;
 	}
-	
+
 	fibril_mutex_lock(&renderer_list_mtx);
 	list_append(&rnd->link, &renderer_list);
 	fibril_mutex_unlock(&renderer_list_mtx);
-	
+
 	return rc;
 }
@@ -145,7 +163,6 @@
 {
 	visualizer_t *vs = NULL;
-	
+
 	fibril_mutex_lock(&visualizer_list_mtx);
-	
 	list_foreach(visualizer_list, link, visualizer_t, vcur) {
 		if (vcur->reg_svc_handle == handle) {
@@ -154,7 +171,6 @@
 		}
 	}
-	
 	fibril_mutex_unlock(&visualizer_list_mtx);
-	
+
 	return vs;
 }
@@ -163,7 +179,6 @@
 {
 	renderer_t *rnd = NULL;
-	
+
 	fibril_mutex_lock(&renderer_list_mtx);
-	
 	list_foreach(renderer_list, link, renderer_t, rcur) {
 		if (rcur->reg_svc_handle == handle) {
@@ -172,7 +187,6 @@
 		}
 	}
-	
 	fibril_mutex_unlock(&renderer_list_mtx);
-	
+
 	return rnd;
 }
@@ -180,9 +194,11 @@
 int graph_unregister_visualizer(visualizer_t *vs)
 {
+	int rc = EOK;
+
 	fibril_mutex_lock(&visualizer_list_mtx);
-	int rc = loc_service_unregister(vs->reg_svc_handle);
+	rc = loc_service_unregister(vs->reg_svc_handle);
 	list_remove(&vs->link);
 	fibril_mutex_unlock(&visualizer_list_mtx);
-	
+
 	return rc;
 }
@@ -190,9 +206,11 @@
 int graph_unregister_renderer(renderer_t *rnd)
 {
+	int rc = EOK;
+
 	fibril_mutex_lock(&renderer_list_mtx);
-	int rc = loc_service_unregister(rnd->reg_svc_handle);
+	rc = loc_service_unregister(rnd->reg_svc_handle);
 	list_remove(&rnd->link);
 	fibril_mutex_unlock(&renderer_list_mtx);
-	
+
 	return rc;
 }
@@ -207,5 +225,5 @@
 	assert(vs->cells.data == NULL);
 	assert(vs->dev_ctx == NULL);
-	
+
 	free(vs);
 }
@@ -215,5 +233,5 @@
 	// TODO
 	assert(atomic_get(&rnd->ref_cnt) == 0);
-	
+
 	free(rnd);
 }
@@ -224,5 +242,5 @@
 	int ret = async_req_2_0(exch, VISUALIZER_MODE_CHANGE, handle, mode_idx);
 	async_exchange_end(exch);
-	
+
 	return ret;
 }
@@ -233,7 +251,7 @@
 	int ret = async_req_1_0(exch, VISUALIZER_DISCONNECT, handle);
 	async_exchange_end(exch);
-	
+
 	async_hangup(sess);
-	
+
 	return ret;
 }
@@ -255,13 +273,14 @@
 		}
 	}
-	
+
 	/* Driver might also deallocate resources for the current mode. */
 	int rc = vs->ops.yield(vs);
-	
+
 	/* Now that the driver was given a chance to deallocate resources,
 	 * current mode can be unset. */
-	if (vs->mode_set)
+	if (vs->mode_set) {
 		vs->mode_set = false;
-	
+	}
+
 	async_answer_0(iid, rc);
 }
@@ -269,44 +288,36 @@
 static void vs_enumerate_modes(visualizer_t *vs, ipc_callid_t iid, ipc_call_t *icall)
 {
-	ipc_callid_t callid;
-	size_t len;
-	
-	if (!async_data_read_receive(&callid, &len)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
-		return;
-	}
-	
 	fibril_mutex_lock(&vs->mode_mtx);
 	link_t *link = list_nth(&vs->modes, IPC_GET_ARG1(*icall));
-	
+
 	if (link != NULL) {
 		vslmode_list_element_t *mode_elem =
 		    list_get_instance(link, vslmode_list_element_t, link);
-		
-		int rc = async_data_read_finalize(callid, &mode_elem->mode, len);
-		async_answer_0(iid, rc);
+		vslmode_t mode = mode_elem->mode;
+		fibril_mutex_unlock(&vs->mode_mtx);
+
+		ipc_callid_t callid;
+		size_t len;
+
+        if (!async_data_read_receive(&callid, &len)) {
+			async_answer_0(iid, EINVAL);
+			return;
+        }
+        int rc = async_data_read_finalize(callid, &mode, len);
+		if (rc != EOK) {
+			async_answer_0(iid, ENOMEM);
+			return;
+		}
+
+		async_answer_0(iid, EOK);
 	} else {
-		async_answer_0(callid, ENOENT);
 		async_answer_0(iid, ENOENT);
 	}
-	
-	fibril_mutex_unlock(&vs->mode_mtx);
 }
 
 static void vs_get_default_mode(visualizer_t *vs, ipc_callid_t iid, ipc_call_t *icall)
 {
-	ipc_callid_t callid;
-	size_t len;
-	
-	if (!async_data_read_receive(&callid, &len)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
-		return;
-	}
-	
 	fibril_mutex_lock(&vs->mode_mtx);
 	vslmode_list_element_t *mode_elem = NULL;
-	
 	list_foreach(vs->modes, link, vslmode_list_element_t, cur) {
 		if (cur->mode.index == vs->def_mode_idx) {
@@ -315,33 +326,47 @@
 		}
 	}
-	
+
+	vslmode_t mode;
 	if (mode_elem != NULL) {
-		int rc = async_data_read_finalize(callid, &mode_elem->mode, len);
-		async_answer_0(iid, rc);
+		mode = mode_elem->mode;
+		fibril_mutex_unlock(&vs->mode_mtx);
+
+		ipc_callid_t callid;
+		size_t len;
+
+		if (!async_data_read_receive(&callid, &len)) {
+			async_answer_0(iid, EINVAL);
+			return;
+		}
+		int rc = async_data_read_finalize(callid, &mode, len);
+		if (rc != EOK) {
+			async_answer_0(iid, ENOMEM);
+			return;
+		}
+		async_answer_0(iid, EOK);
 	} else {
 		fibril_mutex_unlock(&vs->mode_mtx);
-		async_answer_0(callid, ENOENT);
 		async_answer_0(iid, ENOENT);
 	}
-	
-	fibril_mutex_unlock(&vs->mode_mtx);
 }
 
 static void vs_get_current_mode(visualizer_t *vs, ipc_callid_t iid, ipc_call_t *icall)
 {
-	ipc_callid_t callid;
-	size_t len;
-	
-	if (!async_data_read_receive(&callid, &len)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
-		return;
-	}
-	
 	if (vs->mode_set) {
+		ipc_callid_t callid;
+		size_t len;
+
+		if (!async_data_read_receive(&callid, &len)) {
+			async_answer_0(iid, EINVAL);
+			return;
+		}
 		int rc = async_data_read_finalize(callid, &vs->cur_mode, len);
-		async_answer_0(iid, rc);
+		if (rc != EOK) {
+			async_answer_0(iid, ENOMEM);
+			return;
+		}
+
+		async_answer_0(iid, EOK);
 	} else {
-		async_answer_0(callid, ENOENT);
 		async_answer_0(iid, ENOENT);
 	}
@@ -350,18 +375,8 @@
 static void vs_get_mode(visualizer_t *vs, ipc_callid_t iid, ipc_call_t *icall)
 {
-	ipc_callid_t callid;
-	size_t len;
-	
-	if (!async_data_read_receive(&callid, &len)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
-		return;
-	}
-	
 	sysarg_t mode_idx = IPC_GET_ARG1(*icall);
-	
+
 	fibril_mutex_lock(&vs->mode_mtx);
 	vslmode_list_element_t *mode_elem = NULL;
-	
 	list_foreach(vs->modes, link, vslmode_list_element_t, cur) {
 		if (cur->mode.index == mode_idx) {
@@ -370,72 +385,83 @@
 		}
 	}
-	
+
+	vslmode_t mode;
 	if (mode_elem != NULL) {
-		int rc = async_data_read_finalize(callid, &mode_elem->mode, len);
-		async_answer_0(iid, rc);
+		mode = mode_elem->mode;
+		fibril_mutex_unlock(&vs->mode_mtx);
+
+		ipc_callid_t callid;
+		size_t len;
+
+		if (!async_data_read_receive(&callid, &len)) {
+			async_answer_0(iid, EINVAL);
+			return;
+		}
+		int rc = async_data_read_finalize(callid, &mode, len);
+		if (rc != EOK) {
+			async_answer_0(iid, ENOMEM);
+			return;
+		}
+		async_answer_0(iid, EOK);
 	} else {
-		async_answer_0(callid, ENOENT);
+		fibril_mutex_unlock(&vs->mode_mtx);
 		async_answer_0(iid, ENOENT);
 	}
-	
-	fibril_mutex_unlock(&vs->mode_mtx);
 }
 
 static void vs_set_mode(visualizer_t *vs, ipc_callid_t iid, ipc_call_t *icall)
 {
+	int rc = EOK;
+
+	/* Retrieve mode index and version. */
+	sysarg_t mode_idx = IPC_GET_ARG1(*icall);
+	sysarg_t mode_version = IPC_GET_ARG2(*icall);
+
+	/* Find mode in the list. */
+	fibril_mutex_lock(&vs->mode_mtx);
+	vslmode_list_element_t *mode_elem = NULL;
+	list_foreach(vs->modes, link, vslmode_list_element_t, cur) {
+		if (cur->mode.index == mode_idx) {
+			mode_elem = cur;
+			break;
+		}
+	}
+
+	/* Extract mode description from the list node. */
+	vslmode_t new_mode;
+	if (mode_elem != NULL) {
+		new_mode = mode_elem->mode;
+		fibril_mutex_unlock(&vs->mode_mtx);
+	} else {
+		fibril_mutex_unlock(&vs->mode_mtx);
+		async_answer_0(iid, ENOENT);
+		return;
+	}
+
+	/* Check whether the mode is still up-to-date. */
+	if (new_mode.version != mode_version) {
+		async_answer_0(iid, EINVAL);
+		return;
+	}
+
 	ipc_callid_t callid;
 	size_t size;
 	unsigned int flags;
-	
+
 	/* Retrieve the shared cell storage for the new mode. */
 	if (!async_share_out_receive(&callid, &size, &flags)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
-		return;
-	}
-	
-	/* Retrieve mode index and version. */
-	sysarg_t mode_idx = IPC_GET_ARG1(*icall);
-	sysarg_t mode_version = IPC_GET_ARG2(*icall);
-	
-	/* Find mode in the list. */
-	fibril_mutex_lock(&vs->mode_mtx);
-	vslmode_list_element_t *mode_elem = NULL;
-	
-	list_foreach(vs->modes, link, vslmode_list_element_t, cur) {
-		if (cur->mode.index == mode_idx) {
-			mode_elem = cur;
-			break;
-		}
-	}
-	
-	if (mode_elem == NULL) {
-		fibril_mutex_unlock(&vs->mode_mtx);
-		async_answer_0(callid, ENOENT);
-		async_answer_0(iid, ENOENT);
-		return;
-	}
-	
-	/* Extract mode description from the list node. */
-	vslmode_t new_mode = mode_elem->mode;
-	fibril_mutex_unlock(&vs->mode_mtx);
-	
-	/* Check whether the mode is still up-to-date. */
-	if (new_mode.version != mode_version) {
-		async_answer_0(callid, EINVAL);
 		async_answer_0(iid, EINVAL);
 		return;
 	}
-	
 	void *new_cell_storage;
-	int rc = async_share_out_finalize(callid, &new_cell_storage);
+	rc = async_share_out_finalize(callid, &new_cell_storage);
 	if ((rc != EOK) || (new_cell_storage == AS_MAP_FAILED)) {
 		async_answer_0(iid, ENOMEM);
 		return;
 	}
-	
+
 	/* Change device internal state. */
 	rc = vs->ops.change_mode(vs, new_mode);
-	
+
 	/* Device driver could not establish new mode. Rollback. */
 	if (rc != EOK) {
@@ -444,10 +470,7 @@
 		return;
 	}
-	
-	/*
-	 * Because resources for the new mode were successfully
-	 * claimed, it is finally possible to free resources
-	 * allocated for the old mode.
-	 */
+
+	/* Because resources for the new mode were successfully claimed,
+	 * it is finally possible to free resources allocated for the old mode. */
 	if (vs->mode_set) {
 		if (vs->cells.data != NULL) {
@@ -456,5 +479,5 @@
 		}
 	}
-	
+
 	/* Insert new mode into the visualizer. */
 	vs->cells.width = new_mode.screen_width;
@@ -463,5 +486,5 @@
 	vs->cur_mode = new_mode;
 	vs->mode_set = true;
-	
+
 	async_answer_0(iid, EOK);
 }
@@ -476,9 +499,9 @@
 	sysarg_t y_offset = (IPC_GET_ARG5(*icall) & 0xffffffff);
 #endif
-	
+
 	int rc = vs->ops.handle_damage(vs,
 	    IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall),
 	    IPC_GET_ARG3(*icall), IPC_GET_ARG4(*icall),
-	    x_offset, y_offset);
+		x_offset, y_offset);
 	async_answer_0(iid, rc);
 }
@@ -501,5 +524,5 @@
 	ipc_call_t call;
 	ipc_callid_t callid;
-	
+
 	/* Claim the visualizer. */
 	if (!cas(&vs->ref_cnt, 0, 1)) {
@@ -507,25 +530,26 @@
 		return;
 	}
-	
+
 	/* Accept the connection. */
 	async_answer_0(iid, EOK);
-	
+
 	/* Establish callback session. */
 	callid = async_get_call(&call);
 	vs->notif_sess = async_callback_receive_start(EXCHANGE_SERIALIZE, &call);
-	if (vs->notif_sess != NULL)
+	if (vs->notif_sess != NULL) {
 		async_answer_0(callid, EOK);
-	else
+	} else {
 		async_answer_0(callid, ELIMIT);
-	
+	}
+
 	/* Enter command loop. */
 	while (true) {
 		callid = async_get_call(&call);
-		
+
 		if (!IPC_GET_IMETHOD(call)) {
 			async_answer_0(callid, EINVAL);
 			break;
 		}
-		
+
 		switch (IPC_GET_IMETHOD(call)) {
 		case VISUALIZER_CLAIM:
@@ -564,5 +588,5 @@
 		}
 	}
-	
+
 terminate:
 	async_hangup(vs->notif_sess);
@@ -575,21 +599,21 @@
 {
 	// TODO
-	
+
 	ipc_call_t call;
 	ipc_callid_t callid;
-	
+
 	/* Accept the connection. */
 	atomic_inc(&rnd->ref_cnt);
 	async_answer_0(iid, EOK);
-	
+
 	/* Enter command loop. */
 	while (true) {
 		callid = async_get_call(&call);
-		
+
 		if (!IPC_GET_IMETHOD(call)) {
 			async_answer_0(callid, EINVAL);
 			break;
 		}
-		
+
 		switch (IPC_GET_IMETHOD(call)) {
 		default:
@@ -598,5 +622,5 @@
 		}
 	}
-	
+
 terminate:
 	atomic_dec(&rnd->ref_cnt);
@@ -608,11 +632,12 @@
 	visualizer_t *vs = graph_get_visualizer(IPC_GET_ARG1(*icall));
 	renderer_t *rnd = graph_get_renderer(IPC_GET_ARG1(*icall));
-	
-	if (vs != NULL)
+
+	if (vs != NULL) {
 		graph_visualizer_connection(vs, iid, icall, arg);
-	else if (rnd != NULL)
+	} else if (rnd != NULL) {
 		graph_renderer_connection(rnd, iid, icall, arg);
-	else
+	} else {
 		async_answer_0(iid, ENOENT);
+	}
 }
 
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/devman/main.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -116,7 +116,9 @@
 		
 		fwd_h = dev->pfun->handle;
-	} else {
+	} else if (dev->state == DEVICE_USABLE) {
 		/* Connect to the specified function */
 		driver = dev->drv;
+		assert(driver != NULL);
+		
 		fwd_h = handle;
 	}
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/fs/fat/fat_ops.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -930,10 +930,12 @@
 	/* Parse mount options. */
 	char *mntopts = (char *) opts;
+	char *saveptr;
 	char *opt;
-	while ((opt = str_tok(mntopts, " ,", &mntopts)) != NULL) {
+	while ((opt = strtok_r(mntopts, " ,", &saveptr)) != NULL) {
 		if (str_cmp(opt, "wtcache") == 0)
 			cmode = CACHE_MODE_WT;
 		else if (str_cmp(opt, "nolfn") == 0)
 			instance->lfn_enabled = false;
+		mntopts = NULL;
 	}
 
Index: uspace/srv/hid/compositor/compositor.c
===================================================================
--- uspace/srv/hid/compositor/compositor.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/hid/compositor/compositor.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -55,6 +55,8 @@
 #include <async.h>
 #include <loc.h>
+#include <devman.h>
 
 #include <event.h>
+#include <graph_iface.h>
 #include <io/keycode.h>
 #include <io/mode.h>
@@ -1147,17 +1149,39 @@
 }
 
-static async_sess_t *vsl_connect(service_id_t sid, const char *svc)
+static async_sess_t *vsl_connect(const char *svc)
 {
 	int rc;
 	async_sess_t *sess;
-
-	sess = loc_service_connect(EXCHANGE_SERIALIZE, sid, 0);
-	if (sess == NULL) {
-		printf("%s: Unable to connect to visualizer %s\n", NAME, svc);
+	service_id_t dsid;
+	devman_handle_t handle;
+
+	rc = loc_service_get_id(svc, &dsid, 0);
+	if (rc != EOK) {
 		return NULL;
 	}
 
+	rc = devman_fun_sid_to_handle(dsid, &handle);
+	if (rc == EOK) {
+		sess = devman_device_connect(EXCHANGE_SERIALIZE, handle, 0);
+		if (sess == NULL) {
+			printf("%s: Unable to connect to visualizer %s\n", NAME, svc);
+			return NULL;
+		}
+		rc = graph_dev_connect(sess);
+		if (rc != EOK) {
+			return NULL;
+		}
+	} else if (rc == ENOENT) {
+		sess = loc_service_connect(EXCHANGE_SERIALIZE, dsid, 0);
+		if (sess == NULL) {
+			printf("%s: Unable to connect to visualizer %s\n", NAME, svc);
+			return NULL;
+		}
+	} else {
+		return NULL;
+	}
+
 	async_exch_t *exch = async_exchange_begin(sess);
-	rc = async_connect_to_me(exch, sid, 0, 0, vsl_notifications, NULL);
+	rc = async_connect_to_me(exch, dsid, 0, 0, vsl_notifications, NULL);
 	async_exchange_end(exch);
 
@@ -1172,18 +1196,12 @@
 }
 
-static viewport_t *viewport_create(service_id_t sid)
+static viewport_t *viewport_create(const char *vsl_name)
 {
 	int rc;
-	char *vsl_name = NULL;
-	viewport_t *vp = NULL;
-	bool claimed = false;
-
-	rc = loc_service_get_name(sid, &vsl_name);
-	if (rc != EOK)
-		goto error;
-
-	vp = (viewport_t *) calloc(1, sizeof(viewport_t));
-	if (!vp)
-		goto error;
+
+	viewport_t *vp = (viewport_t *) malloc(sizeof(viewport_t));
+	if (!vp) {
+		return NULL;
+	}
 
 	link_initialize(&vp->link);
@@ -1192,23 +1210,28 @@
 
 	/* Establish output bidirectional connection. */
-	vp->dsid = sid;
-	vp->sess = vsl_connect(sid, vsl_name);
-	if (vp->sess == NULL)
-		goto error;
+	vp->sess = vsl_connect(vsl_name);
+	rc = loc_service_get_id(vsl_name, &vp->dsid, 0);
+	if (vp->sess == NULL || rc != EOK) {
+		free(vp);
+		return NULL;
+	}
 
 	/* Claim the given visualizer. */
 	rc = visualizer_claim(vp->sess, 0);
 	if (rc != EOK) {
+		async_hangup(vp->sess);
+		free(vp);
 		printf("%s: Unable to claim visualizer (%s)\n", NAME, str_error(rc));
-		goto error;
-	}
-
-	claimed = true;
+		return NULL;
+	}
 
 	/* Retrieve the default mode. */
 	rc = visualizer_get_default_mode(vp->sess, &vp->mode);
 	if (rc != EOK) {
+		visualizer_yield(vp->sess);
+		async_hangup(vp->sess);
+		free(vp);
 		printf("%s: Unable to retrieve mode (%s)\n", NAME, str_error(rc));
-		goto error;
+		return NULL;
 	}
 
@@ -1217,6 +1240,9 @@
 	    NULL, SURFACE_FLAG_SHARED);
 	if (vp->surface == NULL) {
+		visualizer_yield(vp->sess);
+		async_hangup(vp->sess);
+		free(vp);
 		printf("%s: Unable to create surface (%s)\n", NAME, str_error(rc));
-		goto error;
+		return NULL;
 	}
 
@@ -1225,17 +1251,13 @@
 		vp->mode.index, vp->mode.version, surface_direct_access(vp->surface));
 	if (rc != EOK) {
+		visualizer_yield(vp->sess);
+		surface_destroy(vp->surface);
+		async_hangup(vp->sess);
+		free(vp);
 		printf("%s: Unable to set mode (%s)\n", NAME, str_error(rc));
-		goto error;
+		return NULL;
 	}
 
 	return vp;
-error:
-	if (claimed)
-		visualizer_yield(vp->sess);
-	if (vp->sess != NULL)
-		async_hangup(vp->sess);
-	free(vp);
-	free(vsl_name);
-	return NULL;
 }
 
@@ -2168,7 +2190,12 @@
 			continue;
 		
-		viewport_t *vp = viewport_create(svcs[i]);
-		if (vp != NULL)
-			list_append(&vp->link, &viewport_list);
+		char *svc_name;
+		rc = loc_service_get_name(svcs[i], &svc_name);
+		if (rc == EOK) {
+			viewport_t *vp = viewport_create(svc_name);
+			if (vp != NULL) {
+				list_append(&vp->link, &viewport_list);
+			}
+		}
 	}
 	fibril_mutex_unlock(&viewport_list_mtx);
Index: uspace/srv/logger/initlvl.c
===================================================================
--- uspace/srv/logger/initlvl.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/logger/initlvl.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -44,6 +44,6 @@
 {
 	char *tmp;
-	char *key = str_tok(setting, "=", &tmp);
-	char *value = str_tok(tmp, "=", &tmp);
+	char *key = strtok_r(setting, "=", &tmp);
+	char *value = strtok_r(NULL, "=", &tmp);
 	if (key == NULL)
 		return;
@@ -76,8 +76,8 @@
 {
 	char *tmp;
-	char *single_setting = str_tok(settings, " ", &tmp);
+	char *single_setting = strtok_r(settings, " ", &tmp);
 	while (single_setting != NULL) {
 		parse_single_level_setting(single_setting);
-		single_setting = str_tok(tmp, " ", &tmp);
+		single_setting = strtok_r(NULL, " ", &tmp);
 	}
 }
Index: uspace/srv/net/dhcp/dhcp.c
===================================================================
--- uspace/srv/net/dhcp/dhcp.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/dhcp/dhcp.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -304,7 +304,6 @@
 			break;
 		case opt_dns_server:
-			if (opt_len < 4 || opt_len % 4 != 0)
+			if (opt_len != 4)
 				return EINVAL;
-			/* XXX Handle multiple DNS servers properly */
 			inet_addr_set(dhcp_uint32_decode(&msgb[i]),
 			    &offer->dns_server);
@@ -436,5 +435,5 @@
 
 	dlink->link_id = link_id;
-	dlink->timeout = fibril_timer_create(NULL);
+	dlink->timeout = fibril_timer_create();
 	if (dlink->timeout == NULL) {
 		rc = ENOMEM;
Index: uspace/srv/net/inetsrv/inetsrv.c
===================================================================
--- uspace/srv/net/inetsrv/inetsrv.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/inetsrv/inetsrv.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -296,5 +296,5 @@
 	
 	uint8_t ttl = IPC_GET_ARG3(*icall);
-	int df = IPC_GET_ARG4(*icall);
+	int df = IPC_GET_ARG3(*icall);
 	
 	ipc_callid_t callid;
Index: uspace/srv/net/tcp/conn.c
===================================================================
--- uspace/srv/net/tcp/conn.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/conn.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -78,9 +78,9 @@
 		goto error;
 
-	fibril_mutex_initialize(&conn->lock);
-
-	conn->tw_timer = fibril_timer_create(&conn->lock);
+	conn->tw_timer = fibril_timer_create();
 	if (conn->tw_timer == NULL)
 		goto error;
+
+	fibril_mutex_initialize(&conn->lock);
 
 	/* One for the user, one for not being in closed state */
@@ -200,27 +200,4 @@
 	if (atomic_predec(&conn->refcnt) == 0)
 		tcp_conn_free(conn);
-}
-
-/** Lock connection.
- *
- * Must be called before any other connection-manipulating function,
- * except tcp_conn_{add|del}ref(). Locks the connection including
- * its timers. Must not be called inside any of the connection
- * timer handlers.
- *
- * @param conn		Connection
- */
-void tcp_conn_lock(tcp_conn_t *conn)
-{
-	fibril_mutex_lock(&conn->lock);
-}
-
-/** Unlock connection.
- *
- * @param conn		Connection
- */
-void tcp_conn_unlock(tcp_conn_t *conn)
-{
-	fibril_mutex_unlock(&conn->lock);
 }
 
@@ -1206,9 +1183,9 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tw_timeout_func(%p)", conn);
 
-	tcp_conn_lock(conn);
+	fibril_mutex_lock(&conn->lock);
 
 	if (conn->cstate == st_closed) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed.");
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		tcp_conn_delref(conn);
 		return;
@@ -1219,8 +1196,6 @@
 	tcp_conn_state_set(conn, st_closed);
 
-	tcp_conn_unlock(conn);
+	fibril_mutex_unlock(&conn->lock);
 	tcp_conn_delref(conn);
-
-	log_msg(LOG_DEFAULT, LVL_DEBUG, "tw_timeout_func(%p) end", conn);
 }
 
@@ -1231,9 +1206,7 @@
 void tcp_conn_tw_timer_set(tcp_conn_t *conn)
 {
-	log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_set() begin");
 	tcp_conn_addref(conn);
-	fibril_timer_set_locked(conn->tw_timer, TIME_WAIT_TIMEOUT,
-	    tw_timeout_func, (void *)conn);
-	log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_set() end");
+	fibril_timer_set(conn->tw_timer, TIME_WAIT_TIMEOUT, tw_timeout_func,
+	    (void *)conn);
 }
 
@@ -1244,8 +1217,6 @@
 void tcp_conn_tw_timer_clear(tcp_conn_t *conn)
 {
-	log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_clear() begin");
-	if (fibril_timer_clear_locked(conn->tw_timer) == fts_active)
+	if (fibril_timer_clear(conn->tw_timer) == fts_active)
 		tcp_conn_delref(conn);
-	log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_conn_tw_timer_clear() end");
 }
 
Index: uspace/srv/net/tcp/conn.h
===================================================================
--- uspace/srv/net/tcp/conn.h	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/conn.h	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -50,6 +50,4 @@
 extern void tcp_conn_addref(tcp_conn_t *);
 extern void tcp_conn_delref(tcp_conn_t *);
-extern void tcp_conn_lock(tcp_conn_t *);
-extern void tcp_conn_unlock(tcp_conn_t *);
 extern bool tcp_conn_got_syn(tcp_conn_t *);
 extern void tcp_conn_segment_arrived(tcp_conn_t *, tcp_segment_t *);
Index: uspace/srv/net/tcp/iqueue.c
===================================================================
--- uspace/srv/net/tcp/iqueue.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/iqueue.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -148,5 +148,4 @@
 	list_remove(&iqe->link);
 	*seg = iqe->seg;
-	free(iqe);
 
 	return EOK;
Index: uspace/srv/net/tcp/rqueue.c
===================================================================
--- uspace/srv/net/tcp/rqueue.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/rqueue.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -141,5 +141,4 @@
 
 		tcp_as_segment_arrived(&rqe->sp, rqe->seg);
-		free(rqe);
 	}
 
Index: uspace/srv/net/tcp/segment.c
===================================================================
--- uspace/srv/net/tcp/segment.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/segment.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -51,5 +51,4 @@
 void tcp_segment_delete(tcp_segment_t *seg)
 {
-	free(seg->dfptr);
 	free(seg);
 }
Index: uspace/srv/net/tcp/tcp.c
===================================================================
--- uspace/srv/net/tcp/tcp.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/tcp.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -151,6 +151,4 @@
 	if (rc != EOK)
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to transmit PDU.");
-
-	free(pdu_raw);
 }
 
Index: uspace/srv/net/tcp/tqueue.c
===================================================================
--- uspace/srv/net/tcp/tqueue.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/tqueue.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -59,10 +59,8 @@
 static void tcp_tqueue_timer_clear(tcp_conn_t *conn);
 
-#include <stdio.h>
 int tcp_tqueue_init(tcp_tqueue_t *tqueue, tcp_conn_t *conn)
 {
-	printf("tcp_tqueue_init\n");
 	tqueue->conn = conn;
-	tqueue->timer = fibril_timer_create(&conn->lock);
+	tqueue->timer = fibril_timer_create();
 	if (tqueue->timer == NULL)
 		return ENOMEM;
@@ -80,5 +78,4 @@
 void tcp_tqueue_fini(tcp_tqueue_t *tqueue)
 {
-	printf("tcp_tqueue_fini\n");
 	if (tqueue->timer != NULL) {
 		fibril_timer_destroy(tqueue->timer);
@@ -95,5 +92,4 @@
 	seg = tcp_segment_make_ctrl(ctrl);
 	tcp_tqueue_seg(conn, seg);
-	tcp_segment_delete(seg);
 }
 
@@ -216,5 +212,4 @@
 
 	tcp_tqueue_seg(conn, seg);
-	tcp_segment_delete(seg);
 }
 
@@ -322,9 +317,9 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);
 
-	tcp_conn_lock(conn);
+	fibril_mutex_lock(&conn->lock);
 
 	if (conn->cstate == st_closed) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed.");
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		tcp_conn_delref(conn);
 		return;
@@ -334,5 +329,5 @@
 	if (link == NULL) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit");
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		tcp_conn_delref(conn);
 		return;
@@ -344,5 +339,5 @@
 	if (rt_seg == NULL) {
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		tcp_conn_delref(conn);
 		/* XXX Handle properly */
@@ -356,8 +351,6 @@
 	tcp_tqueue_timer_set(tqe->conn);
 
-	tcp_conn_unlock(conn);
+	fibril_mutex_unlock(&conn->lock);
 	tcp_conn_delref(conn);
-
-	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn);
 }
 
@@ -365,5 +358,5 @@
 static void tcp_tqueue_timer_set(tcp_conn_t *conn)
 {
-	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() begin", conn->name);
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name);
 
 	/* Clear first to make sure we update refcnt correctly */
@@ -371,8 +364,6 @@
 
 	tcp_conn_addref(conn);
-	fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
+	fibril_timer_set(conn->retransmit.timer, RETRANSMIT_TIMEOUT,
 	    retransmit_timeout_func, (void *) conn);
-
-	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name);
 }
 
@@ -380,10 +371,8 @@
 static void tcp_tqueue_timer_clear(tcp_conn_t *conn)
 {
-	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() begin", conn->name);
-
-	if (fibril_timer_clear_locked(conn->retransmit.timer) == fts_active)
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name);
+
+	if (fibril_timer_clear(conn->retransmit.timer) == fts_active)
 		tcp_conn_delref(conn);
-
-	log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name);
 }
 
Index: uspace/srv/net/tcp/ucall.c
===================================================================
--- uspace/srv/net/tcp/ucall.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/tcp/ucall.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -90,5 +90,5 @@
 	/* Wait for connection to be established or reset */
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Wait for connection.");
-	tcp_conn_lock(nconn);
+	fibril_mutex_lock(&nconn->lock);
 	while (nconn->cstate == st_listen ||
 	    nconn->cstate == st_syn_sent ||
@@ -100,9 +100,9 @@
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was reset.");
 		assert(nconn->cstate == st_closed);
-		tcp_conn_unlock(nconn);
+		fibril_mutex_unlock(&nconn->lock);
 		return TCP_ERESET;
 	}
 
-	tcp_conn_unlock(nconn);
+	fibril_mutex_unlock(&nconn->lock);
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was established.");
 
@@ -121,8 +121,8 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_send()", conn->name);
 
-	tcp_conn_lock(conn);
+	fibril_mutex_lock(&conn->lock);
 
 	if (conn->cstate == st_closed) {
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		return TCP_ENOTEXIST;
 	}
@@ -135,5 +135,5 @@
 
 	if (conn->snd_buf_fin) {
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		return TCP_ECLOSING;
 	}
@@ -149,5 +149,5 @@
 
 		if (conn->reset) {
-			tcp_conn_unlock(conn);
+			fibril_mutex_unlock(&conn->lock);
 			return TCP_ERESET;
 		}
@@ -165,5 +165,5 @@
 
 	tcp_tqueue_new_data(conn);
-	tcp_conn_unlock(conn);
+	fibril_mutex_unlock(&conn->lock);
 
 	return TCP_EOK;
@@ -178,8 +178,8 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_receive()", conn->name);
 
-	tcp_conn_lock(conn);
+	fibril_mutex_lock(&conn->lock);
 
 	if (conn->cstate == st_closed) {
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		return TCP_ENOTEXIST;
 	}
@@ -197,10 +197,10 @@
 		if (conn->rcv_buf_fin) {
 			/* End of data, peer closed connection */
-			tcp_conn_unlock(conn);
+			fibril_mutex_unlock(&conn->lock);
 			return TCP_ECLOSING;
 		} else {
 			/* Connection was reset */
 			assert(conn->reset);
-			tcp_conn_unlock(conn);
+			fibril_mutex_unlock(&conn->lock);
 			return TCP_ERESET;
 		}
@@ -227,5 +227,5 @@
 	    conn->name, xfer_size);
 
-	tcp_conn_unlock(conn);
+	fibril_mutex_unlock(&conn->lock);
 
 	return TCP_EOK;
@@ -238,9 +238,9 @@
 	    conn);
 
-	tcp_conn_lock(conn);
+	fibril_mutex_lock(&conn->lock);
 
 	if (conn->cstate == st_closed) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - ENOTEXIST");
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		return TCP_ENOTEXIST;
 	}
@@ -250,5 +250,4 @@
 		tcp_conn_reset(conn);
 		tcp_conn_remove(conn);
-		tcp_conn_unlock(conn);
 		return TCP_EOK;
 	}
@@ -256,5 +255,5 @@
 	if (conn->snd_buf_fin) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - ECLOSING");
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		return TCP_ECLOSING;
 	}
@@ -264,5 +263,5 @@
 	tcp_tqueue_new_data(conn);
 
-	tcp_conn_unlock(conn);
+	fibril_mutex_unlock(&conn->lock);
 	return TCP_EOK;
 }
@@ -322,10 +321,10 @@
 	}
 
-	tcp_conn_lock(conn);
+	fibril_mutex_lock(&conn->lock);
 
 	if (conn->cstate == st_closed) {
 		log_msg(LOG_DEFAULT, LVL_WARN, "Connection is closed.");
 		tcp_unexpected_segment(sp, seg);
-		tcp_conn_unlock(conn);
+		fibril_mutex_unlock(&conn->lock);
 		tcp_conn_delref(conn);
 		return;
@@ -343,5 +342,5 @@
 	tcp_conn_segment_arrived(conn, seg);
 
-	tcp_conn_unlock(conn);
+	fibril_mutex_unlock(&conn->lock);
 	tcp_conn_delref(conn);
 }
Index: uspace/srv/net/udp/udp_inet.c
===================================================================
--- uspace/srv/net/udp/udp_inet.c	(revision af2a76c3fbf1a0a9aee19905c674ce43f4ffc6db)
+++ uspace/srv/net/udp/udp_inet.c	(revision b8e75319061e813158de1af3c763230449de12cb)
@@ -71,7 +71,4 @@
 
 	udp_received_pdu(pdu);
-
-	/* We don't want udp_pdu_delete() to free dgram->data */
-	pdu->data = NULL;
 	udp_pdu_delete(pdu);
 
