Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ HelenOS.config	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -417,4 +417,7 @@
 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=keyboard)&PLATFORM=ia64&MACHINE=i460GX] CONFIG_PC_KBD (y/n)
 
+% PC keyboard support
+! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=keyboard)&PLATFORM=arm32&MACHINE=integratorcp] CONFIG_PC_KBD (y/n)
+
 % Support for msim/GXemul keyboard
 ! [CONFIG_HID_IN=generic&PLATFORM=mips32] CONFIG_MIPS_KBD (y/n)
Index: defaults/arm32/gta02/Makefile.config
===================================================================
--- defaults/arm32/gta02/Makefile.config	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ defaults/arm32/gta02/Makefile.config	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -4,11 +4,2 @@
 # RAM disk format
 RDFMT = tmpfs
-
-# Support for userspace debuggers
-CONFIG_UDEBUG = n
-
-# Compile kernel tests
-CONFIG_TEST = n
-
-# Barebone build with essential binaries only
-CONFIG_BAREBONE = y
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/Makefile	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -240,4 +240,5 @@
 	generic/src/lib/func.c \
 	generic/src/lib/memstr.c \
+	generic/src/lib/memfnc.c \
 	generic/src/lib/sort.c \
 	generic/src/lib/str.c \
Index: rnel/arch/abs32le/include/memstr.h
===================================================================
--- kernel/arch/abs32le/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2010 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.
- */
-
-/** @addtogroup abs32le
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_abs32le_MEMSTR_H_
-#define KERN_abs32le_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)   _memcpy((dst), (src), (cnt))
-#define memsetb(dst, cnt, val)  _memsetb((dst), (cnt), (val))
-#define memsetw(dst, cnt, val)  _memsetw((dst), (cnt), (val))
-
-#endif
-
-/** @}
- */
Index: kernel/arch/amd64/Makefile.inc
===================================================================
--- kernel/arch/amd64/Makefile.inc	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/amd64/Makefile.inc	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -33,5 +33,22 @@
 
 FPU_NO_CFLAGS = -mno-sse -mno-sse2
-CMN1 = -m64 -mcmodel=large -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer
+
+#
+# FIXME:
+#
+# The -fno-optimize-sibling-calls should be removed as soon as a bug
+# in GCC concerning the "large" memory model and tail call optimization
+# is fixed.
+#
+# If GCC generates a code for tail call, instead of generating ..
+#
+#   jmp *fnc
+#
+# it generates an assembly code with an illegal immediate prefix:
+#
+#   jmp *$fnc
+#
+
+CMN1 = -m64 -mcmodel=large -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls
 GCC_CFLAGS += $(CMN1)
 ICC_CFLAGS += $(CMN1)
Index: kernel/arch/amd64/_link.ld.in
===================================================================
--- kernel/arch/amd64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/amd64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -26,10 +26,10 @@
 	.mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) {
 		ktext_start = .;
-		*(.text);
+		*(.text .text.*);
 		ktext_end = .;
 		
 		kdata_start = .;
-		*(.data);       /* initialized data */
-		*(.rodata*);    /* string literals */
+		*(.data);              /* initialized data */
+		*(.rodata .rodata.*);  /* string literals */
 		hardcoded_load_address = .;
 		QUAD(PA2KA(BOOT_OFFSET));
Index: rnel/arch/amd64/include/memstr.h
===================================================================
--- kernel/arch/amd64/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2005 Sergey Bondari
- * 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 amd64
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_amd64_MEMSTR_H_
-#define KERN_amd64_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/amd64/src/asm.S
===================================================================
--- kernel/arch/amd64/src/asm.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/amd64/src/asm.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -37,7 +37,4 @@
 .global read_efer_flag
 .global set_efer_flag
-.global memsetb
-.global memsetw
-.global memcpy
 .global memcpy_from_uspace
 .global memcpy_to_uspace
@@ -46,12 +43,4 @@
 .global early_putchar
 
-/* Wrapper for generic memsetb */
-memsetb:
-	jmp _memsetb
-
-/* Wrapper for generic memsetw */
-memsetw:
-	jmp _memsetw
-
 #define MEMCPY_DST   %rdi
 #define MEMCPY_SRC   %rsi
@@ -74,5 +63,4 @@
  *
  */
-memcpy:
 memcpy_from_uspace:
 memcpy_to_uspace:
Index: rnel/arch/arm32/include/memstr.h
===================================================================
--- kernel/arch/arm32/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2005 Sergey Bondari
- * 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 arm32
- * @{
- */
-/** @file
- *  @brief Memory manipulating functions declarations.
- */
-
-#ifndef KERN_arm32_MEMSTR_H_
-#define KERN_arm32_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/arm32/src/asm.S
===================================================================
--- kernel/arch/arm32/src/asm.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/arm32/src/asm.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -29,7 +29,4 @@
 .text
 
-.global memsetb
-.global memsetw
-.global memcpy
 .global memcpy_from_uspace
 .global memcpy_to_uspace
@@ -38,11 +35,4 @@
 .global early_putchar
 
-memsetb:
-	b _memsetb
-
-memsetw:
-	b _memsetw
-
-memcpy:
 memcpy_from_uspace:
 memcpy_to_uspace:
Index: kernel/arch/arm32/src/exception.c
===================================================================
--- kernel/arch/arm32/src/exception.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/arm32/src/exception.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -35,5 +35,4 @@
 
 #include <arch/exception.h>
-#include <arch/memstr.h>
 #include <arch/regutils.h>
 #include <arch/machine_func.h>
Index: kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
===================================================================
--- kernel/arch/arm32/src/mach/integratorcp/integratorcp.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/arm32/src/mach/integratorcp/integratorcp.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -292,5 +292,5 @@
 		.y = 480,
 		.scan = 2560,
-		.visual = VISUAL_BGR_0_8_8_8,
+		.visual = VISUAL_RGB_8_8_8_0,
 	};
 	
Index: kernel/arch/ia32/_link.ld.in
===================================================================
--- kernel/arch/ia32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ia32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -25,10 +25,10 @@
 	.mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)): AT (SIZEOF(.unmapped)) { 
 		ktext_start = .;
-		*(.text);
+		*(.text .text.*);
 		ktext_end = .;
 		
 		kdata_start = .;
 		*(.data);               /* initialized data */
-		*(.rodata*);            /* string literals */
+		*(.rodata .rodata.*);   /* string literals */
 		*(COMMON);              /* global variables */
 		hardcoded_load_address = .;
Index: rnel/arch/ia32/include/memstr.h
===================================================================
--- kernel/arch/ia32/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2005 Sergey Bondari
- * 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 ia32
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_ia32_MEMSTR_H_
-#define KERN_ia32_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/ia32/src/asm.S
===================================================================
--- kernel/arch/ia32/src/asm.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ia32/src/asm.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -38,7 +38,4 @@
 .global paging_on
 .global enable_l_apic_in_msr
-.global memsetb
-.global memsetw
-.global memcpy
 .global memcpy_from_uspace
 .global memcpy_from_uspace_failover_address
@@ -47,12 +44,4 @@
 .global early_putchar
 
-/* Wrapper for generic memsetb */
-memsetb:
-	jmp _memsetb
-
-/* Wrapper for generic memsetw */
-memsetw:
-	jmp _memsetw
-
 #define MEMCPY_DST   4
 #define MEMCPY_SRC   8
@@ -74,5 +63,4 @@
  *
  */
-memcpy:
 memcpy_from_uspace:
 memcpy_to_uspace:
Index: kernel/arch/ia32/src/cpu/cpu.c
===================================================================
--- kernel/arch/ia32/src/cpu/cpu.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ia32/src/cpu/cpu.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -92,5 +92,4 @@
 void cpu_arch_init(void)
 {
-	cpuid_extended_feature_info efi;
 	cpu_info_t info;
 	uint32_t help = 0;
@@ -104,5 +103,4 @@
 	
 	CPU->arch.fi.word = info.cpuid_edx;
-	efi.word = info.cpuid_ecx;
 	
 	if (CPU->arch.fi.bits.fxsr)
Index: kernel/arch/ia64/_link.ld.in
===================================================================
--- kernel/arch/ia64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ia64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -16,5 +16,5 @@
 		ktext_start = .;
 		*(K_TEXT_START);
-		*(.text)
+		*(.text .text.*)
 		ktext_end = .;
 		
@@ -36,15 +36,14 @@
 		*(.bss)
 		*(COMMON);
-
+		
 		. = ALIGN(8);
-                symbol_table = .;
-                *(symtab.*);            /* Symbol table, must be LAST symbol!*/
-
+		symbol_table = .;
+		*(symtab.*);            /* Symbol table, must be LAST symbol!*/
+		
 		kdata_end = .;
 	}
-
+	
 	/DISCARD/ : {
 		*(*);
 	}
-
 }
Index: rnel/arch/ia64/include/memstr.h
===================================================================
--- kernel/arch/ia64/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2005 Sergey Bondari
- * 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 ia64
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_ia64_MEMSTR_H_
-#define KERN_ia64_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/ia64/src/asm.S
===================================================================
--- kernel/arch/ia64/src/asm.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ia64/src/asm.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -30,5 +30,4 @@
 
 .text
-.global memcpy
 .global memcpy_from_uspace
 .global memcpy_to_uspace
@@ -39,5 +38,6 @@
  *
  * This memcpy() has been taken from the assembler output of
- * the generic _memcpy() and modified to have the failover part.
+ * a plain C implementation of memcpy() modified to have the
+ * failover part.
  *
  * @param in0 Destination address.
@@ -46,5 +46,4 @@
  *
  */
-memcpy:
 memcpy_from_uspace:
 memcpy_to_uspace:
@@ -141,12 +140,4 @@
 	br.ret.sptk.many rp
 
-.global memsetb
-memsetb:
-	br _memsetb
-
-.global memsetw
-memsetw:
-	br _memsetw
-
 .global cpu_halt
 cpu_halt:
Index: kernel/arch/ia64/src/mm/tlb.c
===================================================================
--- kernel/arch/ia64/src/mm/tlb.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ia64/src/mm/tlb.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -475,12 +475,8 @@
 void alternate_instruction_tlb_fault(uint64_t vector, istate_t *istate)
 {
-	region_register_t rr;
-	rid_t rid;
 	uintptr_t va;
 	pte_t *t;
 	
 	va = istate->cr_ifa; /* faulting address */
-	rr.word = rr_read(VA2VRN(va));
-	rid = rr.map.rid;
 	
 	page_table_lock(AS, true);
@@ -649,12 +645,8 @@
 void data_dirty_bit_fault(uint64_t vector, istate_t *istate)
 {
-	region_register_t rr;
-	rid_t rid;
 	uintptr_t va;
 	pte_t *t;
 	
 	va = istate->cr_ifa;  /* faulting address */
-	rr.word = rr_read(VA2VRN(va));
-	rid = rr.map.rid;
 	
 	page_table_lock(AS, true);
@@ -686,12 +678,8 @@
 void instruction_access_bit_fault(uint64_t vector, istate_t *istate)
 {
-	region_register_t rr;
-	rid_t rid;
 	uintptr_t va;
 	pte_t *t;
 	
 	va = istate->cr_ifa;  /* faulting address */
-	rr.word = rr_read(VA2VRN(va));
-	rid = rr.map.rid;
 	
 	page_table_lock(AS, true);
@@ -723,12 +711,8 @@
 void data_access_bit_fault(uint64_t vector, istate_t *istate)
 {
-	region_register_t rr;
-	rid_t rid;
 	uintptr_t va;
 	pte_t *t;
 	
 	va = istate->cr_ifa;  /* faulting address */
-	rr.word = rr_read(VA2VRN(va));
-	rid = rr.map.rid;
 	
 	page_table_lock(AS, true);
@@ -760,12 +744,8 @@
 void data_access_rights_fault(uint64_t vector, istate_t *istate)
 {
-	region_register_t rr;
-	rid_t rid;
 	uintptr_t va;
 	pte_t *t;
 	
 	va = istate->cr_ifa;  /* faulting address */
-	rr.word = rr_read(VA2VRN(va));
-	rid = rr.map.rid;
 	
 	/*
@@ -792,12 +772,8 @@
 void page_not_present(uint64_t vector, istate_t *istate)
 {
-	region_register_t rr;
-	rid_t rid;
 	uintptr_t va;
 	pte_t *t;
 	
 	va = istate->cr_ifa;  /* faulting address */
-	rr.word = rr_read(VA2VRN(va));
-	rid = rr.map.rid;
 	
 	page_table_lock(AS, true);
Index: kernel/arch/mips32/include/cp0.h
===================================================================
--- kernel/arch/mips32/include/cp0.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/mips32/include/cp0.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -70,5 +70,5 @@
   { \
       uint32_t retval; \
-      asm("mfc0 %0, $" #reg : "=r"(retval)); \
+      asm volatile ("mfc0 %0, $" #reg : "=r"(retval)); \
       return retval; \
   }
@@ -76,5 +76,5 @@
 #define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \
  { \
-    asm("mtc0 %0, $" #reg : : "r"(val) ); \
+    asm volatile ("mtc0 %0, $" #reg : : "r"(val) ); \
  }
 
Index: rnel/arch/mips32/include/memstr.h
===================================================================
--- kernel/arch/mips32/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2005 Sergey Bondari
- * 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 mips32
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_mips32_MEMSTR_H_
-#define KERN_mips32_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/mips32/src/asm.S
===================================================================
--- kernel/arch/mips32/src/asm.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/mips32/src/asm.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -57,20 +57,8 @@
 	nop
 
-.global memsetb
-memsetb:
-	j _memsetb
-	nop
-
-.global memsetw
-memsetw:
-	j _memsetw
-	nop
-
-.global memcpy
 .global memcpy_from_uspace
 .global memcpy_to_uspace
 .global memcpy_from_uspace_failover_address
 .global memcpy_to_uspace_failover_address
-memcpy:
 memcpy_from_uspace:
 memcpy_to_uspace:
Index: kernel/arch/ppc32/_link.ld.in
===================================================================
--- kernel/arch/ppc32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ppc32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -36,6 +36,5 @@
 		kdata_start = .;
 		*(K_DATA_START);
-		*(.rodata);
-		*(.rodata.*);
+		*(.rodata .rodata.*);
 		*(.data);       /* initialized data */
 		*(.sdata);
Index: rnel/arch/ppc32/include/memstr.h
===================================================================
--- kernel/arch/ppc32/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2005 Sergey Bondari
- * 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 ppc32
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_ppc32_MEMSTR_H_
-#define KERN_ppc32_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/ppc32/src/asm.S
===================================================================
--- kernel/arch/ppc32/src/asm.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/ppc32/src/asm.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -35,7 +35,4 @@
 .global iret
 .global iret_syscall
-.global memsetb
-.global memsetw
-.global memcpy
 .global memcpy_from_uspace
 .global memcpy_to_uspace
@@ -208,11 +205,4 @@
 	rfi
 
-memsetb:
-	b _memsetb
-
-memsetw:
-	b _memsetw
-
-memcpy:
 memcpy_from_uspace:
 memcpy_to_uspace:
Index: kernel/arch/sparc64/_link.ld.in
===================================================================
--- kernel/arch/sparc64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/sparc64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -15,11 +15,10 @@
 		ktext_start = .;
 		*(K_TEXT_START)
-		*(.text);
+		*(.text .text.*);
 		ktext_end = .;
 		
 		kdata_start = .;
 		*(K_DATA_START)
-		*(.rodata);
-		*(.rodata.*);
+		*(.rodata .rodata.*);
 		*(.data);                   /* initialized data */
 		*(.sdata);
Index: rnel/arch/sparc64/include/memstr.h
===================================================================
--- kernel/arch/sparc64/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2005 Sergey Bondari
- * 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 sparc64
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_sparc64_MEMSTR_H_
-#define KERN_sparc64_MEMSTR_H_
-
-#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
-
-extern void memsetw(void *, size_t, uint16_t);
-extern void memsetb(void *, size_t, uint8_t);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/sparc64/src/asm.S
===================================================================
--- kernel/arch/sparc64/src/asm.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/sparc64/src/asm.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -34,78 +34,4 @@
 .register %g2, #scratch
 .register %g3, #scratch
-
-/*
- * This is the assembly language version of our _memcpy() generated by gcc.
- */
-.global memcpy
-memcpy:
-	mov %o0, %o3  /* save dst */
-	add %o1, 7, %g1
-	and %g1, -8, %g1
-	cmp %o1, %g1
-	be,pn %xcc, 3f
-	add %o0, 7, %g1
-	mov 0, %g3
-	
-	0:
-	
-		brz,pn %o2, 2f
-		mov 0, %g2
-	
-	1:
-	
-		ldub [%g3 + %o1], %g1
-		add %g2, 1, %g2
-		cmp %o2, %g2
-		stb %g1, [%g3 + %o0]
-		bne,pt %xcc, 1b
-		mov %g2, %g3
-	
-	2:
-	
-		jmp %o7 + 8  /* exit point */
-		mov %o3, %o0
-	
-	3:
-	
-		and %g1, -8, %g1
-		cmp %o0, %g1
-		bne,pt %xcc, 0b
-		mov 0, %g3
-		srlx %o2, 3, %g4
-		brz,pn %g4, 5f
-		mov 0, %g5
-	
-	4:
-	
-		sllx %g3, 3, %g2
-		add %g5, 1, %g3
-		ldx [%o1 + %g2], %g1
-		mov %g3, %g5
-		cmp %g4, %g3
-		bne,pt %xcc, 4b
-		stx %g1, [%o0 + %g2]
-	
-	5:
-	
-		and %o2, 7, %o2
-		brz,pn %o2, 2b
-		sllx %g4, 3, %g1
-		mov 0, %g2
-		add %g1, %o0, %o0
-		add %g1, %o1, %g4
-		mov 0, %g3
-	
-	6:
-	
-		ldub [%g2 + %g4], %g1
-		stb %g1, [%g2 + %o0]
-		add %g3, 1, %g2
-		cmp %o2, %g2
-		bne,pt %xcc, 6b
-		mov %g2, %g3
-		
-		jmp %o7 + 8  /* exit point */
-		mov %o3, %o0
 
 /*
@@ -264,14 +190,4 @@
 	mov %g0, %o0  /* return 0 on failure */
 
-.global memsetb
-memsetb:
-	ba %xcc, _memsetb
-	nop
-
-.global memsetw
-memsetw:
-	ba %xcc, _memsetw
-	nop
-
 .global early_putchar
 early_putchar:
Index: kernel/arch/sparc64/src/mm/sun4u/as.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4u/as.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/sparc64/src/mm/sun4u/as.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -43,5 +43,4 @@
 
 #include <arch/mm/tsb.h>
-#include <arch/memstr.h>
 #include <arch/asm.h>
 #include <mm/frame.h>
Index: kernel/arch/sparc64/src/mm/sun4v/as.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4v/as.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/sparc64/src/mm/sun4v/as.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -46,5 +46,4 @@
 
 #include <arch/mm/tsb.h>
-#include <arch/memstr.h>
 #include <arch/asm.h>
 #include <mm/frame.h>
Index: kernel/arch/sparc64/src/smp/sun4v/smp.c
===================================================================
--- kernel/arch/sparc64/src/smp/sun4v/smp.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/sparc64/src/smp/sun4v/smp.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -1,5 +1,5 @@
 /*
  * Copyright (c) 2006 Jakub Jermar
- * Copyright (c) 2009 Pavel Rimsky 
+ * Copyright (c) 2009 Pavel Rimsky
  * All rights reserved.
  *
@@ -439,5 +439,5 @@
 	if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) ==
 	    ESYNCH_TIMEOUT)
-		printf("%s: waiting for processor (cpuid = %" PRIu32 ") timed out\n",
+		printf("%s: waiting for processor (cpuid = %" PRIu64 ") timed out\n",
 		    __func__, cpuid);
 	
Index: kernel/arch/sparc64/src/sun4v/start.S
===================================================================
--- kernel/arch/sparc64/src/sun4v/start.S	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/sparc64/src/sun4v/start.S	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -296,5 +296,5 @@
 	 * Create the first stack frame.
 	 */
-	save %sp, -(STACK_WINDWO_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp
+	save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp
 	flushw
 	add %g0, -STACK_BIAS, %fp
Index: kernel/arch/sparc64/src/trap/sun4v/interrupt.c
===================================================================
--- kernel/arch/sparc64/src/trap/sun4v/interrupt.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/arch/sparc64/src/trap/sun4v/interrupt.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -111,5 +111,5 @@
 			((void (*)(void)) data1)();
 		} else {
-			printf("Spurious interrupt on %d, data = %" PRIx64 ".\n",
+			printf("Spurious interrupt on %" PRIu64 ", data = %" PRIx64 ".\n",
 			    CPU->arch.id, data1);
 		}
Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/genarch/Makefile.inc	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -122,10 +122,4 @@
 endif
 
-ifeq ($(CONFIG_PL050),y)
-	GENARCH_SOURCES += \
-		genarch/src/kbrd/kbrd_pl050.c \
-		genarch/src/kbrd/scanc_pl050.c
-endif
-
 ifeq ($(CONFIG_MAC_KBD),y)
 	GENARCH_SOURCES += \
Index: kernel/genarch/src/drivers/via-cuda/cuda.c
===================================================================
--- kernel/genarch/src/drivers/via-cuda/cuda.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/genarch/src/drivers/via-cuda/cuda.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -239,9 +239,9 @@
 	cuda_instance_t *instance = irq->instance;
 	cuda_t *dev = instance->cuda;
-	uint8_t data, b;
-
+	uint8_t b;
+	
 	b = pio_read_8(&dev->b);
-	data = pio_read_8(&dev->sr);
-
+	pio_read_8(&dev->sr);
+	
 	if ((b & TREQ) == 0) {
 		instance->xstate = cx_receive;
@@ -251,7 +251,7 @@
 		cuda_send_start(instance);
 	}
-
-        memcpy(buf, instance->rcv_buf, instance->bidx);
-        *len = instance->bidx;
+	
+	memcpy(buf, instance->rcv_buf, instance->bidx);
+	*len = instance->bidx;
 	instance->bidx = 0;
 }
Index: rnel/genarch/src/kbrd/kbrd_pl050.c
===================================================================
--- kernel/genarch/src/kbrd/kbrd_pl050.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,209 +1,0 @@
-/*
- * Copyright (c) 2009 Vineeth Pillai
- * 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 genarch
- * @{
- */
-/**
- * @file
- * @brief pl050 Keyboard processing.
- */
-
-#include <genarch/kbrd/kbrd.h>
-#include <genarch/kbrd/scanc.h>
-
-#include <genarch/kbrd/scanc_pl050.h>
-
-#include <synch/spinlock.h>
-#include <console/chardev.h>
-#include <console/console.h>
-#include <proc/thread.h>
-#include <arch.h>
-#include <macros.h>
-
-#define PRESSED_SHIFT     (1 << 0)
-#define PRESSED_CAPSLOCK  (1 << 1)
-#define LOCKED_CAPSLOCK   (1 << 0)
-
-#define PL050_KEY_RELEASE 0xF0
-#define PL050_ESC_KEY   0xE0
-#define PL050_CAPS_SCAN_CODE   0x58
-#define PL050_NUM_SCAN_CODE   0x77
-#define PL050_SCROLL_SCAN_CODE   0x7E
-
-static bool is_lock_key(wchar_t);
-
-static indev_operations_t kbrd_raw_ops = {
-	.poll = NULL
-};
-
-/** Process release of key.
- *
- * @param sc Scancode of the key being released.
- */
-static void key_released(kbrd_instance_t *instance, wchar_t sc)
-{
-	spinlock_lock(&instance->keylock);
-	
-	switch (sc) {
-	case SC_LSHIFT:
-	case SC_RSHIFT:
-		instance->keyflags &= ~PRESSED_SHIFT;
-		break;
-	case SC_CAPSLOCK:
-		instance->keyflags &= ~PRESSED_CAPSLOCK;
-		if (instance->lockflags & LOCKED_CAPSLOCK)
-			instance->lockflags &= ~LOCKED_CAPSLOCK;
-		else
-			instance->lockflags |= LOCKED_CAPSLOCK;
-		break;
-	default:
-		break;
-	}
-	
-	spinlock_unlock(&instance->keylock);
-}
-
-/** Process keypress.
- *
- * @param sc Scancode of the key being pressed.
- */
-static void key_pressed(kbrd_instance_t *instance, wchar_t sc)
-{
-	bool letter;
-	bool shift;
-	bool capslock;
-	
-	spinlock_lock(&instance->keylock);
-	
-	switch (sc) {
-	case SC_LSHIFT:
-	case SC_RSHIFT:
-		instance->keyflags |= PRESSED_SHIFT;
-		break;
-	case SC_CAPSLOCK:
-		instance->keyflags |= PRESSED_CAPSLOCK;
-		break;
-	case SC_SCAN_ESCAPE:
-		break;
-	default:
-		letter = islower(sc_primary_map[sc]);
-		shift = instance->keyflags & PRESSED_SHIFT;
-		capslock = (instance->keyflags & PRESSED_CAPSLOCK) ||
-		    (instance->lockflags & LOCKED_CAPSLOCK);
-		
-		if ((letter) && (capslock))
-			shift = !shift;
-		
-		if (shift)
-			indev_push_character(instance->sink, sc_secondary_map[sc]);
-		else
-			indev_push_character(instance->sink, sc_primary_map[sc]);
-		break;
-	}
-	
-	spinlock_unlock(&instance->keylock);
-}
-
-static void kkbrd(void *arg)
-{
-	static int key_released_flag = 0;
-	static int is_locked = 0;
-	kbrd_instance_t *instance = (kbrd_instance_t *) arg;
-	
-	while (true) {
-		wchar_t sc = indev_pop_character(&instance->raw);
-
-		if (sc == PL050_KEY_RELEASE) {
-			key_released_flag = 1;
-		} else {
-			if (key_released_flag) {
-				key_released_flag = 0;
-				if (is_lock_key(sc)) {
-					if (!is_locked) {
-						is_locked = 1;
-					} else {
-						is_locked = 0;
-						continue;
-					}
-				}
-				key_released(instance, sc);
-
-			} else {
-				if (is_lock_key(sc) && is_locked)
-					continue;
-				key_pressed(instance, sc);
-			}
-		}
-		
-	}
-}
-
-kbrd_instance_t *kbrd_init(void)
-{
-	kbrd_instance_t *instance
-	    = malloc(sizeof(kbrd_instance_t), FRAME_ATOMIC);
-	if (instance) {
-		instance->thread
-			= thread_create(kkbrd, (void *) instance, TASK, 0, "kkbrd", false);
-		
-		if (!instance->thread) {
-			free(instance);
-			return NULL;
-		}
-		
-		instance->sink = NULL;
-		indev_initialize("kbrd", &instance->raw, &kbrd_raw_ops);
-		
-		spinlock_initialize(&instance->keylock, "kbrd_pl050.instance.keylock");
-		instance->keyflags = 0;
-		instance->lockflags = 0;
-	}
-	
-	return instance;
-}
-
-indev_t *kbrd_wire(kbrd_instance_t *instance, indev_t *sink)
-{
-	ASSERT(instance);
-	ASSERT(sink);
-	
-	instance->sink = sink;
-	thread_ready(instance->thread);
-	
-	return &instance->raw;
-}
-
-static bool is_lock_key(wchar_t sc)
-{
-	return ((sc == PL050_CAPS_SCAN_CODE) || (sc == PL050_NUM_SCAN_CODE) ||
-		(sc == PL050_SCROLL_SCAN_CODE));
-}
-
-/** @}
- */
Index: rnel/genarch/src/kbrd/scanc_pl050.c
===================================================================
--- kernel/genarch/src/kbrd/scanc_pl050.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,234 +1,0 @@
-/*
- * Copyright (c) 2009 Vineeth Pillai
- * 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, U_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 genarch	
- * @{
- */
-/**
- * @file
- * @brief	Scan codes for pl050 keyboards.
- */
-#include <genarch/kbrd/scanc.h>
-#include <typedefs.h>
-#include <str.h>
-
-
-/** Primary meaning of scancodes. */
-wchar_t sc_primary_map[] = {
-	U_NULL, /* 0x00 */
-	U_SPECIAL, /* 0x01 - F9 */
-	U_SPECIAL, /* 0x02 - F7 */
-	U_SPECIAL, /* 0x03 - F5 */
-	U_SPECIAL, /* 0x04 - F3 */
-	U_SPECIAL, /* 0x05 - F1 */
-	U_SPECIAL, /* 0x06 - F2 */
-	U_SPECIAL, /* 0x07 - F12 */
-	U_SPECIAL, /* 0x08 -  */
-	U_SPECIAL, /* 0x09 - F10 */
-	U_SPECIAL, /* 0x0A - F8 */
-	U_SPECIAL, /* 0x0B - F10 */
-	U_SPECIAL, /* 0x0C - F4 */
-	'\t', /* 0x0D - Tab */
-	'`',
-	U_SPECIAL, /* 0x0F */
-	U_SPECIAL, /* 0x10 */
-	U_SPECIAL, /* 0x11 - LAlt */
-	U_SPECIAL, /* 0x12 - LShift */
-	U_SPECIAL, /* ox13 */
-	U_SPECIAL, /* 0x14 Ctrl */
-	'q', '1',
-	U_SPECIAL, /* 0x17 */
-	U_SPECIAL, /* 0x18 */
-	U_SPECIAL, /* 0x19 */
-	'z', 's', 'a', 'w', '2',
-	U_SPECIAL, /* 0x1F */
-	U_SPECIAL, /* 0x20 */
-	'c', 'x', 'd', 'e', '4', '3',
-	U_SPECIAL, /* 0x27 */
-	U_SPECIAL, /* 0x28 */
-	' ', 'v', 'f', 't', 'r', '5',
-	U_SPECIAL, /* 0x2F */
-	U_SPECIAL, /* 0x30 */
-	'n', 'b', 'h', 'g', 'y', '6',
-	U_SPECIAL, /* 0x37 */
-	U_SPECIAL, /* 0x38 */
-	U_SPECIAL, /* 0x39 */
-	'm', 'j', 'u', '7', '8',
-	U_SPECIAL, /* 0x3F */
-	U_SPECIAL, /* 0x40 */
-	',', 'k', 'i', 'o', '0', '9',
-	U_SPECIAL, /* 0x47 */
-	U_SPECIAL, /* 0x48 */
-	'.', '/', 'l', ';', 'p', '-',
-	U_SPECIAL, /* 0x4F */
-	U_SPECIAL, /* 0x50 */
-	U_SPECIAL, /* 0x51 */
-	'\'',
-	U_SPECIAL, /* 0x53 */
-	'[', '=',
-	U_SPECIAL, /* 0x56 */
-	U_SPECIAL, /* 0x57 */
-	U_SPECIAL, /* 0x58 - Caps Lock */
-	U_SPECIAL, /* 0x59 - RShift */
-	'\n', ']',
-	U_SPECIAL, /* 0x5C */
-	'\\',
-	U_SPECIAL, /* 0x5E */
-	U_SPECIAL, /* 0x5F */
-	U_SPECIAL, /* 0x60 */
-	U_SPECIAL, /* 0x61 */
-	U_SPECIAL, /* 0x62 */
-	U_SPECIAL, /* 0x63 */
-	U_SPECIAL, /* 0x64 */
-	U_SPECIAL, /* 0x65 */
-	'\b', /* 0x66  - backspace*/
-	U_SPECIAL, /* 0x67 */
-	U_SPECIAL, /* 0x68 */
-	U_END_ARROW, /* 0x69 */
-	U_SPECIAL, /* 0x6a */
-	U_LEFT_ARROW, /* 0x6b - Left Arrow */
-	U_SPECIAL, /* 0x6c */
-	U_SPECIAL, /* 0x6d */
-	U_SPECIAL, /* 0x6e */
-	U_SPECIAL, /* 0x6f */
-	U_SPECIAL, /* 0x70 */
-	U_DELETE, /* 0x71 - Del*/
-	U_DOWN_ARROW, /* 0x72 Down Arrow */
-	U_SPECIAL, /* 0x73 */
-	U_RIGHT_ARROW, /* 0x74  - Right Arrow */
-	U_UP_ARROW, /* 0x75  Up Arrow */
-	U_ESCAPE, /* 0x76 Esc */
-	U_SPECIAL, /* 0x77 - NumLock*/
-	U_SPECIAL, /* 0x78  F11*/
-	U_SPECIAL, /* 0x79 */
-	U_PAGE_DOWN, /* 0x7a */
-	U_SPECIAL, /* 0x7b */
-	U_SPECIAL, /* 0x7c */
-	U_PAGE_UP, /* 0x7d */
-	U_SPECIAL, /* 0x7e */
-	U_SPECIAL /* 0x7f */
-};
-
-/** Secondary meaning of scancodes. */
-wchar_t sc_secondary_map[] = {
-	U_NULL, /* 0x00 */
-	U_SPECIAL, /* 0x01 - F9 */
-	U_SPECIAL, /* 0x02 - F7 */
-	U_SPECIAL, /* 0x03 - F5 */
-	U_SPECIAL, /* 0x04 - F3 */
-	U_SPECIAL, /* 0x05 - F1 */
-	U_SPECIAL, /* 0x06 - F2 */
-	U_SPECIAL, /* 0x07 - F12 */
-	U_SPECIAL, /* 0x08 -  */
-	U_SPECIAL, /* 0x09 - F10 */
-	U_SPECIAL, /* 0x0A - F8 */
-	U_SPECIAL, /* 0x0B - F10 */
-	U_SPECIAL, /* 0x0C - F4 */
-	'\t', /* 0x0D - Tab */
-	'~',
-	U_SPECIAL, /* 0x0F */
-	U_SPECIAL, /* 0x10 */
-	U_SPECIAL, /* 0x11 - LAlt */
-	U_SPECIAL, /* 0x12 - LShift */
-	U_SPECIAL, /* ox13 */
-	U_SPECIAL, /* 0x14 Ctrl */
-	'Q', '!',
-	U_SPECIAL, /* 0x17 */
-	U_SPECIAL, /* 0x18 */
-	U_SPECIAL, /* 0x19 */
-	'Z', 'S', 'A', 'W', '@',
-	U_SPECIAL, /* 0x1F */
-	U_SPECIAL, /* 0x20 */
-	'C', 'X', 'D', 'E', '$', '#',
-	U_SPECIAL, /* 0x27 */
-	U_SPECIAL, /* 0x28 */
-	' ', 'V', 'F', 'T', 'R', '%',
-	U_SPECIAL, /* 0x2F */
-	U_SPECIAL, /* 0x30 */
-	'N', 'B', 'H', 'G', 'Y', '^',
-	U_SPECIAL, /* 0x37 */
-	U_SPECIAL, /* 0x38 */
-	U_SPECIAL, /* 0x39 */
-	'M', 'J', 'U', '&', '*',
-	U_SPECIAL, /* 0x3F */
-	U_SPECIAL, /* 0x40 */
-	'<', 'K', 'I', 'O', ')', '(',
-	U_SPECIAL, /* 0x47 */
-	U_SPECIAL, /* 0x48 */
-	'>', '?', 'L', ':', 'P', '_',
-	U_SPECIAL, /* 0x4F */
-	U_SPECIAL, /* 0x50 */
-	U_SPECIAL, /* 0x51 */
-	'"',
-	U_SPECIAL, /* 0x53 */
-	'{', '+',
-	U_SPECIAL, /* 0x56 */
-	U_SPECIAL, /* 0x57 */
-	U_SPECIAL, /* 0x58 - Caps Lock */
-	U_SPECIAL, /* 0x59 - RShift */
-	'\n', '}',
-	U_SPECIAL, /* 0x5C */
-	'|',
-	U_SPECIAL, /* 0x5E */
-	U_SPECIAL, /* 0x5F */
-	U_SPECIAL, /* 0x60 */
-	U_SPECIAL, /* 0x61 */
-	U_SPECIAL, /* 0x62 */
-	U_SPECIAL, /* 0x63 */
-	U_SPECIAL, /* 0x64 */
-	U_SPECIAL, /* 0x65 */
-	'\b', /* 0x66  - backspace*/
-	U_SPECIAL, /* 0x67 */
-	U_SPECIAL, /* 0x68 */
-	U_END_ARROW, /* 0x69 */
-	U_SPECIAL, /* 0x6a */
-	U_LEFT_ARROW, /* 0x6b - Left Arrow */
-	U_SPECIAL, /* 0x6c */
-	U_SPECIAL, /* 0x6d */
-	U_SPECIAL, /* 0x6e */
-	U_SPECIAL, /* 0x6f */
-	U_SPECIAL, /* 0x70 */
-	U_DELETE, /* 0x71 - Del*/
-	U_DOWN_ARROW, /* 0x72 Down Arrow */
-	U_SPECIAL, /* 0x73 */
-	U_RIGHT_ARROW, /* 0x74  - Right Arrow */
-	U_UP_ARROW, /* 0x75  Up Arrow */
-	U_ESCAPE, /* 0x76 Esc */
-	U_SPECIAL, /* 0x77 - NumLock*/
-	U_SPECIAL, /* 0x78  F11*/
-	U_SPECIAL, /* 0x79 */
-	U_PAGE_DOWN, /* 0x7a */
-	U_SPECIAL, /* 0x7b */
-	U_SPECIAL, /* 0x7c */
-	U_PAGE_UP, /* 0x7d */
-	U_SPECIAL, /* 0x7e */
-	U_SPECIAL /* 0x7f */
-};
-
-/** @}
- */
Index: kernel/genarch/src/ofw/ebus.c
===================================================================
--- kernel/genarch/src/ofw/ebus.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/genarch/src/ofw/ebus.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -39,5 +39,4 @@
 #include <genarch/ofw/ebus.h>
 #include <genarch/ofw/pci.h>
-#include <arch/memstr.h>
 #include <str.h>
 #include <panic.h>
Index: kernel/genarch/src/ofw/fhc.c
===================================================================
--- kernel/genarch/src/ofw/fhc.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/genarch/src/ofw/fhc.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -39,5 +39,4 @@
 #include <genarch/ofw/fhc.h>
 #include <arch/drivers/fhc.h>
-#include <arch/memstr.h>
 #include <str.h>
 #include <panic.h>
Index: kernel/genarch/src/ofw/ofw_tree.c
===================================================================
--- kernel/genarch/src/ofw/ofw_tree.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/genarch/src/ofw/ofw_tree.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -37,6 +37,6 @@
 
 #include <genarch/ofw/ofw_tree.h>
-#include <arch/memstr.h>
 #include <mm/slab.h>
+#include <memstr.h>
 #include <str.h>
 #include <panic.h>
Index: kernel/genarch/src/ofw/pci.c
===================================================================
--- kernel/genarch/src/ofw/pci.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/genarch/src/ofw/pci.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -40,5 +40,4 @@
 #include <arch/drivers/pci.h>
 #include <arch/trap/interrupt.h>
-#include <arch/memstr.h>
 #include <str.h>
 #include <panic.h>
Index: kernel/genarch/src/ofw/upa.c
===================================================================
--- kernel/genarch/src/ofw/upa.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/genarch/src/ofw/upa.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -38,5 +38,4 @@
 #include <genarch/ofw/ofw_tree.h>
 #include <genarch/ofw/upa.h>
-#include <arch/memstr.h>
 #include <func.h>
 #include <panic.h>
Index: kernel/generic/include/lib/memfnc.h
===================================================================
--- kernel/generic/include/lib/memfnc.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
+++ kernel/generic/include/lib/memfnc.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011 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.
+ */
+
+/** @addtogroup generic
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_LIB_MEMFNC_H_
+#define KERN_LIB_MEMFNC_H_
+
+#include <typedefs.h>
+
+extern void *memset(void *, int, size_t);
+extern void *memcpy(void *, const void *, size_t);
+
+#endif
+
+/** @}
+ */
Index: kernel/generic/include/memstr.h
===================================================================
--- kernel/generic/include/memstr.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/generic/include/memstr.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -37,13 +37,11 @@
 
 #include <typedefs.h>
-#include <arch/memstr.h>
 
-/*
- * Architecture independent variants.
- */
-extern void *_memcpy(void *dst, const void *src, size_t cnt);
-extern void _memsetb(void *dst, size_t cnt, uint8_t x);
-extern void _memsetw(void *dst, size_t cnt, uint16_t x);
-extern void *memmove(void *dst, const void *src, size_t cnt);
+#define memset(dst, val, cnt)  __builtin_memset((dst), (val), (cnt))
+#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
+
+extern void memsetb(void *, size_t, uint8_t);
+extern void memsetw(void *, size_t, uint16_t);
+extern void *memmove(void *, const void *, size_t);
 
 #endif
Index: kernel/generic/src/lib/memfnc.c
===================================================================
--- kernel/generic/src/lib/memfnc.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
+++ kernel/generic/src/lib/memfnc.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -0,0 +1,91 @@
+	/*
+ * Copyright (c) 2011 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.
+ */
+
+/** @addtogroup generic
+ * @{
+ */
+
+/**
+ * @file
+ * @brief Memory string functions.
+ *
+ * This file provides architecture independent functions to manipulate blocks
+ * of memory. These functions are optimized as much as generic functions of
+ * this type can be.
+ */
+
+#include <lib/memfnc.h>
+#include <typedefs.h>
+
+/** Fill block of memory.
+ *
+ * Fill cnt bytes at dst address with the value val.
+ *
+ * @param dst Destination address to fill.
+ * @param val Value to fill.
+ * @param cnt Number of bytes to fill.
+ *
+ * @return Destination address.
+ *
+ */
+void *memset(void *dst, int val, size_t cnt)
+{
+	size_t i;
+	uint8_t *ptr = (uint8_t *) dst;
+	
+	for (i = 0; i < cnt; i++)
+		ptr[i] = val;
+	
+	return dst;
+}
+
+/** Move memory block without overlapping.
+ *
+ * Copy cnt bytes from src address to dst address. The source
+ * and destination memory areas cannot overlap.
+ *
+ * @param dst Destination address to copy to.
+ * @param src Source address to copy from.
+ * @param cnt Number of bytes to copy.
+ *
+ * @return Destination address.
+ *
+ */
+void *memcpy(void *dst, const void *src, size_t cnt)
+{
+	uint8_t *dp = (uint8_t *) dst;
+	const uint8_t *sp = (uint8_t *) src;
+	
+	while (cnt-- != 0)
+			*dp++ = *sp++;
+	
+	return dst;
+}
+
+/** @}
+ */
Index: kernel/generic/src/lib/memstr.c
===================================================================
--- kernel/generic/src/lib/memstr.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/generic/src/lib/memstr.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -28,5 +28,5 @@
  */
 
-/** @addtogroup generic	
+/** @addtogroup generic
  * @{
  */
@@ -34,129 +34,90 @@
 /**
  * @file
- * @brief	Memory string operations.
+ * @brief Memory string operations.
  *
- * This file provides architecture independent functions to manipulate blocks of
- * memory. These functions are optimized as much as generic functions of this
- * type can be. However, architectures are free to provide even more optimized
- * versions of these functions.
+ * This file provides architecture independent functions to manipulate blocks
+ * of memory. These functions are optimized as much as generic functions of
+ * this type can be.
  */
 
 #include <memstr.h>
 #include <typedefs.h>
-#include <align.h>
 
-/** Copy block of memory.
+/** Fill block of memory.
  *
- * Copy cnt bytes from src address to dst address.  The copying is done
- * word-by-word and then byte-by-byte.  The source and destination memory areas
- * cannot overlap.
+ * Fill cnt bytes at dst address with the value val.
  *
- * @param src		Source address to copy from.
- * @param dst		Destination address to copy to.
- * @param cnt		Number of bytes to copy.
+ * @param dst Destination address to fill.
+ * @param cnt Number of bytes to fill.
+ * @param val Value to fill.
  *
- * @return		Destination address.
  */
-void *_memcpy(void *dst, const void *src, size_t cnt)
+void memsetb(void *dst, size_t cnt, uint8_t val)
 {
-	unsigned int i, j;
+	memset(dst, val, cnt);
+}
+
+/** Fill block of memory.
+ *
+ * Fill cnt words at dst address with the value val. The filling
+ * is done word-by-word.
+ *
+ * @param dst Destination address to fill.
+ * @param cnt Number of words to fill.
+ * @param val Value to fill.
+ *
+ */
+void memsetw(void *dst, size_t cnt, uint16_t val)
+{
+	size_t i;
+	uint16_t *ptr = (uint16_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(sysarg_t); i++)
-			((sysarg_t *) dst)[i] = ((sysarg_t *) src)[i];
-		
-		for (j = 0; j < cnt % sizeof(sysarg_t); j++)
-			((uint8_t *)(((sysarg_t *) dst) + i))[j] =
-			    ((uint8_t *)(((sysarg_t *) src) + i))[j];
-	}
-		
-	return (char *) dst;
+	for (i = 0; i < cnt; i++)
+		ptr[i] = val;
 }
 
 /** Move memory block with possible overlapping.
  *
- * Copy cnt bytes from src address to dst address. The source and destination
- * memory areas may overlap.
+ * Copy cnt bytes from src address to dst address. The source
+ * and destination memory areas may overlap.
  *
- * @param src		Source address to copy from.
- * @param dst		Destination address to copy to.
- * @param cnt		Number of bytes to copy.
+ * @param dst Destination address to copy to.
+ * @param src Source address to copy from.
+ * @param cnt Number of bytes to copy.
  *
- * @return		Destination address.
+ * @return Destination address.
+ *
  */
-void *memmove(void *dst, const void *src, size_t n)
+void *memmove(void *dst, const void *src, size_t cnt)
 {
-	const uint8_t *sp;
-	uint8_t *dp;
-
 	/* Nothing to do? */
 	if (src == dst)
 		return dst;
-
+	
 	/* Non-overlapping? */
-	if (dst >= src + n || src >= dst + n) {	
-		return memcpy(dst, src, n);
-	}
-
+	if ((dst >= src + cnt) || (src >= dst + cnt))
+		return memcpy(dst, src, cnt);
+	
+	uint8_t *dp;
+	const uint8_t *sp;
+	
 	/* Which direction? */
 	if (src > dst) {
 		/* Forwards. */
+		dp = dst;
 		sp = src;
-		dp = dst;
-
-		while (n-- != 0)
+		
+		while (cnt-- != 0)
 			*dp++ = *sp++;
 	} else {
 		/* Backwards. */
-		sp = src + (n - 1);
-		dp = dst + (n - 1);
-
-		while (n-- != 0)
+		dp = dst + (cnt - 1);
+		sp = src + (cnt - 1);
+		
+		while (cnt-- != 0)
 			*dp-- = *sp--;
 	}
-
+	
 	return dst;
-}
-
-/** Fill block of memory
- *
- * Fill cnt bytes at dst address with the value x.  The filling is done
- * byte-by-byte.
- *
- * @param dst		Destination address to fill.
- * @param cnt		Number of bytes to fill.
- * @param x		Value to fill.
- *
- */
-void _memsetb(void *dst, size_t cnt, uint8_t x)
-{
-	unsigned int i;
-	uint8_t *p = (uint8_t *) dst;
-	
-	for (i = 0; i < cnt; i++)
-		p[i] = x;
-}
-
-/** Fill block of memory.
- *
- * Fill cnt words at dst address with the value x.  The filling is done
- * word-by-word.
- *
- * @param dst		Destination address to fill.
- * @param cnt		Number of words to fill.
- * @param x		Value to fill.
- *
- */
-void _memsetw(void *dst, size_t cnt, uint16_t x)
-{
-	unsigned int i;
-	uint16_t *p = (uint16_t *) dst;
-	
-	for (i = 0; i < cnt; i++)
-		p[i] = x;	
 }
 
Index: kernel/generic/src/mm/backend_elf.c
===================================================================
--- kernel/generic/src/mm/backend_elf.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ kernel/generic/src/mm/backend_elf.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -91,7 +91,11 @@
 	if (!as_area_check_access(area, access))
 		return AS_PF_FAULT;
-
-	ASSERT((addr >= ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) &&
-	    (addr < entry->p_vaddr + entry->p_memsz));
+	
+	if (addr < ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE))
+		return AS_PF_FAULT;
+	
+	if (addr >= entry->p_vaddr + entry->p_memsz)
+		return AS_PF_FAULT;
+	
 	i = (addr - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;
 	base = (uintptr_t)
Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ tools/autotool.py	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -501,5 +501,5 @@
 		cross_prefix = os.environ['CROSS_PREFIX']
 	else:
-		cross_prefix = "/usr/local"
+		cross_prefix = "/usr/local/cross"
 	
 	# Prefix binutils tools on Solaris
Index: tools/toolchain.sh
===================================================================
--- tools/toolchain.sh	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ tools/toolchain.sh	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -52,4 +52,13 @@
 #endif
 EOF
+
+BINUTILS_VERSION="2.21"
+GCC_VERSION="4.6.0"
+
+BASEDIR="`pwd`"
+BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2"
+GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2"
+GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2"
+GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2"
 
 #
@@ -139,8 +148,9 @@
 	echo " sparc64    SPARC V9"
 	echo " all        build all targets"
+	echo " parallel   same as 'all', but in parallel"
 	echo
 	echo "The toolchain will be installed to the directory specified by"
 	echo "the CROSS_PREFIX environment variable. If the variable is not"
-	echo "defined, /usr/local will be used by default."
+	echo "defined, /usr/local/cross will be used by default."
 	echo
 	
@@ -194,5 +204,5 @@
 }
 
-download_check() {
+download_fetch() {
 	SOURCE="$1"
 	FILE="$2"
@@ -208,4 +218,15 @@
 }
 
+source_check() {
+	FILE="$1"
+	
+	if [ ! -f "${FILE}" ]; then
+		echo
+		echo "File ${FILE} not found."
+		
+		exit 4
+	fi
+}
+
 cleanup_dir() {
 	DIR="$1"
@@ -241,25 +262,16 @@
 }
 
-patch_binutils() {
-	PLATFORM="$1"
-	
-	if [ "${PLATFORM}" == "arm32" ] ; then
-		patch -p1 <<EOF
-diff -Naur binutils-2.20.orig/gas/config/tc-arm.c binutils-2.20/gas/config/tc-arm.c
---- binutils-2.20.orig/gas/config/tc-arm.c	2009-08-30 00:10:59.000000000 +0200
-+++ binutils-2.20/gas/config/tc-arm.c	2009-11-02 14:25:11.000000000 +0100
-@@ -2485,8 +2485,9 @@
-       know (frag->tc_frag_data.first_map == NULL);
-       frag->tc_frag_data.first_map = symbolP;
-     }
--  if (frag->tc_frag_data.last_map != NULL)
-+  if (frag->tc_frag_data.last_map != NULL) {
-     know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP));
-+  }
-   frag->tc_frag_data.last_map = symbolP;
- }
-EOF
-		check_error $? "Error patching binutils"
-	fi
+prepare() {
+	show_dependencies
+	check_dependecies
+	show_countdown 10
+	
+	BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/"
+	GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/"
+	
+	download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "c84c5acc9d266f1a7044b51c85a823f5"
+	download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "b1957f3209080b2f55bc3756d3a62b7c"
+	download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "120d4675366ee82ea52f9ed65b57da04"
+	download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "a30090fa655d0db4c970740d353c81f1"
 }
 
@@ -268,16 +280,5 @@
 	TARGET="$2"
 	
-	BINUTILS_VERSION="2.20"
-	GCC_VERSION="4.5.1"
-	
-	BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2"
-	GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2"
-	GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2"
-	GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2"
-	
-	BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/"
-	GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/"
-	
-	WORKDIR="`pwd`"
+	WORKDIR="${BASEDIR}/${PLATFORM}"
 	BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}"
 	GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}"
@@ -285,5 +286,5 @@
 	
 	if [ -z "${CROSS_PREFIX}" ] ; then
-		CROSS_PREFIX="/usr/local"
+		CROSS_PREFIX="/usr/local/cross"
 	fi
 	
@@ -291,14 +292,12 @@
 	
 	echo ">>> Downloading tarballs"
-	download_check "${BINUTILS_SOURCE}" "${BINUTILS}" "ee2d3e996e9a2d669808713360fa96f8"
-	download_check "${GCC_SOURCE}" "${GCC_CORE}" "dc8959e31b01a65ce10d269614815054"
-	download_check "${GCC_SOURCE}" "${GCC_OBJC}" "3c11b7037896e967eddf8178af2ddd98"
-	download_check "${GCC_SOURCE}" "${GCC_CPP}" "b294953ff0bb2f20c7acb2bf005d832a"
+	source_check "${BASEDIR}/${BINUTILS}"
+	source_check "${BASEDIR}/${GCC_CORE}"
+	source_check "${BASEDIR}/${GCC_OBJC}"
+	source_check "${BASEDIR}/${GCC_CPP}"
 	
 	echo ">>> Removing previous content"
 	cleanup_dir "${PREFIX}"
-	cleanup_dir "${OBJDIR}"
-	cleanup_dir "${BINUTILSDIR}"
-	cleanup_dir "${GCCDIR}"
+	cleanup_dir "${WORKDIR}"
 	
 	create_dir "${PREFIX}" "destination directory"
@@ -306,13 +305,15 @@
 	
 	echo ">>> Unpacking tarballs"
-	unpack_tarball "${BINUTILS}" "binutils"
-	unpack_tarball "${GCC_CORE}" "GCC Core"
-	unpack_tarball "${GCC_OBJC}" "Objective C"
-	unpack_tarball "${GCC_CPP}" "C++"
+	cd "${WORKDIR}"
+	check_error $? "Change directory failed."
+	
+	unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils"
+	unpack_tarball "${BASEDIR}/${GCC_CORE}" "GCC Core"
+	unpack_tarball "${BASEDIR}/${GCC_OBJC}" "Objective C"
+	unpack_tarball "${BASEDIR}/${GCC_CPP}" "C++"
 	
 	echo ">>> Processing binutils (${PLATFORM})"
 	cd "${BINUTILSDIR}"
 	check_error $? "Change directory failed."
-	patch_binutils "${PLATFORM}"
 	
 	change_title "binutils: configure (${PLATFORM})"
@@ -336,11 +337,9 @@
 	check_error $? "Error compiling/installing GCC."
 	
-	cd "${WORKDIR}"
+	cd "${BASEDIR}"
 	check_error $? "Change directory failed."
 	
 	echo ">>> Cleaning up"
-	cleanup_dir "${OBJDIR}"
-	cleanup_dir "${BINUTILSDIR}"
-	cleanup_dir "${GCCDIR}"
+	cleanup_dir "${WORKDIR}"
 	
 	echo
@@ -352,47 +351,50 @@
 fi
 
-show_dependencies
-check_dependecies
-show_countdown 10
-
 case "$1" in
 	"amd64")
+		prepare
 		build_target "amd64" "amd64-linux-gnu"
 		;;
 	"arm32")
+		prepare
 		build_target "arm32" "arm-linux-gnu"
 		;;
 	"ia32")
+		prepare
 		build_target "ia32" "i686-pc-linux-gnu"
 		;;
 	"ia64")
+		prepare
 		build_target "ia64" "ia64-pc-linux-gnu"
 		;;
-	"ia64")
-		build_target "ia64" "ia64-pc-linux-gnu"
-		;;
 	"mips32")
+		prepare
 		build_target "mips32" "mipsel-linux-gnu"
 		;;
 	"mips32eb")
+		prepare
 		build_target "mips32eb" "mips-linux-gnu"
 		;;
 	"mips64")
+		prepare
 		build_target "mips64" "mips64el-linux-gnu"
 		;;
 	"ppc32")
+		prepare
 		build_target "ppc32" "ppc-linux-gnu"
 		;;
 	"ppc64")
+		prepare
 		build_target "ppc64" "ppc64-linux-gnu"
 		;;
 	"sparc64")
+		prepare
 		build_target "sparc64" "sparc64-linux-gnu"
 		;;
 	"all")
+		prepare
 		build_target "amd64" "amd64-linux-gnu"
 		build_target "arm32" "arm-linux-gnu"
 		build_target "ia32" "i686-pc-linux-gnu"
-		build_target "ia64" "ia64-pc-linux-gnu"
 		build_target "ia64" "ia64-pc-linux-gnu"
 		build_target "mips32" "mipsel-linux-gnu"
@@ -403,4 +405,18 @@
 		build_target "sparc64" "sparc64-linux-gnu"
 		;;
+	"parallel")
+		prepare
+		build_target "amd64" "amd64-linux-gnu" &
+		build_target "arm32" "arm-linux-gnu" &
+		build_target "ia32" "i686-pc-linux-gnu" &
+		build_target "ia64" "ia64-pc-linux-gnu" &
+		build_target "mips32" "mipsel-linux-gnu" &
+		build_target "mips32eb" "mips-linux-gnu" &
+		build_target "mips64" "mips64el-linux-gnu" &
+		build_target "ppc32" "ppc-linux-gnu" &
+		build_target "ppc64" "ppc64-linux-gnu" &
+		build_target "sparc64" "sparc64-linux-gnu" &
+		wait
+		;;
 	*)
 		show_usage
Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -1,3 +1,4 @@
 /* Copyright (c) 2008, Tim Post <tinkertim@gmail.com>
+ * Copyright (c) 2011, Martin Sucha
  * All rights reserved.
  *
@@ -35,4 +36,11 @@
 #include <str.h>
 #include <fcntl.h>
+#include <io/console.h>
+#include <io/color.h>
+#include <io/style.h>
+#include <io/keycode.h>
+#include <errno.h>
+#include <vfs/vfs.h>
+#include <assert.h>
 
 #include "config.h"
@@ -48,4 +56,12 @@
 
 static const char *cat_oops = "That option is not yet supported\n";
+static const char *hexchars = "0123456789abcdef";
+
+static bool paging_enabled = false;
+static size_t chars_remaining = 0;
+static size_t lines_remaining = 0;
+static sysarg_t console_cols = 0;
+static sysarg_t console_rows = 0;
+static bool should_quit = false;
 
 static struct option const long_options[] = {
@@ -56,4 +72,5 @@
 	{ "buffer", required_argument, 0, 'b' },
 	{ "more", no_argument, 0, 'm' },
+	{ "hex", no_argument, 0, 'x' },
 	{ 0, 0, 0, 0 }
 };
@@ -75,4 +92,5 @@
 		"  -b, --buffer ##  Set the read buffer size to ##\n"
 		"  -m, --more       Pause after each screen full\n"
+		"  -x, --hex        Print bytes as hex values\n"
 		"Currently, %s is under development, some options don't work.\n",
 		cmdname, cmdname);
@@ -82,9 +100,71 @@
 }
 
-static unsigned int cat_file(const char *fname, size_t blen)
+static void waitprompt()
+{
+	console_set_pos(fphone(stdout), 0, console_rows-1);
+	console_set_color(fphone(stdout), COLOR_BLUE, COLOR_WHITE, 0);
+	printf("ENTER/SPACE/PAGE DOWN - next page, "
+	       "ESC/Q - quit, C - continue unpaged");
+	fflush(stdout);
+	console_set_style(fphone(stdout), STYLE_NORMAL);
+}
+
+static void waitkey()
+{
+	console_event_t ev;
+	
+	while (true) {
+		if (!console_get_event(fphone(stdin), &ev)) {
+			return;
+		}
+		if (ev.type == KEY_PRESS) {
+			if (ev.key == KC_ESCAPE || ev.key == KC_Q) {
+				should_quit = true;
+				return;
+			}
+			if (ev.key == KC_C) {
+				paging_enabled = false;
+				return;
+			}
+			if (ev.key == KC_ENTER || ev.key == KC_SPACE ||
+			    ev.key == KC_PAGE_DOWN) {
+				return;
+			}
+		}
+	}
+	assert(false);
+}
+
+static void newpage()
+{
+	console_clear(fphone(stdout));
+	chars_remaining = console_cols;
+	lines_remaining = console_rows-1;
+}
+
+static void paged_char(wchar_t c)
+{
+	putchar(c);
+	if (paging_enabled) {
+		chars_remaining--;
+		if (c == '\n' || chars_remaining == 0) {
+			chars_remaining = console_cols;
+			lines_remaining--;
+		}
+		if (lines_remaining == 0) {
+			fflush(stdout);
+			waitprompt();
+			waitkey();
+			newpage();
+		}
+	}
+}
+
+static unsigned int cat_file(const char *fname, size_t blen, bool hex)
 {
 	int fd, bytes = 0, count = 0, reads = 0;
-	off64_t total = 0;
 	char *buff = NULL;
+	int i;
+	size_t offset = 0;
 
 	fd = open(fname, O_RDONLY);
@@ -93,7 +173,4 @@
 		return 1;
 	}
-
-	total = lseek(fd, 0, SEEK_END);
-	lseek(fd, 0, SEEK_SET);
 
 	if (NULL == (buff = (char *) malloc(blen + 1))) {
@@ -109,8 +186,23 @@
 			count += bytes;
 			buff[bytes] = '\0';
-			printf("%s", buff);
+			offset = 0;
+			for (i = 0; i < bytes && !should_quit; i++) {
+				if (hex) {
+					paged_char(hexchars[((uint8_t)buff[i])/16]);
+					paged_char(hexchars[((uint8_t)buff[i])%16]);
+				}
+				else {
+					wchar_t c = str_decode(buff, &offset, bytes);
+					if (c == 0) {
+						// reached end of string
+						break;
+					}
+					paged_char(c);
+				}
+				
+			}
 			reads++;
 		}
-	} while (bytes > 0);
+	} while (bytes > 0 && !should_quit);
 
 	close(fd);
@@ -131,9 +223,22 @@
 	unsigned int argc, i, ret = 0, buffer = 0;
 	int c, opt_ind;
+	bool hex = false;
+	bool more = false;
+	sysarg_t rows, cols;
+	int rc;
+	
+	// reset global state
+	// TODO: move to structure?
+	paging_enabled = false;
+	chars_remaining = 0;
+	lines_remaining = 0;
+	console_cols = 0;
+	console_rows = 0;
+	should_quit = false;
 
 	argc = cli_count_args(argv);
 
 	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
-		c = getopt_long(argc, argv, "hvmH:t:b:", long_options, &opt_ind);
+		c = getopt_long(argc, argv, "xhvmH:t:b:", long_options, &opt_ind);
 		switch (c) {
 		case 'h':
@@ -153,6 +258,9 @@
 			break;
 		case 'm':
-			printf("%s", cat_oops);
-			return CMD_FAILURE;
+			more = true;
+			break;
+		case 'x':
+			hex = true;
+			break;
 		}
 	}
@@ -168,7 +276,19 @@
 	if (buffer <= 0)
 		buffer = CAT_DEFAULT_BUFLEN;
-
-	for (i = optind; argv[i] != NULL; i++)
-		ret += cat_file(argv[i], buffer);
+	
+	if (more) {
+		rc = console_get_size(fphone(stdout), &cols, &rows);
+		if (rc != EOK) {
+			printf("%s - cannot get console size\n", cmdname);
+			return CMD_FAILURE;
+		}
+		console_cols = cols;
+		console_rows = rows;
+		paging_enabled = true;
+		newpage();
+	}
+
+	for (i = optind; argv[i] != NULL && !should_quit; i++)
+		ret += cat_file(argv[i], buffer, hex);
 
 	if (ret)
Index: uspace/app/bdsh/cmds/modules/cat/cat.h
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/app/bdsh/cmds/modules/cat/cat.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -4,5 +4,5 @@
 /* Prototypes for the cat command, excluding entry points */
 
-static unsigned int cat_file(const char *, size_t);
+static unsigned int cat_file(const char *, size_t, bool);
 
 #endif /* CAT_H */
Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -108,4 +108,5 @@
 	for (;;) {
 		ssize_t res;
+		size_t written = 0;
 
 		bytes = read(fd1, buff, blen);
@@ -120,7 +121,8 @@
 			 * returned less data than requested.
 			 */
-			bytes = write(fd2, buff, res);
+			bytes = write(fd2, buff + written, res);
 			if (bytes < 0)
 				goto err;
+			written += bytes;
 			res -= bytes;
 		} while (res > 0);
Index: uspace/app/bdsh/cmds/modules/rm/rm.c
===================================================================
--- uspace/app/bdsh/cmds/modules/rm/rm.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/app/bdsh/cmds/modules/rm/rm.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -101,7 +101,42 @@
 }
 
+static unsigned int rm_recursive_not_empty_dirs(const char *path)
+{
+	DIR *dirp;
+	struct dirent *dp;
+	char buff[PATH_MAX];
+	unsigned int scope;
+	unsigned int ret = 0;
+
+	dirp = opendir(path);
+	if (!dirp) {
+		/* May have been deleted between scoping it and opening it */
+		cli_error(CL_EFAIL, "Could not open %s", path);
+		return ret;
+	}
+
+	memset(buff, 0, sizeof(buff));
+	while ((dp = readdir(dirp))) {
+		snprintf(buff, PATH_MAX - 1, "%s/%s", path, dp->d_name);
+		scope = rm_scope(buff);
+		switch (scope) {
+		case RM_BOGUS:
+			break;
+		case RM_FILE:
+			ret += rm_single(buff);
+			break;
+		case RM_DIR:
+			ret += rm_recursive(buff);
+			break;
+		}
+	}
+	
+	return ret;
+}
+
 static unsigned int rm_recursive(const char *path)
 {
 	int rc;
+	unsigned int ret = 0;
 
 	/* First see if it will just go away */
@@ -111,7 +146,14 @@
 
 	/* Its not empty, recursively scan it */
-	cli_error(CL_ENOTSUP,
-		"Can not remove %s, directory not empty", path);
-	return 1;
+	ret = rm_recursive_not_empty_dirs(path);
+
+	/* Delete directory */
+	rc = rmdir(path);
+	if (rc == 0)
+		return ret;
+
+	cli_error(CL_ENOTSUP, "Can not remove %s", path);
+
+	return ret + 1;
 }
 
Index: uspace/app/sbi/src/run_expr.c
===================================================================
--- uspace/app/sbi/src/run_expr.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/app/sbi/src/run_expr.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -2529,4 +2529,6 @@
 	if (rc1 == EOK)
 		rc2 = os_str_get_char(string->value, elem_index, &cval);
+	else
+		rc2 = EOK;
 
 	if (rc1 != EOK || rc2 != EOK) {
Index: uspace/app/tester/fault/fault2.c
===================================================================
--- uspace/app/tester/fault/fault2.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/app/tester/fault/fault2.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -29,4 +29,5 @@
 
 #include "../tester.h"
+#include <stdio.h>
 
 typedef int __attribute__((may_alias)) aliasing_int;
@@ -38,4 +39,5 @@
 	
 	var1 = *((aliasing_int *) (((char *) (&var)) + 1));
+	printf("Read %d\n", var1);
 	
 	return "Survived unaligned read";
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/app/trace/trace.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -872,5 +872,5 @@
 static display_mask_t parse_display_mask(const char *text)
 {
-	display_mask_t dm;
+	display_mask_t dm = 0;
 	const char *c = text;
 	
Index: uspace/drv/ohci/root_hub.c
===================================================================
--- uspace/drv/ohci/root_hub.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/drv/ohci/root_hub.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -43,4 +43,7 @@
 #include <usb/classes/hub.h>
 
+/**
+ *	standart device descriptor for ohci root hub
+ */
 static const usb_standard_device_descriptor_t ohci_rh_device_descriptor =
 {
@@ -61,4 +64,8 @@
 };
 
+/**
+ * standart configuration descriptor with filled common values
+ * for ohci root hubs
+ */
 static const usb_standard_configuration_descriptor_t ohci_rh_conf_descriptor =
 {
@@ -73,4 +80,7 @@
 };
 
+/**
+ * standart ohci root hub interface descriptor
+ */
 static const usb_standard_interface_descriptor_t ohci_rh_iface_descriptor =
 {
@@ -87,4 +97,7 @@
 };
 
+/**
+ * standart ohci root hub endpoint descriptor
+ */
 static const usb_standard_endpoint_descriptor_t ohci_rh_ep_descriptor =
 {
@@ -117,5 +130,14 @@
 /*----------------------------------------------------------------------------*/
 
-
+/**
+ * create answer to port status_request
+ *
+ * Copy content of corresponding port status register to answer buffer.
+ *
+ * @param instance root hub instance
+ * @param port port number, counted from 1
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_get_port_status_request(rh_t *instance, uint16_t port,
 		usb_transfer_batch_t * request){
@@ -128,4 +150,13 @@
 }
 
+/**
+ * create answer to port status_request
+ *
+ * Copy content of hub status register to answer buffer.
+ *
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_get_hub_status_request(rh_t *instance,
 		usb_transfer_batch_t * request){
@@ -139,5 +170,16 @@
 }
 
-static void usb_create_serialized_hub_descriptor(rh_t *instance, uint8_t ** out_result,
+/**
+ * Create hub descriptor used in hub-driver <-> hub communication
+ * 
+ * This means creating byt array from data in root hub registers. For more
+ * info see usb hub specification.
+ *
+ * @param instance root hub instance
+ * @param@out out_result pointer to resultant serialized descriptor
+ * @param@out out_size size of serialized descriptor
+ */
+static void usb_create_serialized_hub_descriptor(rh_t *instance,
+		uint8_t ** out_result,
 		size_t * out_size) {
 	//base size
@@ -179,4 +221,13 @@
 
 
+/**
+ * create answer to status request
+ *
+ * This might be either hub status or port status request. If neither,
+ * ENOTSUP is returned.
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_get_status_request(rh_t *instance,
 		usb_transfer_batch_t * request)
@@ -201,4 +252,14 @@
 }
 
+/**
+ * create answer to status interrupt consisting of change bitmap
+ *
+ * Result contains bitmap where bit 0 indicates change on hub and
+ * bit i indicates change on i`th port (i>0). For more info see
+ * Hub and Port status bitmap specification in USB specification.
+ * @param instance root hub instance
+ * @param@out buffer pointer to created interrupt mas
+ * @param@out buffer_size size of created interrupt mask
+ */
 static void create_interrupt_mask(rh_t *instance, void ** buffer,
 		size_t * buffer_size){
@@ -224,173 +285,95 @@
 }
 
-
+/**
+ * create standart configuration descriptor for the root hub instance
+ * @param instance root hub instance
+ * @return newly allocated descriptor
+ */
+static usb_standard_configuration_descriptor_t *
+usb_ohci_rh_create_standart_configuration_descriptor(rh_t *instance){
+	usb_standard_configuration_descriptor_t * descriptor =
+			malloc(sizeof(usb_standard_configuration_descriptor_t));
+	memcpy(descriptor, &ohci_rh_conf_descriptor,
+		sizeof(usb_standard_configuration_descriptor_t));
+	/// \TODO should this include device descriptor?
+	const size_t hub_descriptor_size = 7 +
+			2* (instance->port_count / 8 +
+			((instance->port_count % 8 > 0) ? 1 : 0));
+	descriptor->total_length =
+			sizeof(usb_standard_configuration_descriptor_t)+
+			sizeof(usb_standard_endpoint_descriptor_t)+
+			sizeof(usb_standard_interface_descriptor_t)+
+			hub_descriptor_size;
+	return descriptor;
+}
+
+/**
+ * create answer to a descriptor request
+ *
+ * This might be a request for standard (configuration, device, endpoint or
+ * interface) or device specific (hub) descriptor.
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_get_descriptor_request(rh_t *instance,
 		usb_transfer_batch_t *request){
-	/// \TODO
 	usb_device_request_setup_packet_t * setup_request =
 			(usb_device_request_setup_packet_t*)request->setup_buffer;
 	size_t size;
-	const void * result_descriptor;
+	const void * result_descriptor = NULL;
 	const uint16_t setup_request_value = setup_request->value_high;
 			//(setup_request->value_low << 8);
 	bool del = false;
-
 	switch (setup_request_value)
 	{
-	case USB_DESCTYPE_HUB: {
-		uint8_t * descriptor;
-		usb_create_serialized_hub_descriptor(
-		    instance, &descriptor, &size);
-		result_descriptor = descriptor;
-		break;
-	}
-	case USB_DESCTYPE_DEVICE: {
-		usb_log_debug("USB_DESCTYPE_DEVICE\n");
-		result_descriptor = &ohci_rh_device_descriptor;
-		size = sizeof(ohci_rh_device_descriptor);
-		break;
-	}
-	case USB_DESCTYPE_CONFIGURATION: {
-		usb_log_debug("USB_DESCTYPE_CONFIGURATION\n");
-		usb_standard_configuration_descriptor_t * descriptor =
-				malloc(sizeof(usb_standard_configuration_descriptor_t));
-		memcpy(descriptor, &ohci_rh_conf_descriptor,
-		    sizeof(usb_standard_configuration_descriptor_t));
-		/// \TODO should this include device descriptor?
-		const size_t hub_descriptor_size = 7 +
-				2* (instance->port_count / 8 +
-				((instance->port_count % 8 > 0) ? 1 : 0));
-		descriptor->total_length =
-				sizeof(usb_standard_configuration_descriptor_t)+
-				sizeof(usb_standard_endpoint_descriptor_t)+
-				sizeof(usb_standard_interface_descriptor_t)+
-				hub_descriptor_size;
-		result_descriptor = descriptor;
-		size = sizeof(usb_standard_configuration_descriptor_t);
-		del = true;
-		break;
-	}
-	case USB_DESCTYPE_INTERFACE: {
-		usb_log_debug("USB_DESCTYPE_INTERFACE\n");
-		result_descriptor = &ohci_rh_iface_descriptor;
-		size = sizeof(ohci_rh_iface_descriptor);
-		break;
-	}
-	case USB_DESCTYPE_ENDPOINT: {
-		usb_log_debug("USB_DESCTYPE_ENDPOINT\n");
-		result_descriptor = &ohci_rh_ep_descriptor;
-		size = sizeof(ohci_rh_ep_descriptor);
-		break;
-	}
-	default: {
-		usb_log_debug("USB_DESCTYPE_EINVAL %d \n",setup_request->value);
-		usb_log_debug("\ttype %d\n\trequest %d\n\tvalue %d\n\tindex %d\n\tlen %d\n ",
-				setup_request->request_type,
-				setup_request->request,
-				setup_request_value,
-				setup_request->index,
-				setup_request->length
-				);
-		return EINVAL;
-	}
-	}
-#if 0
-	if(setup_request_value == USB_DESCTYPE_HUB){
-		usb_log_debug("USB_DESCTYPE_HUB\n");
-		//create hub descriptor
-		uint8_t * descriptor;
-		usb_create_serialized_hub_descriptor(instance, 
-				&descriptor, &size);
-		result_descriptor = descriptor;
-	}else if(setup_request_value == USB_DESCTYPE_DEVICE){
-		//create std device descriptor
-		usb_log_debug("USB_DESCTYPE_DEVICE\n");
-		usb_standard_device_descriptor_t * descriptor =
-				(usb_standard_device_descriptor_t*)
-				malloc(sizeof(usb_standard_device_descriptor_t));
-		descriptor->configuration_count = 1;
-		descriptor->descriptor_type = USB_DESCTYPE_DEVICE;
-		descriptor->device_class = USB_CLASS_HUB;
-		descriptor->device_protocol = 0;
-		descriptor->device_subclass = 0;
-		descriptor->device_version = 0;
-		descriptor->length = sizeof(usb_standard_device_descriptor_t);
-		/// \TODO this value is guessed
-		descriptor->max_packet_size = 8;
-		descriptor->product_id = 0x0001;
-		/// \TODO these values migt be different
-		descriptor->str_serial_number = 0;
-		descriptor->str_serial_number = 0;
-		descriptor->usb_spec_version = 0;
-		descriptor->vendor_id = 0x16db;
-		result_descriptor = descriptor;
-		size = sizeof(usb_standard_device_descriptor_t);
-	}else if(setup_request_value == USB_DESCTYPE_CONFIGURATION){
-		usb_log_debug("USB_DESCTYPE_CONFIGURATION\n");
-		usb_standard_configuration_descriptor_t * descriptor =
-				(usb_standard_configuration_descriptor_t*)
-				malloc(sizeof(usb_standard_configuration_descriptor_t));
-		/// \TODO some values are default or guessed
-		descriptor->attributes = 1<<7;
-		descriptor->configuration_number = 1;
-		descriptor->descriptor_type = USB_DESCTYPE_CONFIGURATION;
-		descriptor->interface_count = 1;
-		descriptor->length = sizeof(usb_standard_configuration_descriptor_t);
-		descriptor->max_power = 100;
-		descriptor->str_configuration = 0;
-		/// \TODO should this include device descriptor?
-		size_t hub_descriptor_size = 7 +
-				2* (instance->port_count / 8 +
-				((instance->port_count % 8 > 0) ? 1 : 0));
-		descriptor->total_length =
-				sizeof(usb_standard_configuration_descriptor_t)+
-				sizeof(usb_standard_endpoint_descriptor_t)+
-				sizeof(usb_standard_interface_descriptor_t)+
-				hub_descriptor_size;
-		result_descriptor = descriptor;
-		size = sizeof(usb_standard_configuration_descriptor_t);
-
-	}else if(setup_request_value == USB_DESCTYPE_INTERFACE){
-		usb_log_debug("USB_DESCTYPE_INTERFACE\n");
-		usb_standard_interface_descriptor_t * descriptor =
-				(usb_standard_interface_descriptor_t*)
-				malloc(sizeof(usb_standard_interface_descriptor_t));
-		descriptor->alternate_setting = 0;
-		descriptor->descriptor_type = USB_DESCTYPE_INTERFACE;
-		descriptor->endpoint_count = 1;
-		descriptor->interface_class = USB_CLASS_HUB;
-		/// \TODO is this correct?
-		descriptor->interface_number = 1;
-		descriptor->interface_protocol = 0;
-		descriptor->interface_subclass = 0;
-		descriptor->length = sizeof(usb_standard_interface_descriptor_t);
-		descriptor->str_interface = 0;
-		result_descriptor = descriptor;
-		size = sizeof(usb_standard_interface_descriptor_t);
-	}else if(setup_request_value == USB_DESCTYPE_ENDPOINT){
-		usb_log_debug("USB_DESCTYPE_ENDPOINT\n");
-		usb_standard_endpoint_descriptor_t * descriptor =
-				(usb_standard_endpoint_descriptor_t*)
-				malloc(sizeof(usb_standard_endpoint_descriptor_t));
-		descriptor->attributes = USB_TRANSFER_INTERRUPT;
-		descriptor->descriptor_type = USB_DESCTYPE_ENDPOINT;
-		descriptor->endpoint_address = 1 + (1<<7);
-		descriptor->length = sizeof(usb_standard_endpoint_descriptor_t);
-		descriptor->max_packet_size = 8;
-		descriptor->poll_interval = 255;
-		result_descriptor = descriptor;
-		size = sizeof(usb_standard_endpoint_descriptor_t);
-	}else{
-		usb_log_debug("USB_DESCTYPE_EINVAL %d \n",setup_request->value);
-		usb_log_debug("\ttype %d\n\trequest %d\n\tvalue %d\n\tindex %d\n\tlen %d\n ",
-				setup_request->request_type,
-				setup_request->request,
-				setup_request_value,
-				setup_request->index,
-				setup_request->length
-				);
-		return EINVAL;
-	}
-#endif
+		case USB_DESCTYPE_HUB: {
+			uint8_t * descriptor;
+			usb_create_serialized_hub_descriptor(
+				instance, &descriptor, &size);
+			result_descriptor = descriptor;
+			if(result_descriptor) del = true;
+			break;
+		}
+		case USB_DESCTYPE_DEVICE: {
+			usb_log_debug("USB_DESCTYPE_DEVICE\n");
+			result_descriptor = &ohci_rh_device_descriptor;
+			size = sizeof(ohci_rh_device_descriptor);
+			break;
+		}
+		case USB_DESCTYPE_CONFIGURATION: {
+			usb_log_debug("USB_DESCTYPE_CONFIGURATION\n");
+			usb_standard_configuration_descriptor_t * descriptor =
+					usb_ohci_rh_create_standart_configuration_descriptor(
+						instance);
+			result_descriptor = descriptor;
+			size = sizeof(usb_standard_configuration_descriptor_t);
+			del = true;
+			break;
+		}
+		case USB_DESCTYPE_INTERFACE: {
+			usb_log_debug("USB_DESCTYPE_INTERFACE\n");
+			result_descriptor = &ohci_rh_iface_descriptor;
+			size = sizeof(ohci_rh_iface_descriptor);
+			break;
+		}
+		case USB_DESCTYPE_ENDPOINT: {
+			usb_log_debug("USB_DESCTYPE_ENDPOINT\n");
+			result_descriptor = &ohci_rh_ep_descriptor;
+			size = sizeof(ohci_rh_ep_descriptor);
+			break;
+		}
+		default: {
+			usb_log_debug("USB_DESCTYPE_EINVAL %d \n",setup_request->value);
+			usb_log_debug("\ttype %d\n\trequest %d\n\tvalue %d\n\tindex %d\n\tlen %d\n ",
+					setup_request->request_type,
+					setup_request->request,
+					setup_request_value,
+					setup_request->index,
+					setup_request->length
+					);
+			return EINVAL;
+		}
+	}
 	if(request->buffer_size < size){
 		size = request->buffer_size;
@@ -403,4 +386,12 @@
 }
 
+/**
+ * answer to get configuration request
+ *
+ * Root hub works independently on the configuration.
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_get_configuration_request(rh_t *instance, 
 		usb_transfer_batch_t *request){
@@ -414,4 +405,12 @@
 }
 
+/**
+ * process feature-enabling/disabling request on hub
+ * 
+ * @param instance root hub instance
+ * @param feature feature selector
+ * @param enable enable or disable specified feature
+ * @return error code
+ */
 static int process_hub_feature_set_request(rh_t *instance,
 		uint16_t feature, bool enable){
@@ -427,4 +426,13 @@
 }
 
+/**
+ * process feature-enabling/disabling request on hub
+ * 
+ * @param instance root hub instance
+ * @param feature feature selector
+ * @param port port number, counted from 1
+ * @param enable enable or disable the specified feature
+ * @return error code
+ */
 static int process_port_feature_set_request(rh_t *instance,
 		uint16_t feature, uint16_t port, bool enable){
@@ -442,4 +450,11 @@
 }
 
+/**
+ * register address to this device
+ * 
+ * @param instance root hub instance
+ * @param address new address
+ * @return error code
+ */
 static int process_address_set_request(rh_t *instance,
 		uint16_t address){
@@ -448,4 +463,13 @@
 }
 
+/**
+ * process one of requests that requere output data
+ *
+ * Request can be one of USB_DEVREQ_GET_STATUS, USB_DEVREQ_GET_DESCRIPTOR or
+ * USB_DEVREQ_GET_CONFIGURATION.
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_request_with_output(rh_t *instance,
 		usb_transfer_batch_t *request){
@@ -467,4 +491,13 @@
 }
 
+/**
+ * process one of requests that carry input data
+ *
+ * Request can be one of USB_DEVREQ_SET_DESCRIPTOR or
+ * USB_DEVREQ_SET_CONFIGURATION.
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_request_with_input(rh_t *instance,
 		usb_transfer_batch_t *request){
@@ -483,5 +516,13 @@
 }
 
-
+/**
+ * process one of requests that do not request nor carry additional data
+ *
+ * Request can be one of USB_DEVREQ_CLEAR_FEATURE, USB_DEVREQ_SET_FEATURE or
+ * USB_DEVREQ_SET_ADDRESS.
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
 static int process_request_without_data(rh_t *instance,
 		usb_transfer_batch_t *request){
@@ -513,10 +554,71 @@
 }
 
-
-/**
- *
- * @param instance
- * @param request
- * @return
+/**
+ * process hub control request
+ *
+ * If needed, writes answer into the request structure.
+ * Request can be one of
+ * USB_DEVREQ_GET_STATUS,
+ * USB_DEVREQ_GET_DESCRIPTOR,
+ * USB_DEVREQ_GET_CONFIGURATION,
+ * USB_DEVREQ_CLEAR_FEATURE,
+ * USB_DEVREQ_SET_FEATURE,
+ * USB_DEVREQ_SET_ADDRESS,
+ * USB_DEVREQ_SET_DESCRIPTOR or
+ * USB_DEVREQ_SET_CONFIGURATION.
+ *
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
+ */
+static int process_ctrl_request(rh_t *instance, usb_transfer_batch_t *request){
+	int opResult;
+	if (request->setup_buffer) {
+		if(sizeof(usb_device_request_setup_packet_t)>request->setup_size){
+			usb_log_error("setup packet too small\n");
+			return EINVAL;
+		}
+		usb_log_info("CTRL packet: %s.\n",
+			usb_debug_str_buffer((const uint8_t *)request->setup_buffer, 8, 8));
+		usb_device_request_setup_packet_t * setup_request =
+				(usb_device_request_setup_packet_t*)request->setup_buffer;
+		if(
+			setup_request->request == USB_DEVREQ_GET_STATUS
+			|| setup_request->request == USB_DEVREQ_GET_DESCRIPTOR
+			|| setup_request->request == USB_DEVREQ_GET_CONFIGURATION
+		){
+			usb_log_debug("processing request with output\n");
+			opResult = process_request_with_output(instance,request);
+		}else if(
+			setup_request->request == USB_DEVREQ_CLEAR_FEATURE
+			|| setup_request->request == USB_DEVREQ_SET_FEATURE
+			|| setup_request->request == USB_DEVREQ_SET_ADDRESS
+		){
+			usb_log_debug("processing request without additional data\n");
+			opResult = process_request_without_data(instance,request);
+		}else if(setup_request->request == USB_DEVREQ_SET_DESCRIPTOR
+				|| setup_request->request == USB_DEVREQ_SET_CONFIGURATION
+		){
+			usb_log_debug("processing request with input\n");
+			opResult = process_request_with_input(instance,request);
+		}else{
+			usb_log_warning("received unsuported request: %d\n",
+					setup_request->request
+					);
+			opResult = ENOTSUP;
+		}
+	}else{
+		usb_log_error("root hub received empty transaction?");
+		opResult = EINVAL;
+	}
+	return opResult;
+}
+
+/**
+ * process root hub request
+ *
+ * @param instance root hub instance
+ * @param request structure containing both request and response information
+ * @return error code
  */
 int rh_request(rh_t *instance, usb_transfer_batch_t *request)
@@ -526,42 +628,6 @@
 	int opResult;
 	if(request->transfer_type == USB_TRANSFER_CONTROL){
-		if (request->setup_buffer) {
-			usb_log_info("Root hub got CTRL packet: %s.\n",
-				usb_debug_str_buffer((const uint8_t *)request->setup_buffer, 8, 8));
-			if(sizeof(usb_device_request_setup_packet_t)>request->setup_size){
-				usb_log_error("setup packet too small\n");
-				return EINVAL;
-			}
-			usb_device_request_setup_packet_t * setup_request =
-					(usb_device_request_setup_packet_t*)request->setup_buffer;
-			if(
-				setup_request->request == USB_DEVREQ_GET_STATUS
-				|| setup_request->request == USB_DEVREQ_GET_DESCRIPTOR
-				|| setup_request->request == USB_DEVREQ_GET_CONFIGURATION
-			){
-				usb_log_debug("processing request with output\n");
-				opResult = process_request_with_output(instance,request);
-			}else if(
-				setup_request->request == USB_DEVREQ_CLEAR_FEATURE
-				|| setup_request->request == USB_DEVREQ_SET_FEATURE
-				|| setup_request->request == USB_DEVREQ_SET_ADDRESS
-			){
-				usb_log_debug("processing request without additional data\n");
-				opResult = process_request_without_data(instance,request);
-			}else if(setup_request->request == USB_DEVREQ_SET_DESCRIPTOR
-					|| setup_request->request == USB_DEVREQ_SET_CONFIGURATION
-			){
-				usb_log_debug("processing request with input\n");
-				opResult = process_request_with_input(instance,request);
-			}else{
-				usb_log_warning("received unsuported request: %d\n",
-						setup_request->request
-						);
-				opResult = ENOTSUP;
-			}
-		}else{
-			usb_log_error("root hub received empty transaction?");
-			opResult = EINVAL;
-		}
+		usb_log_info("Root hub got CONTROL packet\n");
+		opResult = process_ctrl_request(instance,request);
 	}else if(request->transfer_type == USB_TRANSFER_INTERRUPT){
 		usb_log_info("Root hub got INTERRUPT packet\n");
@@ -582,6 +648,6 @@
 void rh_interrupt(rh_t *instance)
 {
-	usb_log_error("Root hub interrupt not implemented.\n");
-	/* TODO: implement */
+	usb_log_info("Whoa whoa wait, I`m not supposed to receive any interrupts, am I?\n");
+	/* TODO: implement? */
 }
 /**
Index: uspace/drv/ohci/root_hub.h
===================================================================
--- uspace/drv/ohci/root_hub.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/drv/ohci/root_hub.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -41,8 +41,15 @@
 #include "batch.h"
 
+/**
+ * ohci root hub representation
+ */
 typedef struct rh {
+	/** pointer to ohci driver registers */
 	ohci_regs_t *registers;
+	/** usb address of the root hub */
 	usb_address_t address;
+	/** ddf device information */
 	ddf_dev_t *device;
+	/** hub port count */
 	int port_count;
 } rh_t;
Index: uspace/drv/pciintel/pci.c
===================================================================
--- uspace/drv/pciintel/pci.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/drv/pciintel/pci.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -95,18 +95,11 @@
 	sysarg_t i8259;
 
-	int irc_phone = -1;
-	int irc_service = -1;
-
-	if ((sysinfo_get_value("apic", &apic) == EOK) && (apic)) {
-		irc_service = SERVICE_APIC;
-	} else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)) {
-		irc_service = SERVICE_I8259;
-	}
-
-	if (irc_service == -1) {
-		return false;
-	}
-
-	irc_phone = service_connect_blocking(irc_service, 0, 0);
+	int irc_phone = ENOTSUP;
+
+	if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))
+	    || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) {
+		irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0);
+	}
+
 	if (irc_phone < 0) {
 		return false;
Index: uspace/drv/usbhub/port_status.h
===================================================================
--- uspace/drv/usbhub/port_status.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/drv/usbhub/port_status.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -79,4 +79,22 @@
 
 /**
+ * set the device request to be a port feature enable request
+ * @param request
+ * @param port
+ * @param feature_selector
+ */
+static inline void usb_hub_set_enable_port_feature_request(
+usb_device_request_setup_packet_t * request, uint16_t port,
+		uint16_t feature_selector
+){
+	request->index = port;
+	request->request_type = USB_HUB_REQ_TYPE_SET_PORT_FEATURE;
+	request->request = USB_HUB_REQUEST_SET_FEATURE;
+	request->value = feature_selector;
+	request->length = 0;
+}
+
+
+/**
  * set the device request to be a port enable request
  * @param request
@@ -191,4 +209,5 @@
 	request->length = 0;
 }
+
 
 /** get i`th bit of port status */
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/drv/usbhub/usbhub.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -53,4 +53,20 @@
 #include "usb/classes/classes.h"
 
+
+static void usb_hub_init_add_device(usb_hub_info_t * hub, uint16_t port,
+		usb_speed_t speed);
+
+static int usb_hub_trigger_connecting_non_removable_devices(
+		usb_hub_info_t * hub, usb_hub_descriptor_t * descriptor);
+
+/**
+ * control loop running in hub`s fibril
+ *
+ * Hub`s fibril periodically asks for changes on hub and if needded calls
+ * change handling routine.
+ * @warning currently hub driver asks for changes once a second
+ * @param hub_info_param hub representation pointer
+ * @return zero
+ */
 int usb_hub_control_loop(void * hub_info_param){
 	usb_hub_info_t * hub_info = (usb_hub_info_t*)hub_info_param;
@@ -91,14 +107,14 @@
 
 /**
- * Load hub-specific information into hub_info structure.
+ * Load hub-specific information into hub_info structure and process if needed
  *
  * Particularly read port count and initialize structure holding port
- * information.
+ * information. If there are non-removable devices, start initializing them.
  * This function is hub-specific and should be run only after the hub is
  * configured using usb_hub_set_configuration function.
- * @param hub_info pointer to structure with usb hub data
+ * @param hub_info hub representation
  * @return error code
  */
-static int usb_hub_get_hub_specific_info(usb_hub_info_t * hub_info){
+static int usb_hub_process_hub_specific_info(usb_hub_info_t * hub_info){
 	// get hub descriptor
 	usb_log_debug("creating serialized descriptor\n");
@@ -107,4 +123,6 @@
 
 	/* this was one fix of some bug, should not be needed anymore
+	 * these lines allow to reset hub once more, it can be used as
+	 * brute-force initialization for non-removable devices
 	int opResult = usb_request_set_configuration(&result->endpoints.control, 1);
 	if(opResult!=EOK){
@@ -141,4 +159,6 @@
 		hub_info->attached_devs[i].address=0;
 	}
+	//handle non-removable devices
+	usb_hub_trigger_connecting_non_removable_devices(hub_info, descriptor);
 	usb_log_debug2("freeing data\n");
 	free(serialized_descriptor);
@@ -152,6 +172,6 @@
  * Check whether there is at least one configuration and sets the first one.
  * This function should be run prior to running any hub-specific action.
- * @param hub_info
- * @return
+ * @param hub_info hub representation
+ * @return error code
  */
 static int usb_hub_set_configuration(usb_hub_info_t * hub_info){
@@ -218,5 +238,5 @@
 	}
 	//get port count and create attached_devs
-	opResult = usb_hub_get_hub_specific_info(hub_info);
+	opResult = usb_hub_process_hub_specific_info(hub_info);
 	if(opResult!=EOK){
 		usb_log_error("could not set hub configuration, errno %d\n",opResult);
@@ -256,7 +276,63 @@
 //*********************************************
 //
-//  hub driver code, main loop
+//  hub driver code, main loop and port handling
 //
 //*********************************************
+
+/**
+ * triggers actions to connect non0removable devices
+ *
+ * This will trigger operations leading to activated non-removable device.
+ * Control pipe of the hub must be open fo communication.
+ * @param hub hub representation
+ * @param descriptor usb hub descriptor
+ * @return error code
+ */
+static int usb_hub_trigger_connecting_non_removable_devices(usb_hub_info_t * hub,
+		usb_hub_descriptor_t * descriptor)
+{
+	usb_log_info("attaching non-removable devices(if any)\n");
+	usb_device_request_setup_packet_t request;
+	int opResult;
+	size_t rcvd_size;
+	usb_port_status_t status;
+	uint8_t * non_removable_dev_bitmap = descriptor->devices_removable;
+	int port;
+	for(port=1;port<=descriptor->ports_count;++port){
+		bool is_non_removable =
+				((non_removable_dev_bitmap[port/8]) >> (port%8)) %2;
+		if(is_non_removable){
+			usb_log_debug("non-removable device on port %d\n",port);
+			usb_hub_set_port_status_request(&request, port);
+			opResult = usb_pipe_control_read(
+					hub->control_pipe,
+					&request, sizeof(usb_device_request_setup_packet_t),
+					&status, 4, &rcvd_size
+					);
+			if (opResult != EOK) {
+				usb_log_error("could not get port status of port %d errno:%d\n",
+						port, opResult);
+				return opResult;
+			}
+			//set the status change bit, so it will be noticed in driver loop
+			if(usb_port_dev_connected(&status)){
+				usb_hub_set_enable_port_feature_request(&request, port,
+						USB_HUB_FEATURE_C_PORT_CONNECTION);
+				opResult = usb_pipe_control_read(
+						hub->control_pipe,
+						&request, sizeof(usb_device_request_setup_packet_t),
+						&status, 4, &rcvd_size
+						);
+				if (opResult != EOK) {
+					usb_log_warning(
+							"could not set port change on port %d errno:%d\n",
+							port, opResult);
+				}
+			}
+		}
+	}
+	return EOK;
+}
+
 
 /**
@@ -280,7 +356,7 @@
 /**
  * Reset the port with new device and reserve the default address.
- * @param hc
- * @param port
- * @param target
+ * @param hub hub representation
+ * @param port port number, starting from 1
+ * @param speed transfer speed of attached device, one of low, full or high
  */
 static void usb_hub_init_add_device(usb_hub_info_t * hub, uint16_t port,
@@ -315,5 +391,4 @@
 	if (opResult != EOK) {
 		usb_log_error("something went wrong when reseting a port %d\n",opResult);
-		//usb_hub_release_default_address(hc);
 		usb_hub_release_default_address(hub);
 	}
@@ -323,7 +398,9 @@
 /**
  * Finalize adding new device after port reset
- * @param hc
- * @param port
- * @param target
+ *
+ * Set device`s address and start it`s driver.
+ * @param hub hub representation
+ * @param port port number, starting from 1
+ * @param speed transfer speed of attached device, one of low, full or high
  */
 static void usb_hub_finalize_add_device( usb_hub_info_t * hub,
@@ -375,5 +452,4 @@
 	}
 
-
 	//opResult = usb_hub_release_default_address(hc);
 	opResult = usb_hub_release_default_address(hub);
@@ -410,8 +486,11 @@
 
 /**
- * Unregister device address in hc
- * @param hc
- * @param port
- * @param target
+ * routine called when a device on port has been removed
+ *
+ * If the device on port had default address, it releases default address.
+ * Otherwise does not do anything, because DDF does not allow to remove device
+ * from it`s device tree.
+ * @param hub hub representation
+ * @param port port number, starting from 1
  */
 static void usb_hub_removed_device(
@@ -452,6 +531,6 @@
  * Turn off the power on the port.
  *
- * @param hub
- * @param port
+ * @param hub hub representation
+ * @param port port number, starting from 1
  */
 static void usb_hub_over_current( usb_hub_info_t * hub,
@@ -468,7 +547,8 @@
 /**
  * Process interrupts on given hub port
- * @param hc
- * @param port
- * @param target
+ *
+ * Accepts connection, over current and port reset change.
+ * @param hub hub representation
+ * @param port port number, starting from 1
  */
 static void usb_hub_process_interrupt(usb_hub_info_t * hub, 
@@ -541,8 +621,9 @@
 
 /**
- * Check changes on particular hub
- * @param hub_info_param pointer to usb_hub_info_t structure
- * @return error code if there is problem when initializing communication with
- * hub, EOK otherwise
+ * check changes on hub
+ *
+ * Handles changes on each port with a status change.
+ * @param hub_info hub representation
+ * @return error code
  */
 int usb_hub_check_hub_changes(usb_hub_info_t * hub_info){
Index: uspace/lib/c/arch/abs32le/_link.ld.in
===================================================================
--- uspace/lib/c/arch/abs32le/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/abs32le/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -11,6 +11,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/lib/c/arch/amd64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/amd64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/amd64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -16,6 +16,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/lib/c/arch/arm32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/arm32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/arm32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -15,6 +15,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/lib/c/arch/ia32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ia32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/ia32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -16,6 +16,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/lib/c/arch/ia64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ia64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/ia64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -15,6 +15,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
@@ -23,5 +23,5 @@
 	.got : {
 		_gp = .;
-		*(.got*);
+		*(.got .got.*);
 	} :data
 	
Index: uspace/lib/c/arch/mips32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/mips32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/mips32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -15,6 +15,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/lib/c/arch/ppc32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ppc32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/ppc32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -15,6 +15,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/lib/c/arch/sparc64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/sparc64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/arch/sparc64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -15,6 +15,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/lib/c/generic/net/packet.c
===================================================================
--- uspace/lib/c/generic/net/packet.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/generic/net/packet.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -190,5 +190,5 @@
 		}
 	}
-	gpm_destroy(&pm_globals.packet_map);
+	gpm_destroy(&pm_globals.packet_map, free);
 	/* leave locked */
 }
Index: uspace/lib/c/generic/net/socket_client.c
===================================================================
--- uspace/lib/c/generic/net/socket_client.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/generic/net/socket_client.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -749,5 +749,5 @@
 	dyn_fifo_destroy(&socket->received);
 	dyn_fifo_destroy(&socket->accepted);
-	sockets_exclude(socket_get_sockets(), socket->socket_id);
+	sockets_exclude(socket_get_sockets(), socket->socket_id, free);
 }
 
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -756,8 +756,9 @@
 {
 	struct stat stat;
-	int rc;
-
-	rc = fstat(fildes, &stat);
-
+	
+	int rc = fstat(fildes, &stat);
+	if (rc != 0)
+		return rc;
+	
 	if (!stat.device)
 		return -1;
Index: uspace/lib/c/include/adt/generic_char_map.h
===================================================================
--- uspace/lib/c/include/adt/generic_char_map.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/include/adt/generic_char_map.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -47,4 +47,8 @@
 #define GENERIC_CHAR_MAP_MAGIC_VALUE	0x12345622
 
+/** Generic destructor function pointer. */
+#define DTOR_T(identifier) \
+	void (*identifier)(const void *)
+
 /** Character string to generic type map declaration.
  *  @param[in] name	Name of the map.
@@ -64,6 +68,6 @@
 	int name##_add(name##_t *, const uint8_t *, const size_t, type *); \
 	int name##_count(name##_t *); \
-	void name##_destroy(name##_t *); \
-	void name##_exclude(name##_t *, const uint8_t *, const size_t); \
+	void name##_destroy(name##_t *, DTOR_T()); \
+	void name##_exclude(name##_t *, const uint8_t *, const size_t, DTOR_T()); \
 	type *name##_find(name##_t *, const uint8_t *, const size_t); \
 	int name##_initialize(name##_t *); \
@@ -84,5 +88,4 @@
 	     type *value) \
 	{ \
-		int rc; \
 		int index; \
 		if (!name##_is_valid(map)) \
@@ -91,10 +94,5 @@
 		if (index < 0) \
 			return index; \
-		rc = char_map_add(&map->names, name, length, index); \
-		if (rc != EOK) { \
-			name##_items_exclude_index(&map->values, index); \
-			return rc; \
-		} \
-		return EOK; \
+		return char_map_add(&map->names, name, length, index); \
 	} \
 	\
@@ -105,14 +103,14 @@
 	} \
 	\
-	void name##_destroy(name##_t *map) \
+	void name##_destroy(name##_t *map, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(map)) { \
 			char_map_destroy(&map->names); \
-			name##_items_destroy(&map->values); \
+			name##_items_destroy(&map->values, dtor); \
 		} \
 	} \
 	\
 	void name##_exclude(name##_t *map, const uint8_t *name, \
-	    const size_t length) \
+	    const size_t length, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -121,5 +119,5 @@
 			if (index != CHAR_MAP_NULL) \
 				name##_items_exclude_index(&map->values, \
-				     index); \
+				     index, dtor); \
 		} \
 	} \
Index: uspace/lib/c/include/adt/generic_field.h
===================================================================
--- uspace/lib/c/include/adt/generic_field.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/include/adt/generic_field.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -46,4 +46,8 @@
 #define GENERIC_FIELD_MAGIC_VALUE		0x55667788
 
+/** Generic destructor function pointer. */
+#define DTOR_T(identifier) \
+	void (*identifier)(const void *)
+
 /** Generic type field declaration.
  *
@@ -63,6 +67,6 @@
 	int name##_add(name##_t *, type *); \
 	int name##_count(name##_t *); \
-	void name##_destroy(name##_t *); \
-	void name##_exclude_index(name##_t *, int); \
+	void name##_destroy(name##_t *, DTOR_T()); \
+	void name##_exclude_index(name##_t *, int, DTOR_T()); \
 	type **name##_get_field(name##_t *); \
 	type *name##_get_index(name##_t *, int); \
@@ -103,12 +107,14 @@
 	} \
 	\
-	void name##_destroy(name##_t *field) \
+	void name##_destroy(name##_t *field, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(field)) { \
 			int index; \
 			field->magic = 0; \
-			for (index = 0; index < field->next; index++) { \
-				if (field->items[index]) \
-					free(field->items[index]); \
+			if (dtor) { \
+				for (index = 0; index < field->next; index++) { \
+					if (field->items[index]) \
+						dtor(field->items[index]); \
+				} \
 			} \
 			free(field->items); \
@@ -116,9 +122,10 @@
 	} \
 	 \
-	void name##_exclude_index(name##_t *field, int index) \
+	void name##_exclude_index(name##_t *field, int index, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(field) && (index >= 0) && \
 		    (index < field->next) && (field->items[index])) { \
-			free(field->items[index]); \
+			if (dtor) \
+				dtor(field->items[index]); \
 			field->items[index] = NULL; \
 		} \
Index: uspace/lib/c/include/adt/int_map.h
===================================================================
--- uspace/lib/c/include/adt/int_map.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/include/adt/int_map.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -49,4 +49,8 @@
 #define INT_MAP_ITEM_MAGIC_VALUE	0x55667788
 
+/** Generic destructor function pointer. */
+#define DTOR_T(identifier) \
+	void (*identifier)(const void *)
+
 /** Integer to generic type map declaration.
  *
@@ -72,9 +76,9 @@
 	\
 	int name##_add(name##_t *, int, type *); \
-	void name##_clear(name##_t *); \
+	void name##_clear(name##_t *, DTOR_T()); \
 	int name##_count(name##_t *); \
-	void name##_destroy(name##_t *); \
-	void name##_exclude(name##_t *, int); \
-	void name##_exclude_index(name##_t *, int); \
+	void name##_destroy(name##_t *, DTOR_T()); \
+	void name##_exclude(name##_t *, int, DTOR_T()); \
+	void name##_exclude_index(name##_t *, int, DTOR_T()); \
 	type *name##_find(name##_t *, int); \
 	int name##_update(name##_t *, int, int); \
@@ -82,5 +86,5 @@
 	int name##_initialize(name##_t *); \
 	int name##_is_valid(name##_t *); \
-	void name##_item_destroy(name##_item_t *); \
+	void name##_item_destroy(name##_item_t *, DTOR_T()); \
 	int name##_item_is_valid(name##_item_t *);
 
@@ -115,5 +119,5 @@
 	} \
 	\
-	void name##_clear(name##_t *map) \
+	void name##_clear(name##_t *map, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -122,5 +126,5 @@
 				if (name##_item_is_valid(&map->items[index])) { \
 					name##_item_destroy( \
-					    &map->items[index]); \
+					    &map->items[index], dtor); \
 				} \
 			} \
@@ -135,5 +139,5 @@
 	} \
 	\
-	void name##_destroy(name##_t *map) \
+	void name##_destroy(name##_t *map, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -143,5 +147,5 @@
 				if (name##_item_is_valid(&map->items[index])) { \
 					name##_item_destroy( \
-					    &map->items[index]); \
+					    &map->items[index], dtor); \
 				} \
 			} \
@@ -150,5 +154,5 @@
 	} \
 	\
-	void name##_exclude(name##_t *map, int key) \
+	void name##_exclude(name##_t *map, int key, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -158,16 +162,16 @@
 				    (map->items[index].key == key)) { \
 					name##_item_destroy( \
-					    &map->items[index]); \
-				} \
-			} \
-		} \
-	} \
-	\
-	void name##_exclude_index(name##_t *map, int index) \
+					    &map->items[index], dtor); \
+				} \
+			} \
+		} \
+	} \
+	\
+	void name##_exclude_index(name##_t *map, int index, DTOR_T(dtor)) \
 	{ \
 		if (name##_is_valid(map) && (index >= 0) && \
 		    (index < map->next) && \
 		    name##_item_is_valid(&map->items[index])) { \
-			name##_item_destroy(&map->items[index]); \
+			name##_item_destroy(&map->items[index], dtor); \
 		} \
 	} \
@@ -236,10 +240,11 @@
 	} \
 	\
-	void name##_item_destroy(name##_item_t *item) \
+	void name##_item_destroy(name##_item_t *item, DTOR_T(dtor)) \
 	{ \
 		if (name##_item_is_valid(item)) { \
 			item->magic = 0; \
 			if (item->value) { \
-				free(item->value); \
+				if (dtor) \
+					dtor(item->value); \
 				item->value = NULL; \
 			} \
Index: uspace/lib/c/include/ipc/services.h
===================================================================
--- uspace/lib/c/include/ipc/services.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/c/include/ipc/services.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -47,8 +47,5 @@
 	SERVICE_DEVMAP,
 	SERVICE_DEVMAN,
-	SERVICE_FHC,
-	SERVICE_OBIO,
-	SERVICE_APIC,
-	SERVICE_I8259,
+	SERVICE_IRC,
 	SERVICE_CLIPBOARD,
 	SERVICE_NETWORKING,
Index: uspace/lib/fs/libfs.c
===================================================================
--- uspace/lib/fs/libfs.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/fs/libfs.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -391,4 +391,6 @@
 						if (lflag & L_CREATE)
 							(void) ops->destroy(fn);
+						else
+							(void) ops->node_put(fn);
 						async_answer_0(rid, rc);
 					} else {
@@ -473,4 +475,6 @@
 					if (lflag & L_CREATE)
 						(void) ops->destroy(fn);
+					else
+						(void) ops->node_put(fn);
 					async_answer_0(rid, rc);
 				} else {
Index: uspace/lib/net/tl/socket_core.c
===================================================================
--- uspace/lib/net/tl/socket_core.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/net/tl/socket_core.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -107,5 +107,5 @@
 		socket_release(socket);
 
-	socket_cores_exclude(local_sockets, socket->socket_id);
+	socket_cores_exclude(local_sockets, socket->socket_id, free);
 }
 
@@ -230,5 +230,5 @@
 
 fail:
-	socket_port_map_destroy(&socket_port->map);
+	socket_port_map_destroy(&socket_port->map, free);
 	free(socket_port);
 	return rc;
@@ -649,12 +649,12 @@
 			if (socket_port->count <= 0) {
 				// destroy the map
-				socket_port_map_destroy(&socket_port->map);
+				socket_port_map_destroy(&socket_port->map, free);
 				// release the port
 				socket_ports_exclude(global_sockets,
-				    socket->port);
+				    socket->port, free);
 			} else {
 				// remove
 				socket_port_map_exclude(&socket_port->map,
-				    socket->key, socket->key_length);
+				    socket->key, socket->key_length, free);
 			}
 		}
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/lib/net/tl/tl_common.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -182,5 +182,5 @@
 			else
 				packet_dimensions_exclude(packet_dimensions,
-				    DEVICE_INVALID_ID);
+				    DEVICE_INVALID_ID, free);
 		}
 	}
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/devman/devman.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -274,9 +274,10 @@
 	}
 	
-	if (read(fd, buf, len) <= 0) {
+	ssize_t read_bytes = safe_read(fd, buf, len);
+	if (read_bytes <= 0) {
 		printf(NAME ": unable to read file '%s'.\n", conf_path);
 		goto cleanup;
 	}
-	buf[len] = 0;
+	buf[read_bytes] = 0;
 	
 	suc = parse_match_ids(buf, ids);
@@ -1131,4 +1132,11 @@
 fun_node_t *find_fun_node_by_path(dev_tree_t *tree, char *path)
 {
+	assert(path != NULL);
+
+	bool is_absolute = path[0] == '/';
+	if (!is_absolute) {
+		return NULL;
+	}
+
 	fibril_rwlock_read_lock(&tree->rwlock);
 	
@@ -1140,5 +1148,5 @@
 	char *rel_path = path;
 	char *next_path_elem = NULL;
-	bool cont = (rel_path[0] == '/');
+	bool cont = true;
 	
 	while (cont && fun != NULL) {
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/devman/main.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -477,5 +477,11 @@
 		dev = fun->dev;
 
-	if (fun == NULL && dev == NULL) {
+	/*
+	 * For a valid function to connect to we need a device. The root
+	 * function, for example, has no device and cannot be connected to.
+	 * This means @c dev needs to be valid regardless whether we are
+	 * connecting to a device or to a function.
+	 */
+	if (dev == NULL) {
 		printf(NAME ": devman_forward error - no device or function with "
 		    "handle %" PRIun " was found.\n", handle);
Index: uspace/srv/devman/util.c
===================================================================
--- uspace/srv/devman/util.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/devman/util.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -111,4 +111,31 @@
 }
 
+ssize_t safe_read(int fd, void *buffer, size_t size)
+{
+	if (size == 0) {
+		return 0;
+	}
+
+	uint8_t *buf_ptr = (uint8_t *) buffer;
+
+	size_t total_read = 0;
+	while (total_read < size) {
+		ssize_t bytes_read = read(fd, buf_ptr, size - total_read);
+		if (bytes_read < 0) {
+			/* Error. */
+			return bytes_read;
+		} else if (bytes_read == 0) {
+			/* Possibly end of file. */
+			break;
+		} else {
+			/* Read at least something. */
+			buf_ptr += bytes_read;
+			total_read += bytes_read;
+		}
+	}
+
+	return (ssize_t) total_read;
+}
+
 /** @}
  */
Index: uspace/srv/devman/util.h
===================================================================
--- uspace/srv/devman/util.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/devman/util.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -47,4 +47,6 @@
 extern void replace_char(char *, char, char);
 
+extern ssize_t safe_read(int, void *, size_t);
+
 #endif
 
Index: uspace/srv/hid/kbd/Makefile
===================================================================
--- uspace/srv/hid/kbd/Makefile	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hid/kbd/Makefile	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -78,5 +78,5 @@
 		SOURCES += \
 			port/pl050.c \
-			ctl/pl050.c
+			ctl/pc.c
 	endif
 endif
Index: pace/srv/hid/kbd/ctl/pl050.c
===================================================================
--- uspace/srv/hid/kbd/ctl/pl050.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ 	(revision )
@@ -1,267 +1,0 @@
-/*
- * Copyright (c) 2009 Vineeth Pillai
- * 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_ctl
- * @ingroup kbd
- * @{
- */
-/**
- * @file
- * @brief PL050 keyboard controller driver.
- */
-
-#include <kbd.h>
-#include <io/console.h>
-#include <io/keycode.h>
-#include <kbd_ctl.h>
-#include <gsp.h>
-#include <stdio.h>
-
-#define PL050_CAPS_SCAN_CODE 0x58
-#define PL050_NUM_SCAN_CODE 0x77
-#define PL050_SCROLL_SCAN_CODE 0x7E
-
-static bool is_lock_key(int);
-enum dec_state {
-	ds_s,
-	ds_e
-};
-
-static enum dec_state ds;
-
-static int scanmap_simple[] = {
-
-	[0x0e] = KC_BACKTICK,
-
-	[0x16] = KC_1,
-	[0x1e] = KC_2,
-	[0x26] = KC_3,
-	[0x25] = KC_4,
-	[0x2e] = KC_5,
-	[0x36] = KC_6,
-	[0x3d] = KC_7,
-	[0x3e] = KC_8,
-	[0x46] = KC_9,
-	[0x45] = KC_0,
-
-	[0x4e] = KC_MINUS,
-	[0x55] = KC_EQUALS,
-	[0x66] = KC_BACKSPACE,
-
-	[0x0d] = KC_TAB,
-
-	[0x15] = KC_Q,
-	[0x1d] = KC_W,
-	[0x24] = KC_E,
-	[0x2d] = KC_R,
-	[0x2c] = KC_T,
-	[0x35] = KC_Y,
-	[0x3c] = KC_U,
-	[0x43] = KC_I,
-	[0x44] = KC_O,
-	[0x4d] = KC_P,
-
-	[0x54] = KC_LBRACKET,
-	[0x5b] = KC_RBRACKET,
-
-	[0x58] = KC_CAPS_LOCK,
-
-	[0x1c] = KC_A,
-	[0x1b] = KC_S,
-	[0x23] = KC_D,
-	[0x2b] = KC_F,
-	[0x34] = KC_G,
-	[0x33] = KC_H,
-	[0x3b] = KC_J,
-	[0x42] = KC_K,
-	[0x4b] = KC_L,
-
-	[0x4c] = KC_SEMICOLON,
-	[0x52] = KC_QUOTE,
-	[0x5d] = KC_BACKSLASH,
-
-	[0x12] = KC_LSHIFT,
-
-	[0x1a] = KC_Z,
-	[0x22] = KC_X,
-	[0x21] = KC_C,
-	[0x2a] = KC_V,
-	[0x32] = KC_B,
-	[0x31] = KC_N,
-	[0x3a] = KC_M,
-
-	[0x41] = KC_COMMA,
-	[0x49] = KC_PERIOD,
-	[0x4a] = KC_SLASH,
-
-	[0x59] = KC_RSHIFT,
-
-	[0x14] = KC_LCTRL,
-	[0x11] = KC_LALT,
-	[0x29] = KC_SPACE,
-
-	[0x76] = KC_ESCAPE,
-
-	[0x05] = KC_F1,
-	[0x06] = KC_F2,
-	[0x04] = KC_F3,
-	[0x0c] = KC_F4,
-	[0x03] = KC_F5,
-	[0x0b] = KC_F6,
-	[0x02] = KC_F7,
-
-	[0x0a] = KC_F8,
-	[0x01] = KC_F9,
-	[0x09] = KC_F10,
-
-	[0x78] = KC_F11,
-	[0x07] = KC_F12,
-
-	[0x60] = KC_SCROLL_LOCK,
-
-	[0x5a] = KC_ENTER,
-
-	[0x77] = KC_NUM_LOCK,
-	[0x7c] = KC_NTIMES,
-	[0x7b] = KC_NMINUS,
-	[0x79] = KC_NPLUS,
-	[0x6c] = KC_N7,
-	[0x75] = KC_N8,
-	[0x7d] = KC_N9,
-	[0x6b] = KC_N4,
-	[0x73] = KC_N5,
-	[0x74] = KC_N6,
-	[0x69] = KC_N1,
-	[0x72] = KC_N2,
-	[0x7a] = KC_N3,
-	[0x70] = KC_N0,
-	[0x71] = KC_NPERIOD
-};
-
-static int scanmap_e0[] = {
-	[0x65] = KC_RALT,
-	[0x59] = KC_RSHIFT,
-
-	[0x64] = KC_PRTSCR,
-
-	[0x70] = KC_INSERT,
-	[0x6c] = KC_HOME,
-	[0x7d] = KC_PAGE_UP,
-
-	[0x71] = KC_DELETE,
-	[0x69] = KC_END,
-	[0x7a] = KC_PAGE_DOWN,
-
-	[0x75] = KC_UP,
-	[0x6b] = KC_LEFT,
-	[0x72] = KC_DOWN,
-	[0x74] = KC_RIGHT,
-
-	[0x4a] = KC_NSLASH,
-	[0x5a] = KC_NENTER
-};
-
-int kbd_ctl_init(void)
-{
-	ds = ds_s;
-	return 0;
-}
-
-void kbd_ctl_parse_scancode(int scancode)
-{
-	static int key_release_flag = 0;
-	static int is_locked = 0;
-	console_ev_type_t type;
-	unsigned int key;
-	int *map;
-	size_t map_length;
-
-	if (scancode == 0xe0) {
-		ds = ds_e;
-		return;
-	}
-
-	switch (ds) {
-	case ds_s:
-		map = scanmap_simple;
-		map_length = sizeof(scanmap_simple) / sizeof(int);
-		break;
-	case ds_e:
-		map = scanmap_e0;
-		map_length = sizeof(scanmap_e0) / sizeof(int);
-		break;
-	default:
-		map = NULL;
-		map_length = 0;
-	}
-
-	ds = ds_s;
-	if (scancode == 0xf0) {
-		key_release_flag = 1;
-		return;
-	} else {
-		if (key_release_flag) {
-			type = KEY_RELEASE;
-			key_release_flag = 0;
-			if (is_lock_key(scancode)) {
-				if (!is_locked) {
-					is_locked = 1;
-				} else {
-					is_locked = 0;
-					return;
-				}
-			}
-		} else {
-			if (is_lock_key(scancode) && is_locked)
-				return;
-			type = KEY_PRESS;
-		}
-	}
-
-	if (scancode < 0)
-		return;
-
-	key = map[scancode];
-	if (key != 0)
-		kbd_push_ev(type, key);
-}
-
-static bool is_lock_key(int sc)
-{
-	return ((sc == PL050_CAPS_SCAN_CODE) || (sc == PL050_NUM_SCAN_CODE) ||
-	    (sc == PL050_SCROLL_SCAN_CODE));
-}
-
-void kbd_ctl_set_ind(unsigned mods)
-{
-	(void) mods;
-}
-
-/**
- * @}
- */ 
Index: uspace/srv/hid/kbd/generic/kbd.c
===================================================================
--- uspace/srv/hid/kbd/generic/kbd.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hid/kbd/generic/kbd.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -67,6 +67,6 @@
 static unsigned lock_keys;
 
-int cir_service = 0;
-int cir_phone = -1;
+bool irc_service = false;
+int irc_phone = -1;
 
 #define NUM_LAYOUTS 3
@@ -216,12 +216,11 @@
 	sysarg_t obio;
 	
-	if ((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc))
-		cir_service = SERVICE_FHC;
-	else if ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio))
-		cir_service = SERVICE_OBIO;
-	
-	if (cir_service) {
-		while (cir_phone < 0)
-			cir_phone = service_connect_blocking(cir_service, 0, 0);
+	if (((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc))
+	    || ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio)))
+		irc_service = true;
+	
+	if (irc_service) {
+		while (irc_phone < 0)
+			irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0);
 	}
 	
Index: uspace/srv/hid/kbd/include/kbd.h
===================================================================
--- uspace/srv/hid/kbd/include/kbd.h	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hid/kbd/include/kbd.h	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -38,6 +38,8 @@
 #define KBD_KBD_H_
 
-extern int cir_service;
-extern int cir_phone;
+#include <bool.h>
+
+extern bool irc_service;
+extern int irc_phone;
 
 extern void kbd_push_scancode(int);
Index: uspace/srv/hid/kbd/port/ns16550.c
===================================================================
--- uspace/srv/hid/kbd/port/ns16550.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hid/kbd/port/ns16550.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -120,6 +120,6 @@
 	kbd_push_scancode(scan_code);
 	
-	if (cir_service)
-		async_msg_1(cir_phone, IRC_CLEAR_INTERRUPT,
+	if (irc_service)
+		async_msg_1(irc_phone, IRC_CLEAR_INTERRUPT,
 		    IPC_GET_IMETHOD(*call));
 }
Index: uspace/srv/hid/kbd/port/z8530.c
===================================================================
--- uspace/srv/hid/kbd/port/z8530.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hid/kbd/port/z8530.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -108,6 +108,6 @@
 	kbd_push_scancode(scan_code);
 	
-	if (cir_service)
-		async_msg_1(cir_phone, IRC_CLEAR_INTERRUPT,
+	if (irc_service)
+		async_msg_1(irc_phone, IRC_CLEAR_INTERRUPT,
 		    IPC_GET_IMETHOD(*call));
 }
Index: uspace/srv/hw/bus/cuda_adb/cuda_adb.c
===================================================================
--- uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -367,9 +367,9 @@
 static void cuda_irq_rcv_end(void *buf, size_t *len)
 {
-	uint8_t data, b;
-
+	uint8_t b;
+	
 	b = pio_read_8(&dev->b);
-	data = pio_read_8(&dev->sr);
-
+	pio_read_8(&dev->sr);
+	
 	if ((b & TREQ) == 0) {
 		instance->xstate = cx_receive;
@@ -379,7 +379,7 @@
 		cuda_send_start();
 	}
-
-        memcpy(buf, instance->rcv_buf, instance->bidx);
-        *len = instance->bidx;
+	
+	memcpy(buf, instance->rcv_buf, instance->bidx);
+	*len = instance->bidx;
 	instance->bidx = 0;
 }
Index: uspace/srv/hw/irc/apic/apic.c
===================================================================
--- uspace/srv/hw/irc/apic/apic.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hw/irc/apic/apic.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -54,6 +54,4 @@
 #define NAME  "apic"
 
-static bool apic_found = false;
-
 static int apic_enable_irq(sysarg_t irq)
 {
@@ -81,15 +79,5 @@
 		callid = async_get_call(&call);
 		
-		sysarg_t method = IPC_GET_IMETHOD(call);
-		if (method == IPC_M_PHONE_HUNGUP) {
-			return;
-		}
-
-		if (!apic_found) {
-			async_answer_0(callid, ENOTSUP);
-			break;
-		}
-
-		switch (method) {
+		switch (IPC_GET_IMETHOD(call)) {
 		case IRC_ENABLE_INTERRUPT:
 			async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));
@@ -109,15 +97,17 @@
  *
  */
-static void apic_init(void)
+static bool apic_init(void)
 {
 	sysarg_t apic;
 	
-	apic_found = sysinfo_get_value("apic", &apic) && apic;
-	if (!apic_found) {
-		printf(NAME ": Warning: no APIC found\n");
+	if ((sysinfo_get_value("apic", &apic) != EOK) || (!apic)) {
+		printf(NAME ": No APIC found\n");
+		return false;
 	}
 	
 	async_set_client_connection(apic_connection);
-	service_register(SERVICE_APIC);
+	service_register(SERVICE_IRC);
+	
+	return true;
 }
 
@@ -126,6 +116,7 @@
 	printf(NAME ": HelenOS APIC driver\n");
 	
-	apic_init();
-
+	if (!apic_init())
+		return -1;
+	
 	printf(NAME ": Accepting connections\n");
 	async_manager();
Index: uspace/srv/hw/irc/fhc/fhc.c
===================================================================
--- uspace/srv/hw/irc/fhc/fhc.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hw/irc/fhc/fhc.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -136,5 +136,5 @@
 	
 	async_set_client_connection(fhc_connection);
-	service_register(SERVICE_FHC);
+	service_register(SERVICE_IRC);
 	
 	return true;
Index: uspace/srv/hw/irc/i8259/i8259.c
===================================================================
--- uspace/srv/hw/irc/i8259/i8259.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hw/irc/i8259/i8259.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -149,5 +149,5 @@
 	
 	async_set_client_connection(i8259_connection);
-	service_register(SERVICE_I8259);
+	service_register(SERVICE_IRC);
 	
 	return true;
Index: uspace/srv/hw/irc/obio/obio.c
===================================================================
--- uspace/srv/hw/irc/obio/obio.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hw/irc/obio/obio.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -137,5 +137,5 @@
 	
 	async_set_client_connection(obio_connection);
-	service_register(SERVICE_OBIO);
+	service_register(SERVICE_IRC);
 	
 	return true;
Index: uspace/srv/hw/netif/ne2000/dp8390.c
===================================================================
--- uspace/srv/hw/netif/ne2000/dp8390.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hw/netif/ne2000/dp8390.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -391,4 +391,5 @@
 	
 	if ((size < ETH_MIN_PACK_SIZE) || (size > ETH_MAX_PACK_SIZE_TAGGED)) {
+		fibril_mutex_unlock(&ne2k->sq_mutex);
 		fprintf(stderr, "%s: Frame dropped (invalid size %zu bytes)\n",
 		    NAME, size);
Index: uspace/srv/hw/netif/ne2000/ne2000.c
===================================================================
--- uspace/srv/hw/netif/ne2000/ne2000.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/hw/netif/ne2000/ne2000.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -75,5 +75,5 @@
 #define IRQ_GET_TSR(call)  ((int) IPC_GET_ARG3(call))
 
-static int irc_service = 0;
+static bool irc_service = false;
 static int irc_phone = -1;
 
@@ -383,12 +383,11 @@
 	sysarg_t i8259;
 	
-	if ((sysinfo_get_value("apic", &apic) == EOK) && (apic))
-		irc_service = SERVICE_APIC;
-	else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))
-		irc_service = SERVICE_I8259;
+	if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))
+	    || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)))
+		irc_service = true;
 	
 	if (irc_service) {
 		while (irc_phone < 0)
-			irc_phone = service_connect_blocking(irc_service, 0, 0);
+			irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0);
 	}
 	
Index: uspace/srv/loader/arch/abs32le/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/abs32le/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/abs32le/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -21,6 +21,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/srv/loader/arch/amd64/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/amd64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/amd64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -27,6 +27,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/srv/loader/arch/arm32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/arm32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/arm32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -25,6 +25,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/srv/loader/arch/ia32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/ia32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/ia32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -26,6 +26,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/srv/loader/arch/ia64/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/ia64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/ia64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -21,6 +21,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
@@ -29,5 +29,5 @@
 	.got : {
 		_gp = .;
-		*(.got*);
+		*(.got .got.*);
 	} :data
 	
Index: uspace/srv/loader/arch/mips32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/mips32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/mips32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -25,6 +25,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/srv/loader/arch/ppc32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/ppc32/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/ppc32/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -25,6 +25,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/srv/loader/arch/sparc64/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/sparc64/_link.ld.in	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/arch/sparc64/_link.ld.in	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -20,6 +20,6 @@
 	
 	.text : {
-		*(.text);
-		*(.rodata*);
+		*(.text .text.*);
+		*(.rodata .rodata.*);
 	} :text
 	
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/loader/main.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -407,12 +407,10 @@
 			/* Not reached */
 		default:
-			retval = ENOENT;
+			retval = EINVAL;
 			break;
 		}
-		if (IPC_GET_IMETHOD(call) != IPC_M_PHONE_HUNGUP) {
-			DPRINTF("Responding EINVAL to method %d.\n",
-			    IPC_GET_IMETHOD(call));
-			async_answer_0(callid, EINVAL);
-		}
+		
+		if (IPC_GET_IMETHOD(call) != IPC_M_PHONE_HUNGUP)
+			async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/net/il/arp/arp.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -157,9 +157,9 @@
 			
 			arp_clear_addr(&proto->addresses);
-			arp_addr_destroy(&proto->addresses);
-		}
-	}
-	
-	arp_protos_clear(&device->protos);
+			arp_addr_destroy(&proto->addresses, free);
+		}
+	}
+	
+	arp_protos_clear(&device->protos, free);
 }
 
@@ -184,5 +184,5 @@
 	}
 	
-	arp_cache_clear(&arp_globals.cache);
+	arp_cache_clear(&arp_globals.cache, free);
 	fibril_mutex_unlock(&arp_globals.lock);
 	
@@ -212,5 +212,5 @@
 		arp_clear_trans(trans);
 	
-	arp_addr_exclude(&proto->addresses, address->value, address->length);
+	arp_addr_exclude(&proto->addresses, address->value, address->length, free);
 	
 	fibril_mutex_unlock(&arp_globals.lock);
@@ -345,5 +345,5 @@
 			    header->protocol_length, trans);
 			if (rc != EOK) {
-				/* The generic char map has already freed trans! */
+				free(trans);
 				return rc;
 			}
@@ -556,5 +556,5 @@
 		if (index < 0) {
 			fibril_mutex_unlock(&arp_globals.lock);
-			arp_protos_destroy(&device->protos);
+			arp_protos_destroy(&device->protos, free);
 			free(device);
 			return index;
@@ -569,5 +569,5 @@
 		if (device->phone < 0) {
 			fibril_mutex_unlock(&arp_globals.lock);
-			arp_protos_destroy(&device->protos);
+			arp_protos_destroy(&device->protos, free);
 			free(device);
 			return EREFUSED;
@@ -579,5 +579,5 @@
 		if (rc != EOK) {
 			fibril_mutex_unlock(&arp_globals.lock);
-			arp_protos_destroy(&device->protos);
+			arp_protos_destroy(&device->protos, free);
 			free(device);
 			return rc;
@@ -589,5 +589,5 @@
 		if (rc != EOK) {
 			fibril_mutex_unlock(&arp_globals.lock);
-			arp_protos_destroy(&device->protos);
+			arp_protos_destroy(&device->protos, free);
 			free(device);
 			return rc;
@@ -601,5 +601,5 @@
 			free(device->addr);
 			free(device->addr_data);
-			arp_protos_destroy(&device->protos);
+			arp_protos_destroy(&device->protos, free);
 			free(device);
 			return rc;
@@ -614,5 +614,5 @@
 			free(device->broadcast_addr);
 			free(device->broadcast_data);
-			arp_protos_destroy(&device->protos);
+			arp_protos_destroy(&device->protos, free);
 			free(device);
 			return rc;
@@ -746,5 +746,5 @@
 			arp_clear_trans(trans);
 			arp_addr_exclude(&proto->addresses, target->value,
-			    target->length);
+			    target->length, free);
 			return EAGAIN;
 		}
@@ -794,5 +794,5 @@
 	    trans);
 	if (rc != EOK) {
-		/* The generic char map has already freed trans! */
+		free(trans);
 		return rc;
 	}
@@ -807,5 +807,5 @@
 		arp_clear_trans(trans);
 		arp_addr_exclude(&proto->addresses, target->value,
-		    target->length);
+		    target->length, free);
 		return ENOENT;
 	}
Index: uspace/srv/net/il/ip/ip.c
===================================================================
--- uspace/srv/net/il/ip/ip.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/net/il/ip/ip.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -505,5 +505,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&ip_globals.netifs_lock);
-		ip_routes_destroy(&ip_netif->routes);
+		ip_routes_destroy(&ip_netif->routes, free);
 		free(ip_netif);
 		return rc;
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/net/net/net.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -289,12 +289,15 @@
 	if (rc != EOK)
 		return rc;
+	
 	rc = add_module(NULL, &net_globals.modules, (uint8_t *) NE2000_NAME,
 	    (uint8_t *) NE2000_FILENAME, SERVICE_NE2000, 0, connect_to_service);
 	if (rc != EOK)
 		return rc;
+	
 	rc = add_module(NULL, &net_globals.modules, (uint8_t *) ETHERNET_NAME,
 	    (uint8_t *) ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service);
 	if (rc != EOK)
 		return rc;
+	
 	rc = add_module(NULL, &net_globals.modules, (uint8_t *) NILDUMMY_NAME,
 	    (uint8_t *) NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service);
@@ -552,5 +555,5 @@
 		rc = read_netif_configuration(conf_files[i], netif);
 		if (rc != EOK) {
-			measured_strings_destroy(&netif->configuration);
+			measured_strings_destroy(&netif->configuration, free);
 			free(netif);
 			return rc;
@@ -562,5 +565,5 @@
 		if (!setting) {
 			fprintf(stderr, "%s: Network interface name is missing\n", NAME);
-			measured_strings_destroy(&netif->configuration);
+			measured_strings_destroy(&netif->configuration, free);
 			free(netif);
 			return EINVAL;
@@ -571,5 +574,5 @@
 		int index = netifs_add(&net_globals.netifs, netif->id, netif);
 		if (index < 0) {
-			measured_strings_destroy(&netif->configuration);
+			measured_strings_destroy(&netif->configuration, free);
 			free(netif);
 			return index;
@@ -583,6 +586,6 @@
 		    index);
 		if (rc != EOK) {
-			measured_strings_destroy(&netif->configuration);
-			netifs_exclude_index(&net_globals.netifs, index);
+			measured_strings_destroy(&netif->configuration, free);
+			netifs_exclude_index(&net_globals.netifs, index, free);
 			return rc;
 		}
@@ -590,10 +593,9 @@
 		rc = start_device(netif);
 		if (rc != EOK) {
-			printf("%s: Error starting interface %s (%s)\n", NAME,
+			printf("%s: Ignoring failed interface %s (%s)\n", NAME,
 			    netif->name, str_error(rc));
-			measured_strings_destroy(&netif->configuration);
-			netifs_exclude_index(&net_globals.netifs, index);
-			
-			return rc;
+			measured_strings_destroy(&netif->configuration, free);
+			netifs_exclude_index(&net_globals.netifs, index, free);
+			continue;
 		}
 		
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/net/nil/eth/eth.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -214,5 +214,5 @@
 	if (rc != EOK) {
 		free(eth_globals.broadcast_addr);
-		eth_devices_destroy(&eth_globals.devices);
+		eth_devices_destroy(&eth_globals.devices, free);
 	}
 out:
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -1707,5 +1707,5 @@
 		if (socket->port > 0) {
 			socket_ports_exclude(&tcp_globals.sockets,
-			    socket->port);
+			    socket->port, free);
 			socket->port = 0;
 		}
@@ -2492,5 +2492,5 @@
 	rc = packet_dimensions_initialize(&tcp_globals.dimensions);
 	if (rc != EOK) {
-		socket_ports_destroy(&tcp_globals.sockets);
+		socket_ports_destroy(&tcp_globals.sockets, free);
 		goto out;
 	}
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/net/tl/udp/udp.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -417,5 +417,5 @@
 	rc = packet_dimensions_initialize(&udp_globals.dimensions);
 	if (rc != EOK) {
-		socket_ports_destroy(&udp_globals.sockets);
+		socket_ports_destroy(&udp_globals.sockets, free);
 		fibril_rwlock_write_unlock(&udp_globals.lock);
 		return rc;
@@ -434,5 +434,5 @@
 	    &data);
 	if (rc != EOK) {
-		socket_ports_destroy(&udp_globals.sockets);
+		socket_ports_destroy(&udp_globals.sockets, free);
 		fibril_rwlock_write_unlock(&udp_globals.lock);
 		return rc;
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ uspace/srv/vfs/vfs_ops.c	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -1234,4 +1234,5 @@
 	if (!parentc) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
+		vfs_node_put(old_node);
 		async_answer_0(rid, rc);
 		free(old);
@@ -1251,4 +1252,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
+		vfs_node_put(old_node);
 		async_answer_0(rid, rc);
 		free(old);
@@ -1261,4 +1263,5 @@
 	    (old_node->devmap_handle != new_par_lr.triplet.devmap_handle)) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
+		vfs_node_put(old_node);
 		async_answer_0(rid, EXDEV);	/* different file systems */
 		free(old);
@@ -1279,4 +1282,5 @@
 		if (!new_node) {
 			fibril_rwlock_write_unlock(&namespace_rwlock);
+			vfs_node_put(old_node);
 			async_answer_0(rid, ENOMEM);
 			free(old);
@@ -1290,4 +1294,5 @@
 	default:
 		fibril_rwlock_write_unlock(&namespace_rwlock);
+		vfs_node_put(old_node);
 		async_answer_0(rid, ENOTEMPTY);
 		free(old);
@@ -1300,4 +1305,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
+		vfs_node_put(old_node);
 		if (new_node)
 			vfs_node_put(new_node);
Index: version
===================================================================
--- version	(revision f62468c4b2326b4c8559cabb0e43897c995246bb)
+++ version	(revision 48d4231f406b1fda0a0c462ba0aa84cea1c6e84a)
@@ -37,5 +37,5 @@
 VERSION = 0
 PATCHLEVEL = 4
-SUBLEVEL = 2
+SUBLEVEL = 3
 
 ifdef EXTRAVERSION
@@ -45,3 +45,3 @@
 endif
 
-NAME = Skewer
+NAME = Sashimi
