Index: boot/arch/arm32/Makefile.inc
===================================================================
--- boot/arch/arm32/Makefile.inc	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ boot/arch/arm32/Makefile.inc	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -49,4 +49,5 @@
 SOURCES = \
 	arch/$(BARCH)/src/asm.S \
+	arch/$(BARCH)/src/eabi.S \
 	arch/$(BARCH)/src/main.c \
 	arch/$(BARCH)/src/mm.c \
Index: boot/arch/arm32/src/eabi.S
===================================================================
--- boot/arch/arm32/src/eabi.S	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ boot/arch/arm32/src/eabi.S	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,88 @@
+#
+# Copyright (c) 2012 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.
+#
+
+.text
+
+.global __aeabi_idiv
+.global __aeabi_uidiv
+
+.global __aeabi_idivmod
+.global __aeabi_uidivmod
+
+.global __aeabi_ldivmod
+.global __aeabi_uldivmod
+
+__aeabi_idiv:
+	push {sp, lr}
+	bl __divsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	bx lr
+
+__aeabi_uidiv:
+	push {sp, lr}
+	bl __udivsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	bx lr
+
+__aeabi_idivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __divmodsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r1, r2}
+	bx lr
+
+__aeabi_uidivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __udivmodsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r1, r2}
+	bx lr
+
+__aeabi_ldivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __divmoddi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r2, r3}
+	bx lr
+
+__aeabi_uldivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __udivmoddi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r2, r3}
+	bx lr
Index: boot/genarch/include/division.h
===================================================================
--- boot/genarch/include/division.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ boot/genarch/include/division.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -33,28 +33,20 @@
 #define BOOT_DIVISION_H_
 
-/* 32bit integer division */
 extern int __divsi3(int, int);
-
-/* 64bit integer division */
 extern long long __divdi3(long long, long long);
 
-/* 32bit unsigned integer division */
 extern unsigned int __udivsi3(unsigned int, unsigned int);
-
-/* 64bit unsigned integer division */
 extern unsigned long long __udivdi3(unsigned long long, unsigned long long);
 
-/* 32bit remainder of the signed division */
 extern int __modsi3(int, int);
-
-/* 64bit remainder of the signed division */
 extern long long __moddi3(long long, long long);
 
-/* 32bit remainder of the unsigned division */
 extern unsigned int __umodsi3(unsigned int, unsigned int);
-
-/* 64bit remainder of the unsigned division */
 extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
 
+extern int __divmodsi3(int, int, int *);
+extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
+
+extern long long __divmoddi3(long long, long long, long long *);
 extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
     unsigned long long *);
Index: boot/genarch/src/division.c
===================================================================
--- boot/genarch/src/division.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ boot/genarch/src/division.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -73,5 +73,5 @@
 {
 	unsigned long long result;
-	int steps = sizeof(unsigned long long) * 8; 
+	int steps = sizeof(unsigned long long) * 8;
 	
 	*remainder = 0;
@@ -104,5 +104,5 @@
 
 /* 32bit integer division */
-int __divsi3(int a, int b) 
+int __divsi3(int a, int b)
 {
 	unsigned int rem;
@@ -116,5 +116,5 @@
 
 /* 64bit integer division */
-long long __divdi3(long long a, long long b) 
+long long __divdi3(long long a, long long b)
 {
 	unsigned long long rem;
@@ -155,5 +155,5 @@
 
 /* 64bit remainder of the signed division */
-long long __moddi3(long long a,long  long b)
+long long __moddi3(long long a, long long b)
 {
 	unsigned long long rem;
@@ -183,4 +183,38 @@
 }
 
+int __divmodsi3(int a, int b, int *c)
+{
+	unsigned int rem;
+	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
+unsigned int __udivmodsi3(unsigned int a, unsigned int b,
+    unsigned int *c)
+{
+	return divandmod32(a, b, c);
+}
+
+long long __divmoddi3(long long a, long long b, long long *c)
+{
+	unsigned long long rem;
+	long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
     unsigned long long *c)
Index: boot/generic/src/str.c
===================================================================
--- boot/generic/src/str.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ boot/generic/src/str.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -100,4 +100,11 @@
 #include <str.h>
 #include <errno.h>
+
+/** Check the condition if wchar_t is signed */
+#ifdef WCHAR_IS_UNSIGNED
+	#define WCHAR_SIGNED_CHECK(cond)  (true)
+#else
+	#define WCHAR_SIGNED_CHECK(cond)  (cond)
+#endif
 
 /** Byte mask consisting of lowest @n bits (out of 8) */
@@ -198,5 +205,5 @@
  *         code was invalid.
  */
-int chr_encode(wchar_t ch, char *str, size_t *offset, size_t size)
+int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size)
 {
 	if (*offset >= size)
@@ -325,5 +332,5 @@
 bool ascii_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 127))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
 		return true;
 	
@@ -338,5 +345,5 @@
 bool chr_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 1114111))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
 		return true;
 	
Index: kernel/arch/arm32/Makefile.inc
===================================================================
--- kernel/arch/arm32/Makefile.inc	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ kernel/arch/arm32/Makefile.inc	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -41,4 +41,5 @@
 	arch/$(KARCH)/src/start.S \
 	arch/$(KARCH)/src/asm.S \
+	arch/$(KARCH)/src/eabi.S \
 	arch/$(KARCH)/src/exc_handler.S \
 	arch/$(KARCH)/src/arm32.c \
Index: kernel/arch/arm32/src/eabi.S
===================================================================
--- kernel/arch/arm32/src/eabi.S	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ kernel/arch/arm32/src/eabi.S	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,88 @@
+#
+# Copyright (c) 2012 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.
+#
+
+.text
+
+.global __aeabi_idiv
+.global __aeabi_uidiv
+
+.global __aeabi_idivmod
+.global __aeabi_uidivmod
+
+.global __aeabi_ldivmod
+.global __aeabi_uldivmod
+
+__aeabi_idiv:
+	push {sp, lr}
+	bl __divsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	bx lr
+
+__aeabi_uidiv:
+	push {sp, lr}
+	bl __udivsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	bx lr
+
+__aeabi_idivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __divmodsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r1, r2}
+	bx lr
+
+__aeabi_uidivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __udivmodsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r1, r2}
+	bx lr
+
+__aeabi_ldivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __divmoddi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r2, r3}
+	bx lr
+
+__aeabi_uldivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __udivmoddi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r2, r3}
+	bx lr
Index: kernel/genarch/include/softint/division.h
===================================================================
--- kernel/genarch/include/softint/division.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ kernel/genarch/include/softint/division.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -36,29 +36,22 @@
 #define KERN_DIVISION_H_
 
-/* 32bit integer division */
-int __divsi3(int a, int b);
+extern int __divsi3(int, int);
+extern long long __divdi3(long long, long long);
 
-/* 64bit integer division */
-long long __divdi3(long long a, long long b);
+extern unsigned int __udivsi3(unsigned int, unsigned int);
+extern unsigned long long __udivdi3(unsigned long long, unsigned long long);
 
-/* 32bit unsigned integer division */
-unsigned int __udivsi3(unsigned int a, unsigned int b);
+extern int __modsi3(int, int);
+extern long long __moddi3(long long, long long);
 
-/* 64bit unsigned integer division */
-unsigned long long __udivdi3(unsigned long long a, unsigned long long b);
+extern unsigned int __umodsi3(unsigned int, unsigned int);
+extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
 
-/* 32bit remainder of the signed division */
-int __modsi3(int a, int b);
+extern int __divmodsi3(int, int, int *);
+extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
 
-/* 64bit remainder of the signed division */
-long long __moddi3(long long a, long long b);
-
-/* 32bit remainder of the unsigned division */
-unsigned int __umodsi3(unsigned int a, unsigned int b);
-
-/* 64bit remainder of the unsigned division */
-unsigned long long __umoddi3(unsigned long long a, unsigned long long b);
-
-unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, unsigned long long *c); 
+extern long long __divmoddi3(long long, long long, long long *);
+extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
+    unsigned long long *);
 
 #endif
Index: kernel/genarch/include/softint/multiplication.h
===================================================================
--- kernel/genarch/include/softint/multiplication.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ kernel/genarch/include/softint/multiplication.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -29,14 +29,14 @@
 /** @addtogroup genarch
  * @{
- */ 
+ */
 /**
  * @file
  */
 
-#ifndef __SOFTINT_MULTIPLICATION_H__
-#define __SOFTINT_MULTIPLICATION_H__
+#ifndef KERN_MULTIPLICATION_H_
+#define KERN_MULTIPLICATION_H_
 
 /* 64 bit multiplication */
-long long __muldi3(long long a, long long b);
+extern long long __muldi3(long long, long long);
 
 #endif
@@ -44,4 +44,2 @@
 /** @}
  */
-
-
Index: kernel/genarch/src/softint/division.c
===================================================================
--- kernel/genarch/src/softint/division.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ kernel/genarch/src/softint/division.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup genarch	
+/** @addtogroup genarch
  * @{
  */
@@ -35,7 +35,7 @@
 #include <genarch/softint/division.h>
 
-#define ABSVAL(x) ((x) > 0 ? (x) : -(x))
-#define SGN(x) ((x) >= 0 ? 1 : 0)
-				      
+#define ABSVAL(x)  ((x) > 0 ? (x) : -(x))
+#define SGN(x)     ((x) >= 0 ? 1 : 0)
+
 static unsigned int divandmod32(unsigned int a, unsigned int b,
     unsigned int *remainder)
@@ -56,5 +56,5 @@
 		return 0;
 	}
-
+	
 	for (; steps > 0; steps--) {
 		/* shift one bit to remainder */
@@ -68,8 +68,7 @@
 		a <<= 1;
 	}
-
+	
 	return result;
 }
-
 
 static unsigned long long divandmod64(unsigned long long a,
@@ -77,5 +76,5 @@
 {
 	unsigned long long result;
-	int steps = sizeof(unsigned long long) * 8; 
+	int steps = sizeof(unsigned long long) * 8;
 	
 	*remainder = 0;
@@ -91,5 +90,5 @@
 		return 0;
 	}
-
+	
 	for (; steps > 0; steps--) {
 		/* shift one bit to remainder */
@@ -103,31 +102,29 @@
 		a <<= 1;
 	}
-
+	
 	return result;
 }
 
 /* 32bit integer division */
-int __divsi3(int a, int b) 
-{
-	unsigned int rem;
-	int result;
-	
-	result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
-
+int __divsi3(int a, int b)
+{
+	unsigned int rem;
+	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
+	
 	if (SGN(a) == SGN(b))
 		return result;
+	
 	return -result;
 }
 
 /* 64bit integer division */
-long long __divdi3(long long a, long long b) 
-{
-	unsigned long long rem;
-	long long result;
-	
-	result = (long long) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
-
+long long __divdi3(long long a, long long b)
+{
+	unsigned long long rem;
+	long long result = (long long) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
+	
 	if (SGN(a) == SGN(b))
 		return result;
+	
 	return -result;
 }
@@ -143,5 +140,5 @@
 unsigned long long __udivdi3(unsigned long long a, unsigned long long b)
 {
-	unsigned long long  rem;
+	unsigned long long rem;
 	return divandmod64(a, b, &rem);
 }
@@ -154,7 +151,6 @@
 	
 	/* if divident is negative, remainder must be too */
-	if (!(SGN(a))) {
+	if (!(SGN(a)))
 		return -((int) rem);
-	}
 	
 	return (int) rem;
@@ -162,5 +158,5 @@
 
 /* 64bit remainder of the signed division */
-long long __moddi3(long long a,long  long b)
+long long __moddi3(long long a, long long b)
 {
 	unsigned long long rem;
@@ -168,7 +164,6 @@
 	
 	/* if divident is negative, remainder must be too */
-	if (!(SGN(a))) {
+	if (!(SGN(a)))
 		return -((long long) rem);
-	}
 	
 	return (long long) rem;
@@ -191,4 +186,38 @@
 }
 
+int __divmodsi3(int a, int b, int *c)
+{
+	unsigned int rem;
+	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
+unsigned int __udivmodsi3(unsigned int a, unsigned int b,
+    unsigned int *c)
+{
+	return divandmod32(a, b, c);
+}
+
+long long __divmoddi3(long long a, long long b, long long *c)
+{
+	unsigned long long rem;
+	long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
     unsigned long long *c)
Index: kernel/genarch/src/softint/multiplication.c
===================================================================
--- kernel/genarch/src/softint/multiplication.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ kernel/genarch/src/softint/multiplication.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -29,5 +29,5 @@
 /** @addtogroup genarch
  * @{
- */ 
+ */
 /**
  * @file
@@ -130,5 +130,5 @@
 
 	return result;
-}	
+}
 
 /** @}
Index: kernel/generic/src/lib/str.c
===================================================================
--- kernel/generic/src/lib/str.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ kernel/generic/src/lib/str.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -111,4 +111,11 @@
 #include <debug.h>
 #include <macros.h>
+
+/** Check the condition if wchar_t is signed */
+#ifdef WCHAR_IS_UNSIGNED
+	#define WCHAR_SIGNED_CHECK(cond)  (true)
+#else
+	#define WCHAR_SIGNED_CHECK(cond)  (cond)
+#endif
 
 /** Byte mask consisting of lowest @n bits (out of 8) */
@@ -206,8 +213,8 @@
  *
  * @return EOK if the character was encoded successfully, EOVERFLOW if there
- *	   was not enough space in the output buffer or EINVAL if the character
- *	   code was invalid.
- */
-int chr_encode(wchar_t ch, char *str, size_t *offset, size_t size)
+ *         was not enough space in the output buffer or EINVAL if the character
+ *         code was invalid.
+ */
+int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size)
 {
 	if (*offset >= size)
@@ -427,5 +434,5 @@
 bool ascii_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 127))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
 		return true;
 	
@@ -440,5 +447,5 @@
 bool chr_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 1114111))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
 		return true;
 	
Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ tools/autotool.py	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -49,5 +49,5 @@
 
 PACKAGE_BINUTILS = "usually part of binutils"
-PACKAGE_GCC = "preferably version 4.5.1 or newer"
+PACKAGE_GCC = "preferably version 4.7.0 or newer"
 PACKAGE_CROSS = "use tools/toolchain.sh to build the cross-compiler toolchain"
 
@@ -66,9 +66,22 @@
 
 #define DECLARE_BUILTIN_TYPE(tag, type) \\
-	AUTOTOOL_DECLARE("builtin", "", tag, STRING(type), "", "", sizeof(type));
+	AUTOTOOL_DECLARE("builtin_size", "", tag, STRING(type), "", "", sizeof(type)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "unsigned long long int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned long long int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "unsigned long int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned long int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "unsigned int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "unsigned short int", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned short int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "unsigned char", tag, STRING(type), "unsigned", "", __builtin_types_compatible_p(type, unsigned char)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "signed long long int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed long long int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "signed long int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed long int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "signed int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "signed short int", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed short int)); \\
+	AUTOTOOL_DECLARE("builtin_sign", "signed char", tag, STRING(type), "signed", "", __builtin_types_compatible_p(type, signed char));
 
 #define DECLARE_INTSIZE(tag, type, strc, conc) \\
 	AUTOTOOL_DECLARE("intsize", "unsigned", tag, #type, strc, conc, sizeof(unsigned type)); \\
 	AUTOTOOL_DECLARE("intsize", "signed", tag, #type, strc, conc, sizeof(signed type));
+
+#define DECLARE_FLOATSIZE(tag, type) \\
+	AUTOTOOL_DECLARE("floatsize", "", tag, #type, "", "", sizeof(type));
 
 int main(int argc, char *argv[])
@@ -262,5 +275,5 @@
 	return int(value, base)
 
-def probe_compiler(common, sizes):
+def probe_compiler(common, intsizes, floatsizes):
 	"Generate, compile and parse probing source"
 	
@@ -270,6 +283,9 @@
 	outf.write(PROBE_HEAD)
 	
-	for typedef in sizes:
+	for typedef in intsizes:
 		outf.write("\tDECLARE_INTSIZE(\"%s\", %s, %s, %s);\n" % (typedef['tag'], typedef['type'], typedef['strc'], typedef['conc']))
+	
+	for typedef in floatsizes:
+		outf.write("\nDECLARE_FLOATSIZE(\"%s\", %s);\n" % (typedef['tag'], typedef['type']))
 	
 	outf.write(PROBE_TAIL)
@@ -315,5 +331,8 @@
 	signed_concs = {}
 	
-	builtins = {}
+	float_tags = {}
+	
+	builtin_sizes = {}
+	builtin_signs = {}
 	
 	for j in range(len(lines)):
@@ -352,5 +371,5 @@
 						print_error(["Unexpected keyword \"%s\" in \"%s\" on line %s." % (subcategory, PROBE_OUTPUT, j), COMPILER_FAIL])
 				
-				if (category == "builtin"):
+				if (category == "floatsize"):
 					try:
 						value_int = decode_value(value)
@@ -358,10 +377,30 @@
 						print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
 					
-					builtins[tag] = {'name': name, 'value': value_int}
-	
-	return {'unsigned_sizes': unsigned_sizes, 'signed_sizes': signed_sizes, 'unsigned_tags': unsigned_tags, 'signed_tags': signed_tags, 'unsigned_strcs': unsigned_strcs, 'signed_strcs': signed_strcs, 'unsigned_concs': unsigned_concs, 'signed_concs': signed_concs, 'builtins': builtins}
-
-def detect_uints(probe, bytes, tags):
-	"Detect correct types for fixed-size integer types"
+					float_tags[tag] = value_int
+				
+				if (category == "builtin_size"):
+					try:
+						value_int = decode_value(value)
+					except:
+						print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
+					
+					builtin_sizes[tag] = {'name': name, 'value': value_int}
+				
+				if (category == "builtin_sign"):
+					try:
+						value_int = decode_value(value)
+					except:
+						print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
+					
+					if (value_int == 1):
+						if (not tag in builtin_signs):
+							builtin_signs[tag] = strc;
+						elif (builtin_signs[tag] != strc):
+							print_error(["Inconsistent builtin type detection in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
+	
+	return {'unsigned_sizes': unsigned_sizes, 'signed_sizes': signed_sizes, 'unsigned_tags': unsigned_tags, 'signed_tags': signed_tags, 'unsigned_strcs': unsigned_strcs, 'signed_strcs': signed_strcs, 'unsigned_concs': unsigned_concs, 'signed_concs': signed_concs, 'float_tags': float_tags, 'builtin_sizes': builtin_sizes, 'builtin_signs': builtin_signs}
+
+def detect_sizes(probe, bytes, inttags, floattags):
+	"Detect correct types for fixed-size types"
 	
 	macros = []
@@ -370,25 +409,25 @@
 	for b in bytes:
 		if (not b in probe['unsigned_sizes']):
-			print_error(['Unable to find appropriate unsigned integer type for %u bytes' % b,
+			print_error(['Unable to find appropriate unsigned integer type for %u bytes.' % b,
 			             COMPILER_FAIL])
 		
 		if (not b in probe['signed_sizes']):
-			print_error(['Unable to find appropriate signed integer type for %u bytes' % b,
+			print_error(['Unable to find appropriate signed integer type for %u bytes.' % b,
 			             COMPILER_FAIL])
 		
 		if (not b in probe['unsigned_strcs']):
-			print_error(['Unable to find appropriate unsigned printf formatter for %u bytes' % b,
+			print_error(['Unable to find appropriate unsigned printf formatter for %u bytes.' % b,
 			             COMPILER_FAIL])
 		
 		if (not b in probe['signed_strcs']):
-			print_error(['Unable to find appropriate signed printf formatter for %u bytes' % b,
+			print_error(['Unable to find appropriate signed printf formatter for %u bytes.' % b,
 			             COMPILER_FAIL])
 		
 		if (not b in probe['unsigned_concs']):
-			print_error(['Unable to find appropriate unsigned literal macro for %u bytes' % b,
+			print_error(['Unable to find appropriate unsigned literal macro for %u bytes.' % b,
 			             COMPILER_FAIL])
 		
 		if (not b in probe['signed_concs']):
-			print_error(['Unable to find appropriate signed literal macro for %u bytes' % b,
+			print_error(['Unable to find appropriate signed literal macro for %u bytes.' % b,
 			             COMPILER_FAIL])
 		
@@ -417,8 +456,8 @@
 			macros.append({'oldmacro': "c ## %s" % name, 'newmacro': "INT%u_C(c)" % (b * 8)})
 	
-	for tag in tags:
+	for tag in inttags:
 		newmacro = "U%s" % tag
 		if (not tag in probe['unsigned_tags']):
-			print_error(['Unable to find appropriate size macro for %s' % newmacro,
+			print_error(['Unable to find appropriate size macro for %s.' % newmacro,
 			             COMPILER_FAIL])
 		
@@ -426,7 +465,8 @@
 		macros.append({'oldmacro': "%s_MIN" % oldmacro, 'newmacro': "%s_MIN" % newmacro})
 		macros.append({'oldmacro': "%s_MAX" % oldmacro, 'newmacro': "%s_MAX" % newmacro})
+		macros.append({'oldmacro': "1", 'newmacro': 'U%s_SIZE_%s' % (tag, probe['unsigned_tags'][tag] * 8)})
 		
 		newmacro = tag
-		if (not tag in probe['unsigned_tags']):
+		if (not tag in probe['signed_tags']):
 			print_error(['Unable to find appropriate size macro for %s' % newmacro,
 			             COMPILER_FAIL])
@@ -435,8 +475,24 @@
 		macros.append({'oldmacro': "%s_MIN" % oldmacro, 'newmacro': "%s_MIN" % newmacro})
 		macros.append({'oldmacro': "%s_MAX" % oldmacro, 'newmacro': "%s_MAX" % newmacro})
+		macros.append({'oldmacro': "1", 'newmacro': '%s_SIZE_%s' % (tag, probe['signed_tags'][tag] * 8)})
+	
+	for tag in floattags:
+		if (not tag in probe['float_tags']):
+			print_error(['Unable to find appropriate size macro for %s' % tag,
+			             COMPILER_FAIL])
+		
+		macros.append({'oldmacro': "1", 'newmacro': '%s_SIZE_%s' % (tag, probe['float_tags'][tag] * 8)})
+	
+	if (not 'size' in probe['builtin_signs']):
+		print_error(['Unable to determine whether size_t is signed or unsigned.',
+		             COMPILER_FAIL])
+	
+	if (probe['builtin_signs']['size'] != 'unsigned'):
+		print_error(['The type size_t is not unsigned.',
+		             COMPILER_FAIL])
 	
 	fnd = True
 	
-	if (not 'wchar' in probe['builtins']):
+	if (not 'wchar' in probe['builtin_sizes']):
 		print_warning(['The compiler does not provide the macro __WCHAR_TYPE__',
 		               'for defining the compiler-native type wchar_t. We are',
@@ -445,5 +501,5 @@
 		fnd = False
 	
-	if (probe['builtins']['wchar']['value'] != 4):
+	if (probe['builtin_sizes']['wchar']['value'] != 4):
 		print_warning(['The compiler provided macro __WCHAR_TYPE__ for defining',
 		               'the compiler-native type wchar_t is not compliant with',
@@ -458,7 +514,16 @@
 		macros.append({'oldmacro': "__WCHAR_TYPE__", 'newmacro': "wchar_t"})
 	
+	if (not 'wchar' in probe['builtin_signs']):
+		print_error(['Unable to determine whether wchar_t is signed or unsigned.',
+		             COMPILER_FAIL])
+	
+	if (probe['builtin_signs']['wchar'] == 'unsigned'):
+		macros.append({'oldmacro': "1", 'newmacro': 'WCHAR_IS_UNSIGNED'})
+	if (probe['builtin_signs']['wchar'] == 'signed'):
+		macros.append({'oldmacro': "1", 'newmacro': 'WCHAR_IS_SIGNED'})
+	
 	fnd = True
 	
-	if (not 'wint' in probe['builtins']):
+	if (not 'wint' in probe['builtin_sizes']):
 		print_warning(['The compiler does not provide the macro __WINT_TYPE__',
 		               'for defining the compiler-native type wint_t. We are',
@@ -467,5 +532,5 @@
 		fnd = False
 	
-	if (probe['builtins']['wint']['value'] != 4):
+	if (probe['builtin_sizes']['wint']['value'] != 4):
 		print_warning(['The compiler provided macro __WINT_TYPE__ for defining',
 		               'the compiler-native type wint_t is not compliant with',
@@ -479,4 +544,13 @@
 	else:
 		macros.append({'oldmacro': "__WINT_TYPE__", 'newmacro': "wint_t"})
+	
+	if (not 'wint' in probe['builtin_signs']):
+		print_error(['Unable to determine whether wint_t is signed or unsigned.',
+		             COMPILER_FAIL])
+	
+	if (probe['builtin_signs']['wint'] == 'unsigned'):
+		macros.append({'oldmacro': "1", 'newmacro': 'WINT_IS_UNSIGNED'})
+	if (probe['builtin_signs']['wint'] == 'signed'):
+		macros.append({'oldmacro': "1", 'newmacro': 'WINT_IS_SIGNED'})
 	
 	return {'macros': macros, 'typedefs': typedefs}
@@ -571,5 +645,5 @@
 				
 				if (config['CROSS_TARGET'] == "arm32"):
-					gnu_target = "arm-linux-gnu"
+					gnu_target = "arm-linux-gnueabi"
 				
 				if (config['CROSS_TARGET'] == "ia32"):
@@ -586,5 +660,5 @@
 			if (config['PLATFORM'] == "arm32"):
 				target = config['PLATFORM']
-				gnu_target = "arm-linux-gnu"
+				gnu_target = "arm-linux-gnueabi"
 			
 			if (config['PLATFORM'] == "ia32"):
@@ -669,8 +743,13 @@
 				{'type': 'short int', 'tag': 'SHORT', 'strc': '"h"', 'conc': '"@"'},
 				{'type': 'char', 'tag': 'CHAR', 'strc': '"hh"', 'conc': '"@@"'}
+			],
+			[
+				{'type': 'long double', 'tag': 'LONG_DOUBLE'},
+				{'type': 'double', 'tag': 'DOUBLE'},
+				{'type': 'float', 'tag': 'FLOAT'}
 			]
 		)
 		
-		maps = detect_uints(probe, [1, 2, 4, 8], ['CHAR', 'SHORT', 'INT', 'LONG', 'LLONG'])
+		maps = detect_sizes(probe, [1, 2, 4, 8], ['CHAR', 'SHORT', 'INT', 'LONG', 'LLONG'], ['LONG_DOUBLE', 'DOUBLE', 'FLOAT'])
 		
 	finally:
Index: tools/toolchain.sh
===================================================================
--- tools/toolchain.sh	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ tools/toolchain.sh	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -55,12 +55,10 @@
 BINUTILS_VERSION="2.22"
 BINUTILS_RELEASE=""
-GCC_VERSION="4.6.3"
+GCC_VERSION="4.7.0"
 GDB_VERSION="7.4"
 
 BASEDIR="`pwd`"
 BINUTILS="binutils-${BINUTILS_VERSION}${BINUTILS_RELEASE}.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"
+GCC="gcc-${GCC_VERSION}.tar.bz2"
 GDB="gdb-${GDB_VERSION}.tar.bz2"
 
@@ -275,7 +273,5 @@
 	
 	download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "ee0f10756c84979622b992a4a61ea3f5"
-	download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "766091220c6a14fcaa2c06dd573e3758"
-	download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "48ba23770c34b1cb468f72618b4452c5"
-	download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "37515158a0fb3d0800ec41a08c05e69e"
+	download_fetch "${GCC_SOURCE}" "${GCC}" "2a0f1d99fda235c29d40b561f81d9a77"
 	download_fetch "${GDB_SOURCE}" "${GDB}" "95a9a8305fed4d30a30a6dc28ff9d060"
 }
@@ -299,7 +295,5 @@
 	echo ">>> Downloading tarballs"
 	source_check "${BASEDIR}/${BINUTILS}"
-	source_check "${BASEDIR}/${GCC_CORE}"
-	source_check "${BASEDIR}/${GCC_OBJC}"
-	source_check "${BASEDIR}/${GCC_CPP}"
+	source_check "${BASEDIR}/${GCC}"
 	source_check "${BASEDIR}/${GDB}"
 	
@@ -316,7 +310,5 @@
 	
 	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++"
+	unpack_tarball "${BASEDIR}/${GCC}" "GCC"
 	unpack_tarball "${BASEDIR}/${GDB}" "GDB"
 	
@@ -378,5 +370,5 @@
 	"arm32")
 		prepare
-		build_target "arm32" "arm-linux-gnu"
+		build_target "arm32" "arm-linux-gnueabi"
 		;;
 	"ia32")
@@ -415,5 +407,5 @@
 		prepare
 		build_target "amd64" "amd64-linux-gnu"
-		build_target "arm32" "arm-linux-gnu"
+		build_target "arm32" "arm-linux-gnueabi"
 		build_target "ia32" "i686-pc-linux-gnu"
 		build_target "ia64" "ia64-pc-linux-gnu"
@@ -428,5 +420,5 @@
 		prepare
 		build_target "amd64" "amd64-linux-gnu" &
-		build_target "arm32" "arm-linux-gnu" &
+		build_target "arm32" "arm-linux-gnueabi" &
 		build_target "ia32" "i686-pc-linux-gnu" &
 		build_target "ia64" "ia64-pc-linux-gnu" &
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/Makefile.common	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -149,11 +149,11 @@
 endif
 
-ifeq ($(STATIC_BUILD), y)
-BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a
-LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld
-else
-BASE_LIBS = $(LIBC_PREFIX)/libc.so0 $(LIBSOFTINT_PREFIX)/libsofti.so0
-LFLAGS = -Bdynamic
-LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld
+ifeq ($(STATIC_BUILD),y)
+	BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a
+	LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld
+else
+	BASE_LIBS = $(LIBC_PREFIX)/libc.so0 $(LIBSOFTINT_PREFIX)/libsofti.so0
+	LFLAGS = -Bdynamic
+	LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld
 endif
 
Index: uspace/app/binutils/Makefile
===================================================================
--- uspace/app/binutils/Makefile	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/app/binutils/Makefile	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -112,5 +112,5 @@
 endif
 ifeq ($(PLATFORM),arm32)
-TARGET = arm-linux-gnu
+TARGET = arm-linux-gnueabi
 endif
 ifeq ($(PLATFORM),ia32)
Index: uspace/app/sbi/src/run_texpr.c
===================================================================
--- uspace/app/sbi/src/run_texpr.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/app/sbi/src/run_texpr.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -98,6 +98,6 @@
 {
 	stree_symbol_t *sym;
-	tdata_item_t *targ_i;
-	tdata_item_t *titem;
+	tdata_item_t *targ_i = NULL;
+	tdata_item_t *titem = NULL;;
 	tdata_object_t *tobject;
 	tdata_deleg_t *tdeleg;
@@ -139,7 +139,4 @@
 		return;
 	}
-
-	/* Make compiler happy. */
-	titem = NULL;
 
 	switch (sym->sc) {
@@ -222,5 +219,5 @@
     stree_tindex_t *tindex, tdata_item_t **res)
 {
-	tdata_item_t *base_ti;
+	tdata_item_t *base_ti = NULL;
 	tdata_item_t *titem;
 	tdata_array_t *tarray;
Index: uspace/app/tester/fault/fault2.c
===================================================================
--- uspace/app/tester/fault/fault2.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/app/tester/fault/fault2.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -35,8 +35,6 @@
 const char *test_fault2(void)
 {
-	volatile long long var;
-	volatile int var1;
-	
-	var1 = *((aliasing_int *) (((char *) (&var)) + 1));
+	volatile long long var = 0;
+	volatile int var1 = *((aliasing_int *) (((char *) (&var)) + 1));
 	printf("Read %d\n", var1);
 	
Index: uspace/drv/bus/usb/ehci/Makefile
===================================================================
--- uspace/drv/bus/usb/ehci/Makefile	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/drv/bus/usb/ehci/Makefile	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -43,5 +43,5 @@
 SOURCES = \
 	main.c \
-	pci.c
+	res.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/bus/usb/ehci/main.c
===================================================================
--- uspace/drv/bus/usb/ehci/main.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/drv/bus/usb/ehci/main.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -44,5 +44,5 @@
 #include <usb/host/hcd.h>
 
-#include "pci.h"
+#include "res.h"
 
 #define NAME "ehci"
@@ -81,5 +81,5 @@
 	int irq = 0;
 
-	int ret = pci_get_my_registers(device, &reg_base, &reg_size, &irq);
+	int ret = get_my_registers(device, &reg_base, &reg_size, &irq);
 	CHECK_RET_RETURN(ret,
 	    "Failed to get memory addresses for %" PRIun ": %s.\n",
@@ -88,5 +88,5 @@
 	    reg_base, reg_size, irq);
 
-	ret = pci_disable_legacy(device, reg_base, reg_size, irq);
+	ret = disable_legacy(device, reg_base, reg_size);
 	CHECK_RET_RETURN(ret,
 	    "Failed to disable legacy USB: %s.\n", str_error(ret));
Index: pace/drv/bus/usb/ehci/pci.c
===================================================================
--- uspace/drv/bus/usb/ehci/pci.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,391 +1,0 @@
-/*
- * Copyright (c) 2011 Jan Vesely
- * 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 drvusbehci
- * @{
- */
-/**
- * @file
- * PCI related functions needed by the EHCI driver.
- */
-
-#include <errno.h>
-#include <str_error.h>
-#include <assert.h>
-#include <as.h>
-#include <devman.h>
-#include <ddi.h>
-#include <libarch/ddi.h>
-#include <device/hw_res.h>
-
-#include <usb/debug.h>
-#include <pci_dev_iface.h>
-
-#include "pci.h"
-
-#define PAGE_SIZE_MASK 0xfffff000
-
-#define HCC_PARAMS_OFFSET 0x8
-#define HCC_PARAMS_EECP_MASK 0xff
-#define HCC_PARAMS_EECP_OFFSET 8
-
-#define CMD_OFFSET 0x0
-#define STS_OFFSET 0x4
-#define INT_OFFSET 0x8
-#define CFG_OFFSET 0x40
-
-#define USBCMD_RUN 1
-#define USBSTS_HALTED (1 << 12)
-
-#define USBLEGSUP_OFFSET 0
-#define USBLEGSUP_BIOS_CONTROL (1 << 16)
-#define USBLEGSUP_OS_CONTROL (1 << 24)
-#define USBLEGCTLSTS_OFFSET 4
-
-#define DEFAULT_WAIT 1000
-#define WAIT_STEP 10
-
-#define PCI_READ(size) \
-do { \
-	async_sess_t *parent_sess = \
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle, \
-	    IPC_FLAG_BLOCKING); \
-	if (!parent_sess) \
-		return ENOMEM; \
-	\
-	sysarg_t add = (sysarg_t) address; \
-	sysarg_t val; \
-	\
-	async_exch_t *exch = async_exchange_begin(parent_sess); \
-	\
-	const int ret = \
-	    async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE), \
-	        IPC_M_CONFIG_SPACE_READ_##size, add, &val); \
-	\
-	async_exchange_end(exch); \
-	async_hangup(parent_sess); \
-	\
-	assert(value); \
-	\
-	*value = val; \
-	return ret; \
-} while (0)
-
-static int pci_read32(const ddf_dev_t *dev, int address, uint32_t *value)
-{
-	PCI_READ(32);
-}
-
-static int pci_read16(const ddf_dev_t *dev, int address, uint16_t *value)
-{
-	PCI_READ(16);
-}
-
-static int pci_read8(const ddf_dev_t *dev, int address, uint8_t *value)
-{
-	PCI_READ(8);
-}
-
-#define PCI_WRITE(size) \
-do { \
-	async_sess_t *parent_sess = \
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle, \
-	    IPC_FLAG_BLOCKING); \
-	if (!parent_sess) \
-		return ENOMEM; \
-	\
-	sysarg_t add = (sysarg_t) address; \
-	sysarg_t val = value; \
-	\
-	async_exch_t *exch = async_exchange_begin(parent_sess); \
-	\
-	const int ret = \
-	    async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE), \
-	        IPC_M_CONFIG_SPACE_WRITE_##size, add, val); \
-	\
-	async_exchange_end(exch); \
-	async_hangup(parent_sess); \
-	\
-	return ret; \
-} while(0)
-
-static int pci_write32(const ddf_dev_t *dev, int address, uint32_t value)
-{
-	PCI_WRITE(32);
-}
-
-static int pci_write16(const ddf_dev_t *dev, int address, uint16_t value)
-{
-	PCI_WRITE(16);
-}
-
-static int pci_write8(const ddf_dev_t *dev, int address, uint8_t value)
-{
-	PCI_WRITE(8);
-}
-
-/** Get address of registers and IRQ for given device.
- *
- * @param[in] dev Device asking for the addresses.
- * @param[out] mem_reg_address Base address of the memory range.
- * @param[out] mem_reg_size Size of the memory range.
- * @param[out] irq_no IRQ assigned to the device.
- * @return Error code.
- */
-int pci_get_my_registers(const ddf_dev_t *dev,
-    uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)
-{
-	assert(dev != NULL);
-	
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-	
-	hw_resource_list_t hw_resources;
-	int rc = hw_res_get_resource_list(parent_sess, &hw_resources);
-	if (rc != EOK) {
-		async_hangup(parent_sess);
-		return rc;
-	}
-	
-	uintptr_t mem_address = 0;
-	size_t mem_size = 0;
-	bool mem_found = false;
-	
-	int irq = 0;
-	bool irq_found = false;
-	
-	size_t i;
-	for (i = 0; i < hw_resources.count; i++) {
-		hw_resource_t *res = &hw_resources.resources[i];
-		switch (res->type) {
-		case INTERRUPT:
-			irq = res->res.interrupt.irq;
-			irq_found = true;
-			usb_log_debug2("Found interrupt: %d.\n", irq);
-			break;
-		case MEM_RANGE:
-			if (res->res.mem_range.address != 0
-			    && res->res.mem_range.size != 0 ) {
-				mem_address = res->res.mem_range.address;
-				mem_size = res->res.mem_range.size;
-				usb_log_debug2("Found mem: %" PRIxn" %zu.\n",
-				    mem_address, mem_size);
-				mem_found = true;
-			}
-		default:
-			break;
-		}
-	}
-	
-	if (mem_found && irq_found) {
-		*mem_reg_address = mem_address;
-		*mem_reg_size = mem_size;
-		*irq_no = irq;
-		rc = EOK;
-	} else {
-		rc = ENOENT;
-	}
-	
-	async_hangup(parent_sess);
-	return rc;
-}
-/*----------------------------------------------------------------------------*/
-/** Calls the PCI driver with a request to enable interrupts
- *
- * @param[in] device Device asking for interrupts
- * @return Error code.
- */
-int pci_enable_interrupts(const ddf_dev_t *device)
-{
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-	
-	const bool enabled = hw_res_enable_interrupt(parent_sess);
-	async_hangup(parent_sess);
-	
-	return enabled ? EOK : EIO;
-}
-/*----------------------------------------------------------------------------*/
-/** Implements BIOS handoff routine as decribed in EHCI spec
- *
- * @param[in] device Device asking for interrupts
- * @return Error code.
- */
-int pci_disable_legacy(
-    const ddf_dev_t *device, uintptr_t reg_base, size_t reg_size, int irq)
-{
-	assert(device);
-	(void) pci_read16;
-	(void) pci_read8;
-	(void) pci_write16;
-
-#define CHECK_RET_RETURN(ret, message...) \
-	if (ret != EOK) { \
-		usb_log_error(message); \
-		return ret; \
-	} else (void)0
-
-	/* Map EHCI registers */
-	void *regs = NULL;
-	int ret = pio_enable((void*)reg_base, reg_size, &regs);
-	CHECK_RET_RETURN(ret, "Failed to map registers %p: %s.\n",
-	    (void *) reg_base, str_error(ret));
-
-	const uint32_t hcc_params =
-	    *(uint32_t*)(regs + HCC_PARAMS_OFFSET);
-	usb_log_debug("Value of hcc params register: %x.\n", hcc_params);
-
-	/* Read value of EHCI Extended Capabilities Pointer
-	 * position of EEC registers (points to PCI config space) */
-	const uint32_t eecp =
-	    (hcc_params >> HCC_PARAMS_EECP_OFFSET) & HCC_PARAMS_EECP_MASK;
-	usb_log_debug("Value of EECP: %x.\n", eecp);
-
-	/* Read the first EEC. i.e. Legacy Support register */
-	uint32_t usblegsup;
-	ret = pci_read32(device, eecp + USBLEGSUP_OFFSET, &usblegsup);
-	CHECK_RET_RETURN(ret, "Failed to read USBLEGSUP: %s.\n", str_error(ret));
-	usb_log_debug("USBLEGSUP: %" PRIx32 ".\n", usblegsup);
-
-	/* Request control from firmware/BIOS, by writing 1 to highest byte.
-	 * (OS Control semaphore)*/
-	usb_log_debug("Requesting OS control.\n");
-	ret = pci_write8(device, eecp + USBLEGSUP_OFFSET + 3, 1);
-	CHECK_RET_RETURN(ret, "Failed to request OS EHCI control: %s.\n",
-	    str_error(ret));
-
-	size_t wait = 0;
-	/* Wait for BIOS to release control. */
-	ret = pci_read32(device, eecp + USBLEGSUP_OFFSET, &usblegsup);
-	while ((wait < DEFAULT_WAIT) && (usblegsup & USBLEGSUP_BIOS_CONTROL)) {
-		async_usleep(WAIT_STEP);
-		ret = pci_read32(device, eecp + USBLEGSUP_OFFSET, &usblegsup);
-		wait += WAIT_STEP;
-	}
-
-
-	if ((usblegsup & USBLEGSUP_BIOS_CONTROL) == 0) {
-		usb_log_info("BIOS released control after %zu usec.\n", wait);
-	} else {
-		/* BIOS failed to hand over control, this should not happen. */
-		usb_log_warning( "BIOS failed to release control after "
-		    "%zu usecs, force it.\n", wait);
-		ret = pci_write32(device, eecp + USBLEGSUP_OFFSET,
-		    USBLEGSUP_OS_CONTROL);
-		CHECK_RET_RETURN(ret, "Failed to force OS control: %s.\n",
-		    str_error(ret));
-		/* Check capability type here, A value of 01h
-		 * identifies the capability as Legacy Support.
-		 * This extended capability requires one
-		 * additional 32-bit register for control/status information,
-		 * and this register is located at offset EECP+04h
-		 * */
-		if ((usblegsup & 0xff) == 1) {
-			/* Read the second EEC
-			 * Legacy Support and Control register */
-			uint32_t usblegctlsts;
-			ret = pci_read32(
-			    device, eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts);
-			CHECK_RET_RETURN(ret,
-			    "Failed to get USBLEGCTLSTS: %s.\n", str_error(ret));
-			usb_log_debug("USBLEGCTLSTS: %" PRIx32 ".\n",
-			    usblegctlsts);
-			/* Zero SMI enables in legacy control register.
-			 * It should prevent pre-OS code from interfering. */
-			ret = pci_write32(device, eecp + USBLEGCTLSTS_OFFSET,
-			    0xe0000000); /* three upper bits are WC */
-			CHECK_RET_RETURN(ret,
-			    "Failed(%d) zero USBLEGCTLSTS.\n", ret);
-			udelay(10);
-			ret = pci_read32(
-			    device, eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts);
-			CHECK_RET_RETURN(ret,
-			    "Failed to get USBLEGCTLSTS 2: %s.\n",
-			    str_error(ret));
-			usb_log_debug("Zeroed USBLEGCTLSTS: %" PRIx32 ".\n",
-			    usblegctlsts);
-		}
-	}
-
-
-	/* Read again Legacy Support register */
-	ret = pci_read32(device, eecp + USBLEGSUP_OFFSET, &usblegsup);
-	CHECK_RET_RETURN(ret, "Failed to read USBLEGSUP: %s.\n", str_error(ret));
-	usb_log_debug("USBLEGSUP: %" PRIx32 ".\n", usblegsup);
-
-	/*
-	 * TURN OFF EHCI FOR NOW, DRIVER WILL REINITIALIZE IT
-	 */
-
-	/* Get size of capability registers in memory space. */
-	const unsigned operation_offset = *(uint8_t*)regs;
-	usb_log_debug("USBCMD offset: %d.\n", operation_offset);
-
-	/* Zero USBCMD register. */
-	volatile uint32_t *usbcmd =
-	    (uint32_t*)((uint8_t*)regs + operation_offset + CMD_OFFSET);
-	volatile uint32_t *usbsts =
-	    (uint32_t*)((uint8_t*)regs + operation_offset + STS_OFFSET);
-	volatile uint32_t *usbconf =
-	    (uint32_t*)((uint8_t*)regs + operation_offset + CFG_OFFSET);
-	volatile uint32_t *usbint =
-	    (uint32_t*)((uint8_t*)regs + operation_offset + INT_OFFSET);
-	usb_log_debug("USBCMD value: %x.\n", *usbcmd);
-	if (*usbcmd & USBCMD_RUN) {
-		*usbsts = 0x3f; /* ack all interrupts */
-		*usbint = 0; /* disable all interrutps */
-		*usbconf = 0; /* relase control of RH ports */
-
-		*usbcmd = 0;
-		/* Wait until hc is halted */
-		while ((*usbsts & USBSTS_HALTED) == 0);
-		usb_log_info("EHCI turned off.\n");
-	} else {
-		usb_log_info("EHCI was not running.\n");
-	}
-	usb_log_debug("Registers: \n"
-	    "\t USBCMD: %x(0x00080000 = at least 1ms between interrupts)\n"
-	    "\t USBSTS: %x(0x00001000 = HC halted)\n"
-	    "\t USBINT: %x(0x0 = no interrupts).\n"
-	    "\t CONFIG: %x(0x0 = ports controlled by companion hc).\n",
-	    *usbcmd, *usbsts, *usbint, *usbconf);
-
-	return ret;
-#undef CHECK_RET_RETURN
-}
-
-/**
- * @}
- */
Index: pace/drv/bus/usb/ehci/pci.h
===================================================================
--- uspace/drv/bus/usb/ehci/pci.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2011 Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup drvusbehci
- * @{
- */
-/** @file
- * PCI related functions needed by EHCI driver.
- */
-#ifndef DRV_EHCI_PCI_H
-#define DRV_EHCI_PCI_H
-
-#include <ddf/driver.h>
-
-int pci_get_my_registers(const ddf_dev_t *, uintptr_t *, size_t *, int *);
-int pci_enable_interrupts(const ddf_dev_t *);
-int pci_disable_legacy(const ddf_dev_t *, uintptr_t, size_t, int);
-
-#endif
-/**
- * @}
- */
-
Index: uspace/drv/bus/usb/ehci/res.c
===================================================================
--- uspace/drv/bus/usb/ehci/res.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ uspace/drv/bus/usb/ehci/res.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 2011 Jan Vesely
+ * 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 drvusbehci
+ * @{
+ */
+/**
+ * @file
+ * PCI related functions needed by the EHCI driver.
+ */
+
+#include <errno.h>
+#include <str_error.h>
+#include <assert.h>
+#include <devman.h>
+#include <ddi.h>
+#include <usb/debug.h>
+#include <device/hw_res_parsed.h>
+#include <device/pci.h>
+
+#include "res.h"
+
+#define HCC_PARAMS_OFFSET 0x8
+#define HCC_PARAMS_EECP_MASK 0xff
+#define HCC_PARAMS_EECP_OFFSET 8
+
+#define CMD_OFFSET 0x0
+#define STS_OFFSET 0x4
+#define INT_OFFSET 0x8
+#define CFG_OFFSET 0x40
+
+#define USBCMD_RUN 1
+#define USBSTS_HALTED (1 << 12)
+
+#define USBLEGSUP_OFFSET 0
+#define USBLEGSUP_BIOS_CONTROL (1 << 16)
+#define USBLEGSUP_OS_CONTROL (1 << 24)
+#define USBLEGCTLSTS_OFFSET 4
+
+#define DEFAULT_WAIT 1000
+#define WAIT_STEP 10
+
+
+/** Get address of registers and IRQ for given device.
+ *
+ * @param[in] dev Device asking for the addresses.
+ * @param[out] mem_reg_address Base address of the memory range.
+ * @param[out] mem_reg_size Size of the memory range.
+ * @param[out] irq_no IRQ assigned to the device.
+ * @return Error code.
+ */
+int get_my_registers(const ddf_dev_t *dev,
+    uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)
+{
+	assert(dev);
+	
+	async_sess_t *parent_sess = devman_parent_device_connect(
+	    EXCHANGE_SERIALIZE, dev->handle, IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+	
+	hw_res_list_parsed_t hw_res;
+	hw_res_list_parsed_init(&hw_res);
+	const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0);
+	async_hangup(parent_sess);
+	if (ret != EOK) {
+		return ret;
+	}
+
+	if (hw_res.irqs.count != 1 || hw_res.mem_ranges.count != 1) {
+		hw_res_list_parsed_clean(&hw_res);
+		return ENOENT;
+	}
+
+	if (mem_reg_address)
+		*mem_reg_address = hw_res.mem_ranges.ranges[0].address;
+	if (mem_reg_size)
+		*mem_reg_size = hw_res.mem_ranges.ranges[0].size;
+	if (irq_no)
+		*irq_no = hw_res.irqs.irqs[0];
+
+	hw_res_list_parsed_clean(&hw_res);
+	return EOK;
+}
+/*----------------------------------------------------------------------------*/
+/** Calls the PCI driver with a request to enable interrupts
+ *
+ * @param[in] device Device asking for interrupts
+ * @return Error code.
+ */
+int enable_interrupts(const ddf_dev_t *device)
+{
+	async_sess_t *parent_sess = devman_parent_device_connect(
+	    EXCHANGE_SERIALIZE, device->handle, IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+	
+	const bool enabled = hw_res_enable_interrupt(parent_sess);
+	async_hangup(parent_sess);
+	
+	return enabled ? EOK : EIO;
+}
+/*----------------------------------------------------------------------------*/
+/** Implements BIOS hands-off routine as described in EHCI spec
+ *
+ * @param device EHCI device
+ * @param eecp Value of EHCI Extended Capabilities pointer.
+ * @return Error code.
+ */
+static int disable_extended_caps(const ddf_dev_t *device, unsigned eecp)
+{
+	/* nothing to do */
+	if (eecp == 0)
+		return EOK;
+
+	async_sess_t *parent_sess = devman_parent_device_connect(
+	    EXCHANGE_SERIALIZE, device->handle, IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+
+#define CHECK_RET_HANGUP_RETURN(ret, message...) \
+	if (ret != EOK) { \
+		usb_log_error(message); \
+		async_hangup(parent_sess); \
+		return ret; \
+	} else (void)0
+
+	/* Read the first EEC. i.e. Legacy Support register */
+	uint32_t usblegsup;
+	int ret = pci_config_space_read_32(parent_sess,
+	    eecp + USBLEGSUP_OFFSET, &usblegsup);
+	CHECK_RET_HANGUP_RETURN(ret,
+	    "Failed to read USBLEGSUP: %s.\n", str_error(ret));
+	usb_log_debug("USBLEGSUP: %" PRIx32 ".\n", usblegsup);
+
+	/* Request control from firmware/BIOS by writing 1 to highest
+	 * byte. (OS Control semaphore)*/
+	usb_log_debug("Requesting OS control.\n");
+	ret = pci_config_space_write_8(parent_sess,
+	    eecp + USBLEGSUP_OFFSET + 3, 1);
+	CHECK_RET_HANGUP_RETURN(ret, "Failed to request OS EHCI control: %s.\n",
+	    str_error(ret));
+
+	size_t wait = 0;
+	/* Wait for BIOS to release control. */
+	ret = pci_config_space_read_32(
+	    parent_sess, eecp + USBLEGSUP_OFFSET, &usblegsup);
+	while ((wait < DEFAULT_WAIT) && (usblegsup & USBLEGSUP_BIOS_CONTROL)) {
+		async_usleep(WAIT_STEP);
+		ret = pci_config_space_read_32(parent_sess,
+		    eecp + USBLEGSUP_OFFSET, &usblegsup);
+		wait += WAIT_STEP;
+	}
+
+	if ((usblegsup & USBLEGSUP_BIOS_CONTROL) == 0) {
+		usb_log_info("BIOS released control after %zu usec.\n", wait);
+		async_hangup(parent_sess);
+		return EOK;
+	}
+
+	/* BIOS failed to hand over control, this should not happen. */
+	usb_log_warning( "BIOS failed to release control after "
+	    "%zu usecs, force it.\n", wait);
+	ret = pci_config_space_write_32(parent_sess,
+	    eecp + USBLEGSUP_OFFSET, USBLEGSUP_OS_CONTROL);
+	CHECK_RET_HANGUP_RETURN(ret, "Failed to force OS control: "
+	    "%s.\n", str_error(ret));
+	/*
+	 * Check capability type here, value of 01h identifies the capability
+	 * as Legacy Support. This extended capability requires one additional
+	 * 32-bit register for control/status information and this register is
+	 * located at offset EECP+04h
+	 */
+	if ((usblegsup & 0xff) == 1) {
+		/* Read the second EEC Legacy Support and Control register */
+		uint32_t usblegctlsts;
+		ret = pci_config_space_read_32(parent_sess,
+		    eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts);
+		CHECK_RET_HANGUP_RETURN(ret, "Failed to get USBLEGCTLSTS: %s.\n",
+		    str_error(ret));
+		usb_log_debug("USBLEGCTLSTS: %" PRIx32 ".\n", usblegctlsts);
+		/*
+		 * Zero SMI enables in legacy control register.
+		 * It should prevent pre-OS code from
+		 * interfering. NOTE: Three upper bits are WC
+		 */
+		ret = pci_config_space_write_32(parent_sess,
+		    eecp + USBLEGCTLSTS_OFFSET, 0xe0000000);
+		CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) zero USBLEGCTLSTS.\n", ret);
+		udelay(10);
+		ret = pci_config_space_read_32(parent_sess,
+		    eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts);
+		CHECK_RET_HANGUP_RETURN(ret, "Failed to get USBLEGCTLSTS 2: %s.\n",
+		    str_error(ret));
+		usb_log_debug("Zeroed USBLEGCTLSTS: %" PRIx32 ".\n",
+		    usblegctlsts);
+	}
+
+	/* Read again Legacy Support register */
+	ret = pci_config_space_read_32(parent_sess,
+	    eecp + USBLEGSUP_OFFSET, &usblegsup);
+	CHECK_RET_HANGUP_RETURN(ret, "Failed to read USBLEGSUP: %s.\n",
+	    str_error(ret));
+	usb_log_debug("USBLEGSUP: %" PRIx32 ".\n", usblegsup);
+	async_hangup(parent_sess);
+	return EOK;
+#undef CHECK_RET_HANGUP_RETURN
+}
+
+int disable_legacy(const ddf_dev_t *device, uintptr_t reg_base, size_t reg_size)
+{
+	assert(device);
+	usb_log_debug("Disabling EHCI legacy support.\n");
+
+#define CHECK_RET_RETURN(ret, message...) \
+	if (ret != EOK) { \
+		usb_log_error(message); \
+		return ret; \
+	} else (void)0
+
+	/* Map EHCI registers */
+	void *regs = NULL;
+	int ret = pio_enable((void*)reg_base, reg_size, &regs);
+	CHECK_RET_RETURN(ret, "Failed to map registers %p: %s.\n",
+	    (void *) reg_base, str_error(ret));
+
+	usb_log_debug2("Registers mapped at: %p.\n", regs);
+
+	const uint32_t hcc_params =
+	    *(uint32_t*)(regs + HCC_PARAMS_OFFSET);
+	usb_log_debug("Value of hcc params register: %x.\n", hcc_params);
+
+	/* Read value of EHCI Extended Capabilities Pointer
+	 * position of EEC registers (points to PCI config space) */
+	const uint32_t eecp =
+	    (hcc_params >> HCC_PARAMS_EECP_OFFSET) & HCC_PARAMS_EECP_MASK;
+	usb_log_debug("Value of EECP: %x.\n", eecp);
+
+	ret = disable_extended_caps(device, eecp);
+	CHECK_RET_RETURN(ret, "Failed to disable extended capabilities: %s.\n",
+	    str_error(ret));
+
+#undef CHECK_RET_RETURN
+
+	/*
+	 * TURN OFF EHCI FOR NOW, DRIVER WILL REINITIALIZE IT IF NEEDED
+	 */
+
+	/* Get size of capability registers in memory space. */
+	const unsigned operation_offset = *(uint8_t*)regs;
+	usb_log_debug("USBCMD offset: %d.\n", operation_offset);
+
+	/* Zero USBCMD register. */
+	volatile uint32_t *usbcmd =
+	    (uint32_t*)((uint8_t*)regs + operation_offset + CMD_OFFSET);
+	volatile uint32_t *usbsts =
+	    (uint32_t*)((uint8_t*)regs + operation_offset + STS_OFFSET);
+	volatile uint32_t *usbconf =
+	    (uint32_t*)((uint8_t*)regs + operation_offset + CFG_OFFSET);
+	volatile uint32_t *usbint =
+	    (uint32_t*)((uint8_t*)regs + operation_offset + INT_OFFSET);
+	usb_log_debug("USBCMD value: %x.\n", *usbcmd);
+	if (*usbcmd & USBCMD_RUN) {
+		*usbsts = 0x3f; /* ack all interrupts */
+		*usbint = 0; /* disable all interrupts */
+		*usbconf = 0; /* release control of RH ports */
+
+		*usbcmd = 0;
+		/* Wait until hc is halted */
+		while ((*usbsts & USBSTS_HALTED) == 0);
+		usb_log_info("EHCI turned off.\n");
+	} else {
+		usb_log_info("EHCI was not running.\n");
+	}
+	usb_log_debug("Registers: \n"
+	    "\t USBCMD(%p): %x(0x00080000 = at least 1ms between interrupts)\n"
+	    "\t USBSTS(%p): %x(0x00001000 = HC halted)\n"
+	    "\t USBINT(%p): %x(0x0 = no interrupts).\n"
+	    "\t CONFIG(%p): %x(0x0 = ports controlled by companion hc).\n",
+	    usbcmd, *usbcmd, usbsts, *usbsts, usbint, *usbint, usbconf,*usbconf);
+
+	return ret;
+}
+
+/**
+ * @}
+ */
Index: uspace/drv/bus/usb/ehci/res.h
===================================================================
--- uspace/drv/bus/usb/ehci/res.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ uspace/drv/bus/usb/ehci/res.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2011 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup drvusbehci
+ * @{
+ */
+/** @file
+ * PCI related functions needed by EHCI driver.
+ */
+#ifndef DRV_EHCI_PCI_H
+#define DRV_EHCI_PCI_H
+
+#include <ddf/driver.h>
+
+int get_my_registers(const ddf_dev_t *, uintptr_t *, size_t *, int *);
+int enable_interrupts(const ddf_dev_t *);
+int disable_legacy(const ddf_dev_t *, uintptr_t, size_t);
+
+#endif
+/**
+ * @}
+ */
+
Index: uspace/drv/bus/usb/ohci/Makefile
===================================================================
--- uspace/drv/bus/usb/ohci/Makefile	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/drv/bus/usb/ohci/Makefile	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -50,5 +50,5 @@
 	ohci_batch.c \
 	ohci_endpoint.c \
-	pci.c \
+	res.c \
 	root_hub.c \
 	hw_struct/endpoint_descriptor.c \
Index: uspace/drv/bus/usb/ohci/hw_struct/hcca.h
===================================================================
--- uspace/drv/bus/usb/ohci/hw_struct/hcca.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/drv/bus/usb/ohci/hw_struct/hcca.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -46,6 +46,6 @@
 	uint16_t pad1;
 	uint32_t done_head;
-	uint32_t reserved[29];
-} __attribute__((packed, aligned)) hcca_t;
+	uint32_t reserved[30];
+} hcca_t;
 
 static inline void * hcca_get(void)
Index: uspace/drv/bus/usb/ohci/ohci.c
===================================================================
--- uspace/drv/bus/usb/ohci/ohci.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/drv/bus/usb/ohci/ohci.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -42,5 +42,5 @@
 
 #include "ohci.h"
-#include "pci.h"
+#include "res.h"
 #include "hc.h"
 
@@ -180,5 +180,5 @@
 	int irq = 0;
 
-	ret = pci_get_my_registers(device, &reg_base, &reg_size, &irq);
+	ret = get_my_registers(device, &reg_base, &reg_size, &irq);
 	CHECK_RET_DEST_FREE_RETURN(ret,
 	    "Failed to get register memory addresses for %" PRIun ": %s.\n",
@@ -211,5 +211,5 @@
 	/* Try to enable interrupts */
 	bool interrupts = false;
-	ret = pci_enable_interrupts(device);
+	ret = enable_interrupts(device);
 	if (ret != EOK) {
 		usb_log_warning("Failed to enable interrupts: %s."
Index: pace/drv/bus/usb/ohci/pci.c
===================================================================
--- uspace/drv/bus/usb/ohci/pci.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,116 +1,0 @@
-/*
- * Copyright (c) 2011 Jan Vesely
- * 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 drvusbohci
- * @{
- */
-/**
- * @file
- * PCI related functions needed by the OHCI driver.
- */
-
-#include <errno.h>
-#include <assert.h>
-#include <as.h>
-#include <devman.h>
-#include <ddi.h>
-#include <libarch/ddi.h>
-#include <device/hw_res_parsed.h>
-
-#include <usb/debug.h>
-#include <pci_dev_iface.h>
-
-#include "pci.h"
-
-/** Get address of registers and IRQ for given device.
- *
- * @param[in] dev Device asking for the addresses.
- * @param[out] mem_reg_address Base address of the memory range.
- * @param[out] mem_reg_size Size of the memory range.
- * @param[out] irq_no IRQ assigned to the device.
- * @return Error code.
- */
-int pci_get_my_registers(ddf_dev_t *dev,
-    uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)
-{
-	assert(dev);
-
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-
-	hw_res_list_parsed_t hw_res;
-	hw_res_list_parsed_init(&hw_res);
-	const int ret =  hw_res_get_list_parsed(parent_sess, &hw_res, 0);
-	async_hangup(parent_sess);
-	if (ret != EOK) {
-		return ret;
-	}
-
-	/* We want one irq and one mem range. */
-	if (hw_res.irqs.count != 1 || hw_res.mem_ranges.count != 1) {
-		hw_res_list_parsed_clean(&hw_res);
-		return EINVAL;
-	}
-
-	if (mem_reg_address)
-		*mem_reg_address = hw_res.mem_ranges.ranges[0].address;
-	if (mem_reg_size)
-		*mem_reg_size = hw_res.mem_ranges.ranges[0].size;
-	if (irq_no)
-		*irq_no = hw_res.irqs.irqs[0];
-
-	hw_res_list_parsed_clean(&hw_res);
-	return EOK;
-}
-
-/** Call the PCI driver with a request to enable interrupts
- *
- * @param[in] device Device asking for interrupts
- * @return Error code.
- */
-int pci_enable_interrupts(ddf_dev_t *device)
-{
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-	
-	bool enabled = hw_res_enable_interrupt(parent_sess);
-	async_hangup(parent_sess);
-	
-	return enabled ? EOK : EIO;
-}
-
-/**
- * @}
- */
Index: pace/drv/bus/usb/ohci/pci.h
===================================================================
--- uspace/drv/bus/usb/ohci/pci.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2011 Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/** @addtogroup drvusbohci
- * @{
- */
-/** @file
- * PCI related functions needed by OHCI driver.
- */
-#ifndef DRV_OHCI_PCI_H
-#define DRV_OHCI_PCI_H
-
-#include <ddf/driver.h>
-
-int pci_get_my_registers(ddf_dev_t *, uintptr_t *, size_t *, int *);
-int pci_enable_interrupts(ddf_dev_t *);
-int pci_disable_legacy(ddf_dev_t *);
-
-#endif
-/**
- * @}
- */
-
Index: uspace/drv/bus/usb/ohci/res.c
===================================================================
--- uspace/drv/bus/usb/ohci/res.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ uspace/drv/bus/usb/ohci/res.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2011 Jan Vesely
+ * 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 drvusbohci
+ * @{
+ */
+/**
+ * @file
+ * PCI related functions needed by the OHCI driver.
+ */
+
+#include <errno.h>
+#include <assert.h>
+#include <devman.h>
+#include <device/hw_res_parsed.h>
+
+#include <usb/debug.h>
+
+#include "res.h"
+
+/** Get address of registers and IRQ for given device.
+ *
+ * @param[in] dev Device asking for the addresses.
+ * @param[out] mem_reg_address Base address of the memory range.
+ * @param[out] mem_reg_size Size of the memory range.
+ * @param[out] irq_no IRQ assigned to the device.
+ * @return Error code.
+ */
+int get_my_registers(const ddf_dev_t *dev,
+    uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)
+{
+	assert(dev);
+
+	async_sess_t *parent_sess =
+	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
+	    IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+
+	hw_res_list_parsed_t hw_res;
+	hw_res_list_parsed_init(&hw_res);
+	const int ret =  hw_res_get_list_parsed(parent_sess, &hw_res, 0);
+	async_hangup(parent_sess);
+	if (ret != EOK) {
+		return ret;
+	}
+
+	/* We want one irq and one mem range. */
+	if (hw_res.irqs.count != 1 || hw_res.mem_ranges.count != 1) {
+		hw_res_list_parsed_clean(&hw_res);
+		return EINVAL;
+	}
+
+	if (mem_reg_address)
+		*mem_reg_address = hw_res.mem_ranges.ranges[0].address;
+	if (mem_reg_size)
+		*mem_reg_size = hw_res.mem_ranges.ranges[0].size;
+	if (irq_no)
+		*irq_no = hw_res.irqs.irqs[0];
+
+	hw_res_list_parsed_clean(&hw_res);
+	return EOK;
+}
+
+/** Call the PCI driver with a request to enable interrupts
+ *
+ * @param[in] device Device asking for interrupts
+ * @return Error code.
+ */
+int enable_interrupts(const ddf_dev_t *device)
+{
+	async_sess_t *parent_sess =
+	    devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
+	    IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+	
+	const bool enabled = hw_res_enable_interrupt(parent_sess);
+	async_hangup(parent_sess);
+	
+	return enabled ? EOK : EIO;
+}
+
+/**
+ * @}
+ */
Index: uspace/drv/bus/usb/ohci/res.h
===================================================================
--- uspace/drv/bus/usb/ohci/res.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ uspace/drv/bus/usb/ohci/res.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** @addtogroup drvusbohci
+ * @{
+ */
+/** @file
+ * PCI related functions needed by OHCI driver.
+ */
+#ifndef DRV_OHCI_RES_H
+#define DRV_OHCI_RES_H
+
+#include <ddf/driver.h>
+
+int get_my_registers(const ddf_dev_t *, uintptr_t *, size_t *, int *);
+int enable_interrupts(const ddf_dev_t *);
+
+#endif
+/**
+ * @}
+ */
+
Index: uspace/drv/bus/usb/uhci/Makefile
===================================================================
--- uspace/drv/bus/usb/uhci/Makefile	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/drv/bus/usb/uhci/Makefile	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -44,5 +44,5 @@
 	hc.c \
 	main.c \
-	pci.c \
+	res.c \
 	root_hub.c \
 	transfer_list.c \
Index: pace/drv/bus/usb/uhci/pci.c
===================================================================
--- uspace/drv/bus/usb/uhci/pci.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,146 +1,0 @@
-/*
- * Copyright (c) 2011 Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @addtogroup drvusbuhcihc
- * @{
- */
-/**
- * @file
- * PCI related functions needed by the UHCI driver.
- */
-
-#include <errno.h>
-#include <assert.h>
-#include <devman.h>
-#include <device/hw_res_parsed.h>
-
-#include <usb/debug.h>
-#include <pci_dev_iface.h>
-
-#include "pci.h"
-
-/** Get I/O address of registers and IRQ for given device.
- *
- * @param[in] dev Device asking for the addresses.
- * @param[out] io_reg_address Base address of the I/O range.
- * @param[out] io_reg_size Size of the I/O range.
- * @param[out] irq_no IRQ assigned to the device.
- * @return Error code.
- */
-int pci_get_my_registers(const ddf_dev_t *dev,
-    uintptr_t *io_reg_address, size_t *io_reg_size, int *irq_no)
-{
-	assert(dev);
-	assert(io_reg_address);
-	assert(io_reg_size);
-	assert(irq_no);
-
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-
-	hw_res_list_parsed_t hw_res;
-	hw_res_list_parsed_init(&hw_res);
-	const int ret =  hw_res_get_list_parsed(parent_sess, &hw_res, 0);
-	async_hangup(parent_sess);
-	if (ret != EOK) {
-		return ret;
-	}
-
-	/* We want one irq and one io range. */
-	if (hw_res.irqs.count != 1 || hw_res.io_ranges.count != 1) {
-		hw_res_list_parsed_clean(&hw_res);
-		return EINVAL;
-	}
-
-	if (io_reg_address)
-		*io_reg_address = hw_res.io_ranges.ranges[0].address;
-	if (io_reg_size)
-		*io_reg_size = hw_res.io_ranges.ranges[0].size;
-	if (irq_no)
-		*irq_no = hw_res.irqs.irqs[0];
-
-	hw_res_list_parsed_clean(&hw_res);
-	return EOK;
-}
-/*----------------------------------------------------------------------------*/
-/** Call the PCI driver with a request to enable interrupts
- *
- * @param[in] device Device asking for interrupts
- * @return Error code.
- */
-int pci_enable_interrupts(const ddf_dev_t *device)
-{
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-
-	const bool enabled = hw_res_enable_interrupt(parent_sess);
-	async_hangup(parent_sess);
-
-	return enabled ? EOK : EIO;
-}
-/*----------------------------------------------------------------------------*/
-/** Call the PCI driver with a request to clear legacy support register
- *
- * @param[in] device Device asking to disable interrupts
- * @return Error code.
- */
-int pci_disable_legacy(const ddf_dev_t *device)
-{
-	assert(device);
-
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-
-	/* See UHCI design guide for these values p.45,
-	 * write all WC bits in USB legacy register */
-	const sysarg_t address = 0xc0;
-	const sysarg_t value = 0xaf00;
-
-	async_exch_t *exch = async_exchange_begin(parent_sess);
-
-	const int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
-	    IPC_M_CONFIG_SPACE_WRITE_16, address, value);
-
-	async_exchange_end(exch);
-	async_hangup(parent_sess);
-
-	return rc;
-}
-
-/**
- * @}
- */
Index: pace/drv/bus/usb/uhci/pci.h
===================================================================
--- uspace/drv/bus/usb/uhci/pci.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2010 Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup drvusbuhcihc
- * @{
- */
-/** @file
- * @brief UHCI driver PCI helper functions
- */
-#ifndef DRV_UHCI_PCI_H
-#define DRV_UHCI_PCI_H
-
-#include <ddf/driver.h>
-
-int pci_get_my_registers(const ddf_dev_t *, uintptr_t *, size_t *, int *);
-int pci_enable_interrupts(const ddf_dev_t *);
-int pci_disable_legacy(const ddf_dev_t *);
-
-#endif
-/**
- * @}
- */
-
Index: uspace/drv/bus/usb/uhci/res.c
===================================================================
--- uspace/drv/bus/usb/uhci/res.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ uspace/drv/bus/usb/uhci/res.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2011 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @addtogroup drvusbuhcihc
+ * @{
+ */
+/**
+ * @file
+ * PCI related functions needed by the UHCI driver.
+ */
+
+#include <errno.h>
+#include <assert.h>
+#include <devman.h>
+#include <device/hw_res_parsed.h>
+#include <device/pci.h>
+
+#include "res.h"
+
+/** Get I/O address of registers and IRQ for given device.
+ *
+ * @param[in] dev Device asking for the addresses.
+ * @param[out] io_reg_address Base address of the I/O range.
+ * @param[out] io_reg_size Size of the I/O range.
+ * @param[out] irq_no IRQ assigned to the device.
+ * @return Error code.
+ */
+int get_my_registers(const ddf_dev_t *dev,
+    uintptr_t *io_reg_address, size_t *io_reg_size, int *irq_no)
+{
+	assert(dev);
+
+	async_sess_t *parent_sess =
+	    devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
+	    IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+
+	hw_res_list_parsed_t hw_res;
+	hw_res_list_parsed_init(&hw_res);
+	const int ret =  hw_res_get_list_parsed(parent_sess, &hw_res, 0);
+	async_hangup(parent_sess);
+	if (ret != EOK) {
+		return ret;
+	}
+
+	/* We want one irq and one io range. */
+	if (hw_res.irqs.count != 1 || hw_res.io_ranges.count != 1) {
+		hw_res_list_parsed_clean(&hw_res);
+		return EINVAL;
+	}
+
+	if (io_reg_address)
+		*io_reg_address = hw_res.io_ranges.ranges[0].address;
+	if (io_reg_size)
+		*io_reg_size = hw_res.io_ranges.ranges[0].size;
+	if (irq_no)
+		*irq_no = hw_res.irqs.irqs[0];
+
+	hw_res_list_parsed_clean(&hw_res);
+	return EOK;
+}
+/*----------------------------------------------------------------------------*/
+/** Call the PCI driver with a request to enable interrupts
+ *
+ * @param[in] device Device asking for interrupts
+ * @return Error code.
+ */
+int enable_interrupts(const ddf_dev_t *device)
+{
+	async_sess_t *parent_sess =
+	    devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
+	    IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+
+	const bool enabled = hw_res_enable_interrupt(parent_sess);
+	async_hangup(parent_sess);
+
+	return enabled ? EOK : EIO;
+}
+/*----------------------------------------------------------------------------*/
+/** Call the PCI driver with a request to clear legacy support register
+ *
+ * @param[in] device Device asking to disable interrupts
+ * @return Error code.
+ */
+int disable_legacy(const ddf_dev_t *device)
+{
+	assert(device);
+
+	async_sess_t *parent_sess = devman_parent_device_connect(
+	    EXCHANGE_SERIALIZE, device->handle, IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+
+	/* See UHCI design guide page 45 for these values.
+	 * Write all WC bits in USB legacy register */
+	const int rc = pci_config_space_write_16(parent_sess, 0xc0, 0xaf00);
+
+	async_hangup(parent_sess);
+	return rc;
+}
+
+/**
+ * @}
+ */
Index: uspace/drv/bus/usb/uhci/res.h
===================================================================
--- uspace/drv/bus/usb/uhci/res.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
+++ uspace/drv/bus/usb/uhci/res.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2010 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup drvusbuhcihc
+ * @{
+ */
+/** @file
+ * @brief UHCI driver PCI helper functions
+ */
+#ifndef DRV_UHCI_PCI_H
+#define DRV_UHCI_PCI_H
+
+#include <ddf/driver.h>
+
+int get_my_registers(const ddf_dev_t *, uintptr_t *, size_t *, int *);
+int enable_interrupts(const ddf_dev_t *);
+int disable_legacy(const ddf_dev_t *);
+
+#endif
+/**
+ * @}
+ */
+
Index: uspace/drv/bus/usb/uhci/uhci.c
===================================================================
--- uspace/drv/bus/usb/uhci/uhci.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/drv/bus/usb/uhci/uhci.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -41,6 +41,6 @@
 
 #include "uhci.h"
-#include "pci.h"
-
+
+#include "res.h"
 #include "hc.h"
 #include "root_hub.h"
@@ -49,12 +49,12 @@
  * and USB root hub */
 typedef struct uhci {
-	/** Pointer to DDF represenation of UHCI host controller */
+	/** Pointer to DDF representation of UHCI host controller */
 	ddf_fun_t *hc_fun;
-	/** Pointer to DDF represenation of UHCI root hub */
+	/** Pointer to DDF representation of UHCI root hub */
 	ddf_fun_t *rh_fun;
 
-	/** Internal driver's represenation of UHCI host controller */
+	/** Internal driver's representation of UHCI host controller */
 	hc_t hc;
-	/** Internal driver's represenation of UHCI root hub */
+	/** Internal driver's representation of UHCI root hub */
 	rh_t rh;
 } uhci_t;
@@ -187,5 +187,5 @@
 	int irq = 0;
 
-	ret = pci_get_my_registers(device, &reg_base, &reg_size, &irq);
+	ret = get_my_registers(device, &reg_base, &reg_size, &irq);
 	CHECK_RET_DEST_FREE_RETURN(ret,
 	    "Failed to get I/O addresses for %" PRIun ": %s.\n",
@@ -194,5 +194,5 @@
 	    (void *) reg_base, reg_size, irq);
 
-	ret = pci_disable_legacy(device);
+	ret = disable_legacy(device);
 	CHECK_RET_DEST_FREE_RETURN(ret,
 	    "Failed to disable legacy USB: %s.\n", str_error(ret));
@@ -220,5 +220,5 @@
 
 	bool interrupts = false;
-	ret = pci_enable_interrupts(device);
+	ret = enable_interrupts(device);
 	if (ret != EOK) {
 		usb_log_warning("Failed to enable interrupts: %s."
Index: uspace/lib/c/arch/arm32/src/eabi.S
===================================================================
--- uspace/lib/c/arch/arm32/src/eabi.S	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/c/arch/arm32/src/eabi.S	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -1,4 +1,4 @@
 #
-# Copyright (c) 2007 Pavel Jancik
+# Copyright (c) 2012 Martin Decky
 # All rights reserved.
 #
@@ -31,5 +31,64 @@
 .global __aeabi_read_tp
 
+.global __aeabi_idiv
+.global __aeabi_uidiv
+
+.global __aeabi_idivmod
+.global __aeabi_uidivmod
+
+.global __aeabi_ldivmod
+.global __aeabi_uldivmod
+
 __aeabi_read_tp:
 	mov r0, r9
 	mov pc, lr
+
+__aeabi_idiv:
+	push {sp, lr}
+	bl __divsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	bx lr
+
+__aeabi_uidiv:
+	push {sp, lr}
+	bl __udivsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	bx lr
+
+__aeabi_idivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __divmodsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r1, r2}
+	bx lr
+
+__aeabi_uidivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __udivmodsi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r1, r2}
+	bx lr
+
+__aeabi_ldivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __divmoddi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r2, r3}
+	bx lr
+
+__aeabi_uldivmod:
+	sub sp, sp, #8
+	push {sp, lr}
+	bl __udivmoddi3
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	pop {r2, r3}
+	bx lr
Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/c/generic/str.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -46,4 +46,11 @@
 #include <mem.h>
 #include <str.h>
+
+/** Check the condition if wchar_t is signed */
+#ifdef WCHAR_IS_UNSIGNED
+	#define WCHAR_SIGNED_CHECK(cond)  (true)
+#else
+	#define WCHAR_SIGNED_CHECK(cond)  (cond)
+#endif
 
 /** Byte mask consisting of lowest @n bits (out of 8) */
@@ -399,5 +406,5 @@
 bool ascii_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 127))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
 		return true;
 	
@@ -412,5 +419,5 @@
 bool chr_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 1114111))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
 		return true;
 	
@@ -513,4 +520,5 @@
  * @param count Size of the destination buffer (must be > 0).
  * @param src   Source string.
+ *
  */
 void str_cpy(char *dest, size_t size, const char *src)
@@ -545,4 +553,5 @@
  * @param src   Source string.
  * @param n     Maximum number of bytes to read from @a src.
+ *
  */
 void str_ncpy(char *dest, size_t size, const char *src, size_t n)
Index: uspace/lib/softfloat/Makefile
===================================================================
--- uspace/lib/softfloat/Makefile	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/Makefile	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -29,5 +29,5 @@
 
 USPACE_PREFIX = ../..
-EXTRA_CFLAGS = -Iinclude -Iarch/$(UARCH)/include/
+EXTRA_CFLAGS = -Iinclude
 LIBRARY = libsoftfloat
 
Index: pace/lib/softfloat/arch/abs32le/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/abs32le/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloatabs32le abs32le
- * @ingroup sfl
- * @brief softfloat architecture dependent definitions
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int32(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int32(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int32(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint32(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint32(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint32(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int32_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int32_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int32_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint32_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint32_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint32_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
-/** @}
- */
Index: pace/lib/softfloat/arch/amd64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/amd64/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloatamd64 amd64	
- * @ingroup sfl 
- * @brief softfloat architecture dependent definitions 
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int64(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int64(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int64(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint64(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint64(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint64(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int64_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int64_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int64_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint64_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint64_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint64_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
-/** @}
- */
Index: pace/lib/softfloat/arch/arm32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/arm32/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloatarm32 arm32	
- * @ingroup sfl
- * @brief Softfloat architecture dependent definitions.
- * @{
- */
-/** @file 
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int32(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int32(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int32(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint32(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint32(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint32(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int32_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int32_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int32_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint32_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint32_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint32_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
-/** @}
- */
Index: pace/lib/softfloat/arch/ia32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/ia32/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloatia32 ia32	
- * @ingroup sfl
- * @brief softfloat architecture dependent definitions 
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int32(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int32(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int32(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint32(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint32(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint32(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int32_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int32_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int32_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint32_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint32_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint32_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
-/** @}
- */
Index: pace/lib/softfloat/arch/ia64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/ia64/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
- /** @addtogroup softfloatia64 ia64
- * @ingroup sfl 
- * @brief softfloat architecture dependent definitions 
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int64(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int64(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int64(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint64(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint64(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint64(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int64_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int64_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int64_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint64_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint64_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint64_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
- /** @}
- */
Index: pace/lib/softfloat/arch/mips32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/mips32/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloatmips32 mips32
- * @ingroup sfl
- * @brief softfloat architecture dependent definitions 
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int32(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int32(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int32(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint32(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint32(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint32(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int32_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int32_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int32_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint32_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint32_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint32_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
-/** @}
- */
Index: pace/lib/softfloat/arch/mips32eb/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/mips32eb/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
- /** @addtogroup softfloatmipseb32 mipseb32	
- * @ingroup sfl
- * @brief softfloat architecture dependent definitions 
- * * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int32(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int32(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int32(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint32(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint32(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint32(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int32_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int32_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int32_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint32_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint32_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint32_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
- /** @}
- */
Index: pace/lib/softfloat/arch/mips64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/mips64/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloatmips64 mips64
- * @ingroup sfl
- * @brief softfloat architecture dependent definitions
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int64(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int64(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int64(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint64(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint64(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint64(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int64_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int64_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int64_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint64_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint64_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint64_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
-/** @}
- */
Index: pace/lib/softfloat/arch/ppc32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/ppc32/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
- /** @addtogroup softfloatppc32 ppc32	
- * @ingroup sfl
- * @brief softfloat architecture dependent definitions 
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int32(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int32(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int32(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint32(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint32(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint32(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int32_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int32_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int32_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint32_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint32_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint32_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
- /** @}
- */
Index: pace/lib/softfloat/arch/sparc64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/sparc64/include/functions.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
- /** @addtogroup softfloatsparc64 sparc64	
- * @ingroup sfl
- * @brief softfloat architecture dependent definitions 
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTFLOAT_FUNCTIONS_H__
-#define __SOFTFLOAT_FUNCTIONS_H__
-
-#define SPARC_SOFTFLOAT
-
-#define float32_to_int(X) float32_to_int32(X);
-#define float32_to_long(X) float32_to_int64(X);
-#define float32_to_longlong(X) float32_to_int64(X);
-
-#define float64_to_int(X) float64_to_int32(X);
-#define float64_to_long(X) float64_to_int64(X);
-#define float64_to_longlong(X) float64_to_int64(X);
-
-#define float128_to_int(X) float128_to_int32(X);
-#define float128_to_long(X) float128_to_int64(X);
-#define float128_to_longlong(X) float128_to_int64(X);
-
-#define float32_to_uint(X) float32_to_uint32(X);
-#define float32_to_ulong(X) float32_to_uint64(X);
-#define float32_to_ulonglong(X) float32_to_uint64(X);
-
-#define float64_to_uint(X) float64_to_uint32(X);
-#define float64_to_ulong(X) float64_to_uint64(X);
-#define float64_to_ulonglong(X) float64_to_uint64(X);
-
-#define float128_to_uint(X) float128_to_uint32(X);
-#define float128_to_ulong(X) float128_to_uint64(X);
-#define float128_to_ulonglong(X) float128_to_uint64(X);
-
-#define int_to_float32(X) int32_to_float32(X);
-#define long_to_float32(X) int64_to_float32(X);
-#define longlong_to_float32(X) int64_to_float32(X);
-
-#define int_to_float64(X) int32_to_float64(X);
-#define long_to_float64(X) int64_to_float64(X);
-#define longlong_to_float64(X) int64_to_float64(X);
-
-#define int_to_float128(X) int32_to_float128(X);
-#define long_to_float128(X) int64_to_float128(X);
-#define longlong_to_float128(X) int64_to_float128(X);
-
-#define uint_to_float32(X) uint32_to_float32(X);
-#define ulong_to_float32(X) uint64_to_float32(X);
-#define ulonglong_to_float32(X) uint64_to_float32(X);
-
-#define uint_to_float64(X) uint32_to_float64(X);
-#define ulong_to_float64(X) uint64_to_float64(X);
-#define ulonglong_to_float64(X) uint64_to_float64(X);
-
-#define uint_to_float128(X) uint32_to_float128(X);
-#define ulong_to_float128(X) uint64_to_float128(X);
-#define ulonglong_to_float128(X) uint64_to_float128(X);
-
-#endif
-
- /** @}
- */
Index: uspace/lib/softfloat/generic/add.c
===================================================================
--- uspace/lib/softfloat/generic/add.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/add.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -39,6 +39,5 @@
 #include <common.h>
 
-/**
- * Add two single-precision floats with the same signs.
+/** Add two single-precision floats with the same sign.
  *
  * @param a First input operand.
@@ -46,5 +45,5 @@
  * @return Result of addition.
  */
-float32 addFloat32(float32 a, float32 b)
+float32 add_float32(float32 a, float32 b)
 {
 	int expdiff;
@@ -53,7 +52,7 @@
 	expdiff = a.parts.exp - b.parts.exp;
 	if (expdiff < 0) {
-		if (isFloat32NaN(b)) {
-			/* TODO: fix SigNaN */
-			if (isFloat32SigNaN(b)) {
+		if (is_float32_nan(b)) {
+			/* TODO: fix SigNaN */
+			if (is_float32_signan(b)) {
 			}
 
@@ -71,9 +70,9 @@
 		expdiff *= -1;
 	} else {
-		if ((isFloat32NaN(a)) || (isFloat32NaN(b))) {
-			/* TODO: fix SigNaN */
-			if (isFloat32SigNaN(a) || isFloat32SigNaN(b)) {
-			}
-			return (isFloat32NaN(a) ? a : b);
+		if ((is_float32_nan(a)) || (is_float32_nan(b))) {
+			/* TODO: fix SigNaN */
+			if (is_float32_signan(a) || is_float32_signan(b)) {
+			}
+			return (is_float32_nan(a) ? a : b);
 		}
 		
@@ -150,6 +149,5 @@
 }
 
-/**
- * Add two double-precision floats with the same signs.
+/** Add two double-precision floats with the same sign.
  *
  * @param a First input operand.
@@ -157,5 +155,5 @@
  * @return Result of addition.
  */
-float64 addFloat64(float64 a, float64 b)
+float64 add_float64(float64 a, float64 b)
 {
 	int expdiff;
@@ -165,14 +163,14 @@
 	expdiff = ((int) a.parts.exp) - b.parts.exp;
 	if (expdiff < 0) {
-		if (isFloat64NaN(b)) {
-			/* TODO: fix SigNaN */
-			if (isFloat64SigNaN(b)) {
-			}
-
-			return b;
-		}
-		
-		/* b is infinity and a not */	
-		if (b.parts.exp == FLOAT64_MAX_EXPONENT) { 
+		if (is_float64_nan(b)) {
+			/* TODO: fix SigNaN */
+			if (is_float64_signan(b)) {
+			}
+
+			return b;
+		}
+		
+		/* b is infinity and a not */
+		if (b.parts.exp == FLOAT64_MAX_EXPONENT) {
 			return b;
 		}
@@ -184,7 +182,7 @@
 		expdiff *= -1;
 	} else {
-		if (isFloat64NaN(a)) {
-			/* TODO: fix SigNaN */
-			if (isFloat64SigNaN(a) || isFloat64SigNaN(b)) {
+		if (is_float64_nan(a)) {
+			/* TODO: fix SigNaN */
+			if (is_float64_signan(a) || is_float64_signan(b)) {
 			}
 			return a;
@@ -265,6 +263,5 @@
 }
 
-/**
- * Add two quadruple-precision floats with the same signs.
+/** Add two quadruple-precision floats with the same sign.
  *
  * @param a First input operand.
@@ -272,5 +269,5 @@
  * @return Result of addition.
  */
-float128 addFloat128(float128 a, float128 b)
+float128 add_float128(float128 a, float128 b)
 {
 	int expdiff;
@@ -280,7 +277,7 @@
 	expdiff = ((int) a.parts.exp) - b.parts.exp;
 	if (expdiff < 0) {
-		if (isFloat128NaN(b)) {
-			/* TODO: fix SigNaN */
-			if (isFloat128SigNaN(b)) {
+		if (is_float128_nan(b)) {
+			/* TODO: fix SigNaN */
+			if (is_float128_signan(b)) {
 			}
 
@@ -301,7 +298,7 @@
 		expdiff *= -1;
 	} else {
-		if (isFloat128NaN(a)) {
-			/* TODO: fix SigNaN */
-			if (isFloat128SigNaN(a) || isFloat128SigNaN(b)) {
+		if (is_float128_nan(a)) {
+			/* TODO: fix SigNaN */
+			if (is_float128_signan(a) || is_float128_signan(b)) {
 			}
 			return a;
Index: uspace/lib/softfloat/generic/common.c
===================================================================
--- uspace/lib/softfloat/generic/common.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/common.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -66,5 +66,5 @@
  * @return Finished double-precision float.
  */
-float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign)
+float64 finish_float64(int32_t cexp, uint64_t cfrac, char sign)
 {
 	float64 result;
@@ -140,5 +140,5 @@
  * @return Finished quadruple-precision float.
  */
-float128 finishFloat128(int32_t cexp, uint64_t cfrac_hi, uint64_t cfrac_lo, 
+float128 finish_float128(int32_t cexp, uint64_t cfrac_hi, uint64_t cfrac_lo, 
     char sign, uint64_t shift_out)
 {
@@ -238,5 +238,5 @@
  * @return Number of detected leading zeroes.
  */
-int countZeroes8(uint8_t i)
+int count_zeroes8(uint8_t i)
 {
 	return zeroTable[i];
@@ -249,10 +249,10 @@
  * @return Number of detected leading zeroes.
  */
-int countZeroes32(uint32_t i)
+int count_zeroes32(uint32_t i)
 {
 	int j;
 	for (j = 0; j < 32; j += 8) {
 		if (i & (0xFF << (24 - j))) {
-			return (j + countZeroes8(i >> (24 - j)));
+			return (j + count_zeroes8(i >> (24 - j)));
 		}
 	}
@@ -267,10 +267,10 @@
  * @return Number of detected leading zeroes.
  */
-int countZeroes64(uint64_t i)
+int count_zeroes64(uint64_t i)
 {
 	int j;
 	for (j = 0; j < 64; j += 8) {
 		if (i & (0xFFll << (56 - j))) {
-			return (j + countZeroes8(i >> (56 - j)));
+			return (j + count_zeroes8(i >> (56 - j)));
 		}
 	}
@@ -286,5 +286,5 @@
  * @param fraction Fraction with hidden bit shifted to 30th bit.
  */
-void roundFloat32(int32_t *exp, uint32_t *fraction)
+void round_float32(int32_t *exp, uint32_t *fraction)
 {
 	/* rounding - if first bit after fraction is set then round up */
@@ -312,5 +312,5 @@
  * @param fraction Fraction with hidden bit shifted to 62nd bit.
  */
-void roundFloat64(int32_t *exp, uint64_t *fraction)
+void round_float64(int32_t *exp, uint64_t *fraction)
 {
 	/* rounding - if first bit after fraction is set then round up */
@@ -339,5 +339,5 @@
  * @param frac_lo Low part of fraction part with hidden bit shifted to 126th bit.
  */
-void roundFloat128(int32_t *exp, uint64_t *frac_hi, uint64_t *frac_lo)
+void round_float128(int32_t *exp, uint64_t *frac_hi, uint64_t *frac_lo)
 {
 	uint64_t tmp_hi, tmp_lo;
Index: uspace/lib/softfloat/generic/comparison.c
===================================================================
--- uspace/lib/softfloat/generic/comparison.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/comparison.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -45,5 +45,5 @@
  * @return 1 if float is NaN, 0 otherwise.
  */
-int isFloat32NaN(float32 f)
+int is_float32_nan(float32 f)
 {
 	/* NaN : exp = 0xff and nonzero fraction */
@@ -58,5 +58,5 @@
  * @return 1 if float is NaN, 0 otherwise.
  */
-int isFloat64NaN(float64 d)
+int is_float64_nan(float64 d)
 {
 	/* NaN : exp = 0x7ff and nonzero fraction */
@@ -71,5 +71,5 @@
  * @return 1 if float is NaN, 0 otherwise.
  */
-int isFloat128NaN(float128 ld)
+int is_float128_nan(float128 ld)
 {
 	/* NaN : exp = 0x7fff and nonzero fraction */
@@ -84,5 +84,5 @@
  * @return 1 if float is signalling NaN, 0 otherwise.
  */
-int isFloat32SigNaN(float32 f)
+int is_float32_signan(float32 f)
 {
 	/* SigNaN : exp = 0xff and fraction = 0xxxxx..x (binary),
@@ -98,5 +98,5 @@
  * @return 1 if float is signalling NaN, 0 otherwise.
  */
-int isFloat64SigNaN(float64 d)
+int is_float64_signan(float64 d)
 {
 	/* SigNaN : exp = 0x7ff and fraction = 0xxxxx..x (binary),
@@ -112,5 +112,5 @@
  * @return 1 if float is signalling NaN, 0 otherwise.
  */
-int isFloat128SigNaN(float128 ld)
+int is_float128_signan(float128 ld)
 {
 	/* SigNaN : exp = 0x7fff and fraction = 0xxxxx..x (binary),
@@ -128,5 +128,5 @@
  * @return 1 if float is infinite, 0 otherwise.
  */
-int isFloat32Infinity(float32 f)
+int is_float32_infinity(float32 f)
 {
 	/* NaN : exp = 0x7ff and zero fraction */
@@ -140,5 +140,5 @@
  * @return 1 if float is infinite, 0 otherwise.
  */
-int isFloat64Infinity(float64 d) 
+int is_float64_infinity(float64 d)
 {
 	/* NaN : exp = 0x7ff and zero fraction */
@@ -152,5 +152,5 @@
  * @return 1 if float is infinite, 0 otherwise.
  */
-int isFloat128Infinity(float128 ld)
+int is_float128_infinity(float128 ld)
 {
 	/* NaN : exp = 0x7fff and zero fraction */
@@ -165,7 +165,7 @@
  * @return 1 if float is zero, 0 otherwise.
  */
-int isFloat32Zero(float32 f)
-{
-	return (((f.binary) & 0x7FFFFFFF) == 0);
+int is_float32_zero(float32 f)
+{
+	return (((f.bin) & 0x7FFFFFFF) == 0);
 }
 
@@ -176,7 +176,7 @@
  * @return 1 if float is zero, 0 otherwise.
  */
-int isFloat64Zero(float64 d)
-{
-	return (((d.binary) & 0x7FFFFFFFFFFFFFFFll) == 0);
+int is_float64_zero(float64 d)
+{
+	return (((d.bin) & 0x7FFFFFFFFFFFFFFFll) == 0);
 }
 
@@ -187,12 +187,12 @@
  * @return 1 if float is zero, 0 otherwise.
  */
-int isFloat128Zero(float128 ld)
+int is_float128_zero(float128 ld)
 {
 	uint64_t tmp_hi;
 	uint64_t tmp_lo;
-
-	and128(ld.binary.hi, ld.binary.lo,
+	
+	and128(ld.bin.hi, ld.bin.lo,
 	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
-
+	
 	return eq128(tmp_hi, tmp_lo, 0x0ll, 0x0ll);
 }
@@ -205,9 +205,9 @@
  * @return 1 if both floats are equal, 0 otherwise.
  */
-int isFloat32eq(float32 a, float32 b)
+int is_float32_eq(float32 a, float32 b)
 {
 	/* a equals to b or both are zeros (with any sign) */
-	return ((a.binary == b.binary) ||
-	    (((a.binary | b.binary) & 0x7FFFFFFF) == 0));
+	return ((a.bin == b.bin) ||
+	    (((a.bin | b.bin) & 0x7FFFFFFF) == 0));
 }
 
@@ -219,9 +219,9 @@
  * @return 1 if both floats are equal, 0 otherwise.
  */
-int isFloat64eq(float64 a, float64 b)
+int is_float64_eq(float64 a, float64 b)
 {
 	/* a equals to b or both are zeros (with any sign) */
-	return ((a.binary == b.binary) ||
-	    (((a.binary | b.binary) & 0x7FFFFFFFFFFFFFFFll) == 0));
+	return ((a.bin == b.bin) ||
+	    (((a.bin | b.bin) & 0x7FFFFFFFFFFFFFFFll) == 0));
 }
 
@@ -233,12 +233,12 @@
  * @return 1 if both floats are equal, 0 otherwise.
  */
-int isFloat128eq(float128 a, float128 b)
+int is_float128_eq(float128 a, float128 b)
 {
 	uint64_t tmp_hi;
 	uint64_t tmp_lo;
-
+	
 	/* both are zeros (with any sign) */
-	or128(a.binary.hi, a.binary.lo,
-	    b.binary.hi, b.binary.lo, &tmp_hi, &tmp_lo);
+	or128(a.bin.hi, a.bin.lo,
+	    b.bin.hi, b.bin.lo, &tmp_hi, &tmp_lo);
 	and128(tmp_hi, tmp_lo,
 	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
@@ -246,6 +246,6 @@
 	
 	/* a equals to b */
-	int are_equal = eq128(a.binary.hi, a.binary.lo, b.binary.hi, b.binary.lo);
-
+	int are_equal = eq128(a.bin.hi, a.bin.lo, b.bin.hi, b.bin.lo);
+	
 	return are_equal || both_zero;
 }
@@ -258,20 +258,24 @@
  * @return 1 if a is lower than b, 0 otherwise.
  */
-int isFloat32lt(float32 a, float32 b) 
-{
-	if (((a.binary | b.binary) & 0x7FFFFFFF) == 0) {
-		return 0; /* +- zeroes */
+int is_float32_lt(float32 a, float32 b) 
+{
+	if (((a.bin | b.bin) & 0x7FFFFFFF) == 0) {
+		/* +- zeroes */
+		return 0;
 	}
 	
 	if ((a.parts.sign) && (b.parts.sign)) {
 		/* if both are negative, smaller is that with greater binary value */
-		return (a.binary > b.binary);
-	}
-	
-	/* lets negate signs - now will be positive numbers allways bigger than
-	 * negative (first bit will be set for unsigned integer comparison) */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.binary < b.binary);
+		return (a.bin > b.bin);
+	}
+	
+	/*
+	 * lets negate signs - now will be positive numbers always
+	 * bigger than negative (first bit will be set for unsigned
+	 * integer comparison)
+	 */
+	a.parts.sign = !a.parts.sign;
+	b.parts.sign = !b.parts.sign;
+	return (a.bin < b.bin);
 }
 
@@ -283,20 +287,24 @@
  * @return 1 if a is lower than b, 0 otherwise.
  */
-int isFloat64lt(float64 a, float64 b)
-{
-	if (((a.binary | b.binary) & 0x7FFFFFFFFFFFFFFFll) == 0) {
-		return 0; /* +- zeroes */
-	}
-
+int is_float64_lt(float64 a, float64 b)
+{
+	if (((a.bin | b.bin) & 0x7FFFFFFFFFFFFFFFll) == 0) {
+		/* +- zeroes */
+		return 0;
+	}
+	
 	if ((a.parts.sign) && (b.parts.sign)) {
 		/* if both are negative, smaller is that with greater binary value */
-		return (a.binary > b.binary);
-	}
-
-	/* lets negate signs - now will be positive numbers allways bigger than
-	 * negative (first bit will be set for unsigned integer comparison) */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.binary < b.binary);
+		return (a.bin > b.bin);
+	}
+	
+	/*
+	 * lets negate signs - now will be positive numbers always
+	 * bigger than negative (first bit will be set for unsigned
+	 * integer comparison)
+	 */
+	a.parts.sign = !a.parts.sign;
+	b.parts.sign = !b.parts.sign;
+	return (a.bin < b.bin);
 }
 
@@ -308,27 +316,31 @@
  * @return 1 if a is lower than b, 0 otherwise.
  */
-int isFloat128lt(float128 a, float128 b)
+int is_float128_lt(float128 a, float128 b)
 {
 	uint64_t tmp_hi;
 	uint64_t tmp_lo;
-
-	or128(a.binary.hi, a.binary.lo,
-	    b.binary.hi, b.binary.lo, &tmp_hi, &tmp_lo);
+	
+	or128(a.bin.hi, a.bin.lo,
+	    b.bin.hi, b.bin.lo, &tmp_hi, &tmp_lo);
 	and128(tmp_hi, tmp_lo,
 	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
 	if (eq128(tmp_hi, tmp_lo, 0x0ll, 0x0ll)) {
-		return 0; /* +- zeroes */
-	}
-
+		/* +- zeroes */
+		return 0;
+	}
+	
 	if ((a.parts.sign) && (b.parts.sign)) {
 		/* if both are negative, smaller is that with greater binary value */
-		return lt128(b.binary.hi, b.binary.lo, a.binary.hi, a.binary.lo);
-	}
-
-	/* lets negate signs - now will be positive numbers allways bigger than
-	 * negative (first bit will be set for unsigned integer comparison) */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return lt128(a.binary.hi, a.binary.lo, b.binary.hi, b.binary.lo);
+		return lt128(b.bin.hi, b.bin.lo, a.bin.hi, a.bin.lo);
+	}
+	
+	/*
+	 * lets negate signs - now will be positive numbers always
+	 * bigger than negative (first bit will be set for unsigned
+	 * integer comparison)
+	 */
+	a.parts.sign = !a.parts.sign;
+	b.parts.sign = !b.parts.sign;
+	return lt128(a.bin.hi, a.bin.lo, b.bin.hi, b.bin.lo);
 }
 
@@ -340,20 +352,24 @@
  * @return 1 if a is greater than b, 0 otherwise.
  */
-int isFloat32gt(float32 a, float32 b) 
-{
-	if (((a.binary | b.binary) & 0x7FFFFFFF) == 0) {
-		return 0; /* zeroes are equal with any sign */
+int is_float32_gt(float32 a, float32 b) 
+{
+	if (((a.bin | b.bin) & 0x7FFFFFFF) == 0) {
+		/* zeroes are equal with any sign */
+		return 0;
 	}
 	
 	if ((a.parts.sign) && (b.parts.sign)) {
 		/* if both are negative, greater is that with smaller binary value */
-		return (a.binary < b.binary);
-	}
-	
-	/* lets negate signs - now will be positive numbers allways bigger than
-	 *  negative (first bit will be set for unsigned integer comparison) */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.binary > b.binary);
+		return (a.bin < b.bin);
+	}
+	
+	/*
+	 * lets negate signs - now will be positive numbers always
+	 * bigger than negative (first bit will be set for unsigned
+	 * integer comparison)
+	 */
+	a.parts.sign = !a.parts.sign;
+	b.parts.sign = !b.parts.sign;
+	return (a.bin > b.bin);
 }
 
@@ -365,20 +381,24 @@
  * @return 1 if a is greater than b, 0 otherwise.
  */
-int isFloat64gt(float64 a, float64 b)
-{
-	if (((a.binary | b.binary) & 0x7FFFFFFFFFFFFFFFll) == 0) {
-		return 0; /* zeroes are equal with any sign */
-	}
-
+int is_float64_gt(float64 a, float64 b)
+{
+	if (((a.bin | b.bin) & 0x7FFFFFFFFFFFFFFFll) == 0) {
+		/* zeroes are equal with any sign */
+		return 0;
+	}
+	
 	if ((a.parts.sign) && (b.parts.sign)) {
 		/* if both are negative, greater is that with smaller binary value */
-		return (a.binary < b.binary);
-	}
-
-	/* lets negate signs - now will be positive numbers allways bigger than
-	 *  negative (first bit will be set for unsigned integer comparison) */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.binary > b.binary);
+		return (a.bin < b.bin);
+	}
+	
+	/*
+	 * lets negate signs - now will be positive numbers always
+	 * bigger than negative (first bit will be set for unsigned
+	 * integer comparison)
+	 */
+	a.parts.sign = !a.parts.sign;
+	b.parts.sign = !b.parts.sign;
+	return (a.bin > b.bin);
 }
 
@@ -390,27 +410,31 @@
  * @return 1 if a is greater than b, 0 otherwise.
  */
-int isFloat128gt(float128 a, float128 b)
+int is_float128_gt(float128 a, float128 b)
 {
 	uint64_t tmp_hi;
 	uint64_t tmp_lo;
-
-	or128(a.binary.hi, a.binary.lo,
-	    b.binary.hi, b.binary.lo, &tmp_hi, &tmp_lo);
+	
+	or128(a.bin.hi, a.bin.lo,
+	    b.bin.hi, b.bin.lo, &tmp_hi, &tmp_lo);
 	and128(tmp_hi, tmp_lo,
 	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
 	if (eq128(tmp_hi, tmp_lo, 0x0ll, 0x0ll)) {
-		return 0; /* zeroes are equal with any sign */
-	}
-
+		/* zeroes are equal with any sign */
+		return 0;
+	}
+	
 	if ((a.parts.sign) && (b.parts.sign)) {
 		/* if both are negative, greater is that with smaller binary value */
-		return lt128(a.binary.hi, a.binary.lo, b.binary.hi, b.binary.lo);
-	}
-
-	/* lets negate signs - now will be positive numbers allways bigger than
-	 *  negative (first bit will be set for unsigned integer comparison) */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return lt128(b.binary.hi, b.binary.lo, a.binary.hi, a.binary.lo);
+		return lt128(a.bin.hi, a.bin.lo, b.bin.hi, b.bin.lo);
+	}
+	
+	/*
+	 * lets negate signs - now will be positive numbers always
+	 * bigger than negative (first bit will be set for unsigned
+	 * integer comparison)
+	 */
+	a.parts.sign = !a.parts.sign;
+	b.parts.sign = !b.parts.sign;
+	return lt128(b.bin.hi, b.bin.lo, a.bin.hi, a.bin.lo);
 }
 
Index: uspace/lib/softfloat/generic/conversion.c
===================================================================
--- uspace/lib/softfloat/generic/conversion.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/conversion.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -39,5 +39,5 @@
 #include <common.h>
 
-float64 convertFloat32ToFloat64(float32 a) 
+float64 float32_to_float64(float32 a)
 {
 	float64 result;
@@ -48,7 +48,7 @@
 	result.parts.fraction <<= (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE);
 	
-	if ((isFloat32Infinity(a)) || (isFloat32NaN(a))) {
+	if ((is_float32_infinity(a)) || (is_float32_nan(a))) {
 		result.parts.exp = FLOAT64_MAX_EXPONENT;
-		/* TODO; check if its correct for SigNaNs*/
+		// TODO; check if its correct for SigNaNs
 		return result;
 	}
@@ -57,5 +57,5 @@
 	if (a.parts.exp == 0) {
 		/* normalize denormalized numbers */
-
+		
 		if (result.parts.fraction == 0) { /* fix zero */
 			result.parts.exp = 0;
@@ -77,10 +77,10 @@
 }
 
-float128 convertFloat32ToFloat128(float32 a)
+float128 float32_to_float128(float32 a)
 {
 	float128 result;
 	uint64_t frac_hi, frac_lo;
 	uint64_t tmp_hi, tmp_lo;
-
+	
 	result.parts.sign = a.parts.sign;
 	result.parts.frac_hi = 0;
@@ -91,15 +91,15 @@
 	result.parts.frac_hi = frac_hi;
 	result.parts.frac_lo = frac_lo;
-
-	if ((isFloat32Infinity(a)) || (isFloat32NaN(a))) {
+	
+	if ((is_float32_infinity(a)) || (is_float32_nan(a))) {
 		result.parts.exp = FLOAT128_MAX_EXPONENT;
-		/* TODO; check if its correct for SigNaNs*/
-		return result;
-	}
-
+		// TODO; check if its correct for SigNaNs
+		return result;
+	}
+	
 	result.parts.exp = a.parts.exp + ((int) FLOAT128_BIAS - FLOAT32_BIAS);
 	if (a.parts.exp == 0) {
 		/* normalize denormalized numbers */
-
+		
 		if (eq128(result.parts.frac_hi,
 		    result.parts.frac_lo, 0x0ll, 0x0ll)) { /* fix zero */
@@ -107,8 +107,8 @@
 			return result;
 		}
-
+		
 		frac_hi = result.parts.frac_hi;
 		frac_lo = result.parts.frac_lo;
-
+		
 		and128(frac_hi, frac_lo,
 		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
@@ -118,19 +118,19 @@
 			--result.parts.exp;
 		}
-
+		
 		++result.parts.exp;
 		result.parts.frac_hi = frac_hi;
 		result.parts.frac_lo = frac_lo;
 	}
-
-	return result;
-}
-
-float128 convertFloat64ToFloat128(float64 a)
+	
+	return result;
+}
+
+float128 float64_to_float128(float64 a)
 {
 	float128 result;
 	uint64_t frac_hi, frac_lo;
 	uint64_t tmp_hi, tmp_lo;
-
+	
 	result.parts.sign = a.parts.sign;
 	result.parts.frac_hi = 0;
@@ -141,15 +141,15 @@
 	result.parts.frac_hi = frac_hi;
 	result.parts.frac_lo = frac_lo;
-
-	if ((isFloat64Infinity(a)) || (isFloat64NaN(a))) {
+	
+	if ((is_float64_infinity(a)) || (is_float64_nan(a))) {
 		result.parts.exp = FLOAT128_MAX_EXPONENT;
-		/* TODO; check if its correct for SigNaNs*/
-		return result;
-	}
-
+		// TODO; check if its correct for SigNaNs
+		return result;
+	}
+	
 	result.parts.exp = a.parts.exp + ((int) FLOAT128_BIAS - FLOAT64_BIAS);
 	if (a.parts.exp == 0) {
 		/* normalize denormalized numbers */
-
+		
 		if (eq128(result.parts.frac_hi,
 		    result.parts.frac_lo, 0x0ll, 0x0ll)) { /* fix zero */
@@ -157,8 +157,8 @@
 			return result;
 		}
-
+		
 		frac_hi = result.parts.frac_hi;
 		frac_lo = result.parts.frac_lo;
-
+		
 		and128(frac_hi, frac_lo,
 		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
@@ -168,14 +168,14 @@
 			--result.parts.exp;
 		}
-
+		
 		++result.parts.exp;
 		result.parts.frac_hi = frac_hi;
 		result.parts.frac_lo = frac_lo;
 	}
-
-	return result;
-}
-
-float32 convertFloat64ToFloat32(float64 a) 
+	
+	return result;
+}
+
+float32 float64_to_float32(float64 a)
 {
 	float32 result;
@@ -185,24 +185,24 @@
 	result.parts.sign = a.parts.sign;
 	
-	if (isFloat64NaN(a)) {
+	if (is_float64_nan(a)) {
 		result.parts.exp = FLOAT32_MAX_EXPONENT;
 		
-		if (isFloat64SigNaN(a)) {
+		if (is_float64_signan(a)) {
 			/* set first bit of fraction nonzero */
 			result.parts.fraction = FLOAT32_HIDDEN_BIT_MASK >> 1;
 			return result;
 		}
-
+		
 		/* fraction nonzero but its first bit is zero */
 		result.parts.fraction = 0x1;
 		return result;
 	}
-
-	if (isFloat64Infinity(a)) {
+	
+	if (is_float64_infinity(a)) {
 		result.parts.fraction = 0;
 		result.parts.exp = FLOAT32_MAX_EXPONENT;
 		return result;
 	}
-
+	
 	exp = (int) a.parts.exp - FLOAT64_BIAS + FLOAT32_BIAS;
 	
@@ -239,5 +239,5 @@
 		return result;
 	}
-
+	
 	result.parts.exp = exp;
 	result.parts.fraction =
@@ -246,34 +246,34 @@
 }
 
-float32 convertFloat128ToFloat32(float128 a)
+float32 float128_to_float32(float128 a)
 {
 	float32 result;
 	int32_t exp;
 	uint64_t frac_hi, frac_lo;
-
+	
 	result.parts.sign = a.parts.sign;
-
-	if (isFloat128NaN(a)) {
+	
+	if (is_float128_nan(a)) {
 		result.parts.exp = FLOAT32_MAX_EXPONENT;
-
-		if (isFloat128SigNaN(a)) {
+		
+		if (is_float128_signan(a)) {
 			/* set first bit of fraction nonzero */
 			result.parts.fraction = FLOAT32_HIDDEN_BIT_MASK >> 1;
 			return result;
 		}
-
+		
 		/* fraction nonzero but its first bit is zero */
 		result.parts.fraction = 0x1;
 		return result;
 	}
-
-	if (isFloat128Infinity(a)) {
+	
+	if (is_float128_infinity(a)) {
 		result.parts.fraction = 0;
 		result.parts.exp = FLOAT32_MAX_EXPONENT;
 		return result;
 	}
-
+	
 	exp = (int) a.parts.exp - FLOAT128_BIAS + FLOAT32_BIAS;
-
+	
 	if (exp >= FLOAT32_MAX_EXPONENT) {
 		/* FIXME: overflow */
@@ -283,7 +283,7 @@
 	} else if (exp <= 0) {
 		/* underflow or denormalized */
-
+		
 		result.parts.exp = 0;
-
+		
 		exp *= -1;
 		if (exp > FLOAT32_FRACTION_SIZE) {
@@ -292,17 +292,17 @@
 			return result;
 		}
-
+		
 		/* denormalized */
-
+		
 		frac_hi = a.parts.frac_hi;
 		frac_lo = a.parts.frac_lo;
-
+		
 		/* denormalize and set hidden bit */
 		frac_hi |= FLOAT128_HIDDEN_BIT_MASK_HI;
-
+		
 		rshift128(frac_hi, frac_lo,
 		    (FLOAT128_FRACTION_SIZE - FLOAT32_FRACTION_SIZE + 1),
 		    &frac_hi, &frac_lo);
-
+		
 		while (exp > 0) {
 			--exp;
@@ -310,8 +310,8 @@
 		}
 		result.parts.fraction = frac_lo;
-
-		return result;
-	}
-
+		
+		return result;
+	}
+	
 	result.parts.exp = exp;
 	frac_hi = a.parts.frac_hi;
@@ -324,34 +324,34 @@
 }
 
-float64 convertFloat128ToFloat64(float128 a)
+float64 float128_to_float64(float128 a)
 {
 	float64 result;
 	int32_t exp;
 	uint64_t frac_hi, frac_lo;
-
+	
 	result.parts.sign = a.parts.sign;
-
-	if (isFloat128NaN(a)) {
+	
+	if (is_float128_nan(a)) {
 		result.parts.exp = FLOAT64_MAX_EXPONENT;
-
-		if (isFloat128SigNaN(a)) {
+		
+		if (is_float128_signan(a)) {
 			/* set first bit of fraction nonzero */
 			result.parts.fraction = FLOAT64_HIDDEN_BIT_MASK >> 1;
 			return result;
 		}
-
+		
 		/* fraction nonzero but its first bit is zero */
 		result.parts.fraction = 0x1;
 		return result;
 	}
-
-	if (isFloat128Infinity(a)) {
+	
+	if (is_float128_infinity(a)) {
 		result.parts.fraction = 0;
 		result.parts.exp = FLOAT64_MAX_EXPONENT;
 		return result;
 	}
-
+	
 	exp = (int) a.parts.exp - FLOAT128_BIAS + FLOAT64_BIAS;
-
+	
 	if (exp >= FLOAT64_MAX_EXPONENT) {
 		/* FIXME: overflow */
@@ -361,7 +361,7 @@
 	} else if (exp <= 0) {
 		/* underflow or denormalized */
-
+		
 		result.parts.exp = 0;
-
+		
 		exp *= -1;
 		if (exp > FLOAT64_FRACTION_SIZE) {
@@ -370,17 +370,17 @@
 			return result;
 		}
-
+		
 		/* denormalized */
-
+		
 		frac_hi = a.parts.frac_hi;
 		frac_lo = a.parts.frac_lo;
-
+		
 		/* denormalize and set hidden bit */
 		frac_hi |= FLOAT128_HIDDEN_BIT_MASK_HI;
-
+		
 		rshift128(frac_hi, frac_lo,
 		    (FLOAT128_FRACTION_SIZE - FLOAT64_FRACTION_SIZE + 1),
 		    &frac_hi, &frac_lo);
-
+		
 		while (exp > 0) {
 			--exp;
@@ -388,8 +388,8 @@
 		}
 		result.parts.fraction = frac_lo;
-
-		return result;
-	}
-
+		
+		return result;
+	}
+	
 	result.parts.exp = exp;
 	frac_hi = a.parts.frac_hi;
@@ -402,7 +402,5 @@
 }
 
-
-/** 
- * Helping procedure for converting float32 to uint32.
+/** Helper procedure for converting float32 to uint32.
  *
  * @param a Floating point number in normalized form
@@ -424,5 +422,5 @@
 	/* shift fraction to left so hidden bit will be the most significant bit */
 	frac <<= 32 - FLOAT32_FRACTION_SIZE - 1; 
-
+	
 	frac >>= 32 - (a.parts.exp - FLOAT32_BIAS) - 1;
 	if ((a.parts.sign == 1) && (frac != 0)) {
@@ -434,14 +432,14 @@
 }
 
-/* 
- * FIXME: Im not sure what to return if overflow/underflow happens 
- * 	- now its the biggest or the smallest int
- */ 
+/*
+ * FIXME: Im not sure what to return if overflow/underflow happens
+ *  - now its the biggest or the smallest int
+ */
 uint32_t float32_to_uint32(float32 a)
 {
-	if (isFloat32NaN(a))
+	if (is_float32_nan(a))
 		return UINT32_MAX;
 	
-	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
+	if (is_float32_infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
 		if (a.parts.sign)
 			return UINT32_MIN;
@@ -453,14 +451,14 @@
 }
 
-/* 
- * FIXME: Im not sure what to return if overflow/underflow happens 
- * 	- now its the biggest or the smallest int
- */ 
+/*
+ * FIXME: Im not sure what to return if overflow/underflow happens
+ *  - now its the biggest or the smallest int
+ */
 int32_t float32_to_int32(float32 a)
 {
-	if (isFloat32NaN(a))
+	if (is_float32_nan(a))
 		return INT32_MAX;
 	
-	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
+	if (is_float32_infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
 		if (a.parts.sign)
 			return INT32_MIN;
@@ -472,7 +470,5 @@
 }
 
-
-/**
- * Helping procedure for converting float32 to uint64.
+/** Helper procedure for converting float32 to uint64.
  *
  * @param a Floating point number in normalized form
@@ -483,16 +479,16 @@
 {
 	uint64_t frac;
-
+	
 	if (a.parts.exp < FLOAT32_BIAS) {
-		/*TODO: rounding*/
+		// TODO: rounding
 		return 0;
 	}
-
+	
 	frac = a.parts.fraction;
-
+	
 	frac |= FLOAT32_HIDDEN_BIT_MASK;
 	/* shift fraction to left so hidden bit will be the most significant bit */
 	frac <<= 64 - FLOAT32_FRACTION_SIZE - 1;
-
+	
 	frac >>= 64 - (a.parts.exp - FLOAT32_BIAS) - 1;
 	if ((a.parts.sign == 1) && (frac != 0)) {
@@ -500,50 +496,47 @@
 		++frac;
 	}
-
+	
 	return frac;
 }
 
-/* 
+/*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 uint64_t float32_to_uint64(float32 a)
 {
-	if (isFloat32NaN(a))
+	if (is_float32_nan(a))
 		return UINT64_MAX;
-
-
-	if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
+	
+	if (is_float32_infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
 		if (a.parts.sign)
 			return UINT64_MIN;
-
+		
 		return UINT64_MAX;
 	}
-
+	
 	return _float32_to_uint64_helper(a);
 }
 
-/* 
+/*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 int64_t float32_to_int64(float32 a)
 {
-	if (isFloat32NaN(a))
+	if (is_float32_nan(a))
 		return INT64_MAX;
-
-	if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
+	
+	if (is_float32_infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
 		if (a.parts.sign)
 			return INT64_MIN;
-
+		
 		return INT64_MAX;
 	}
-
+	
 	return _float32_to_uint64_helper(a);
 }
 
-
-/**
- * Helping procedure for converting float64 to uint64.
+/** Helper procedure for converting float64 to uint64.
  *
  * @param a Floating point number in normalized form
@@ -554,16 +547,16 @@
 {
 	uint64_t frac;
-
+	
 	if (a.parts.exp < FLOAT64_BIAS) {
-		/*TODO: rounding*/
+		// TODO: rounding
 		return 0;
 	}
-
+	
 	frac = a.parts.fraction;
-
+	
 	frac |= FLOAT64_HIDDEN_BIT_MASK;
 	/* shift fraction to left so hidden bit will be the most significant bit */
 	frac <<= 64 - FLOAT64_FRACTION_SIZE - 1;
-
+	
 	frac >>= 64 - (a.parts.exp - FLOAT64_BIAS) - 1;
 	if ((a.parts.sign == 1) && (frac != 0)) {
@@ -571,5 +564,5 @@
 		++frac;
 	}
-
+	
 	return frac;
 }
@@ -577,18 +570,18 @@
 /*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 uint32_t float64_to_uint32(float64 a)
 {
-	if (isFloat64NaN(a))
+	if (is_float64_nan(a))
 		return UINT32_MAX;
-
-	if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
+	
+	if (is_float64_infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
 		if (a.parts.sign)
 			return UINT32_MIN;
-
+		
 		return UINT32_MAX;
 	}
-
+	
 	return (uint32_t) _float64_to_uint64_helper(a);
 }
@@ -596,32 +589,31 @@
 /*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 int32_t float64_to_int32(float64 a)
 {
-	if (isFloat64NaN(a))
+	if (is_float64_nan(a))
 		return INT32_MAX;
-
-	if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
+	
+	if (is_float64_infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
 		if (a.parts.sign)
 			return INT32_MIN;
-
+		
 		return INT32_MAX;
 	}
-
+	
 	return (int32_t) _float64_to_uint64_helper(a);
 }
 
-
-/* 
+/*
  * FIXME: Im not sure what to return if overflow/underflow happens 
- * 	- now its the biggest or the smallest int
- */ 
+ *  - now its the biggest or the smallest int
+ */
 uint64_t float64_to_uint64(float64 a)
 {
-	if (isFloat64NaN(a))
+	if (is_float64_nan(a))
 		return UINT64_MAX;
 	
-	if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
+	if (is_float64_infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
 		if (a.parts.sign)
 			return UINT64_MIN;
@@ -633,14 +625,14 @@
 }
 
-/* 
+/*
  * FIXME: Im not sure what to return if overflow/underflow happens 
- * 	- now its the biggest or the smallest int
- */ 
+ *  - now its the biggest or the smallest int
+ */
 int64_t float64_to_int64(float64 a)
 {
-	if (isFloat64NaN(a))
+	if (is_float64_nan(a))
 		return INT64_MAX;
 	
-	if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
+	if (is_float64_infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
 		if (a.parts.sign)
 			return INT64_MIN;
@@ -652,7 +644,5 @@
 }
 
-
-/**
- * Helping procedure for converting float128 to uint64.
+/** Helper procedure for converting float128 to uint64.
  *
  * @param a Floating point number in normalized form
@@ -663,18 +653,18 @@
 {
 	uint64_t frac_hi, frac_lo;
-
+	
 	if (a.parts.exp < FLOAT128_BIAS) {
-		/*TODO: rounding*/
+		// TODO: rounding
 		return 0;
 	}
-
+	
 	frac_hi = a.parts.frac_hi;
 	frac_lo = a.parts.frac_lo;
-
+	
 	frac_hi |= FLOAT128_HIDDEN_BIT_MASK_HI;
 	/* shift fraction to left so hidden bit will be the most significant bit */
 	lshift128(frac_hi, frac_lo,
 	    (128 - FLOAT128_FRACTION_SIZE - 1), &frac_hi, &frac_lo);
-
+	
 	rshift128(frac_hi, frac_lo,
 	    (128 - (a.parts.exp - FLOAT128_BIAS) - 1), &frac_hi, &frac_lo);
@@ -683,5 +673,5 @@
 		add128(frac_hi, frac_lo, 0x0ll, 0x1ll, &frac_hi, &frac_lo);
 	}
-
+	
 	return frac_lo;
 }
@@ -689,18 +679,18 @@
 /*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 uint32_t float128_to_uint32(float128 a)
 {
-	if (isFloat128NaN(a))
+	if (is_float128_nan(a))
 		return UINT32_MAX;
-
-	if (isFloat128Infinity(a) || (a.parts.exp >= (32 + FLOAT128_BIAS))) {
+	
+	if (is_float128_infinity(a) || (a.parts.exp >= (32 + FLOAT128_BIAS))) {
 		if (a.parts.sign)
 			return UINT32_MIN;
-
+		
 		return UINT32_MAX;
 	}
-
+	
 	return (uint32_t) _float128_to_uint64_helper(a);
 }
@@ -708,38 +698,37 @@
 /*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 int32_t float128_to_int32(float128 a)
 {
-	if (isFloat128NaN(a))
+	if (is_float128_nan(a))
 		return INT32_MAX;
-
-	if (isFloat128Infinity(a) || (a.parts.exp >= (32 + FLOAT128_BIAS))) {
+	
+	if (is_float128_infinity(a) || (a.parts.exp >= (32 + FLOAT128_BIAS))) {
 		if (a.parts.sign)
 			return INT32_MIN;
-
+		
 		return INT32_MAX;
 	}
-
+	
 	return (int32_t) _float128_to_uint64_helper(a);
 }
 
-
 /*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 uint64_t float128_to_uint64(float128 a)
 {
-	if (isFloat128NaN(a))
+	if (is_float128_nan(a))
 		return UINT64_MAX;
-
-	if (isFloat128Infinity(a) || (a.parts.exp >= (64 + FLOAT128_BIAS))) {
+	
+	if (is_float128_infinity(a) || (a.parts.exp >= (64 + FLOAT128_BIAS))) {
 		if (a.parts.sign)
 			return UINT64_MIN;
-
+		
 		return UINT64_MAX;
 	}
-
+	
 	return _float128_to_uint64_helper(a);
 }
@@ -747,21 +736,20 @@
 /*
  * FIXME: Im not sure what to return if overflow/underflow happens
- * 	- now its the biggest or the smallest int
+ *  - now its the biggest or the smallest int
  */
 int64_t float128_to_int64(float128 a)
 {
-	if (isFloat128NaN(a))
+	if (is_float128_nan(a))
 		return INT64_MAX;
-
-	if (isFloat128Infinity(a) || (a.parts.exp >= (64 + FLOAT128_BIAS))) {
+	
+	if (is_float128_infinity(a) || (a.parts.exp >= (64 + FLOAT128_BIAS))) {
 		if (a.parts.sign)
 			return INT64_MIN;
-
+		
 		return INT64_MAX;
 	}
-
+	
 	return _float128_to_uint64_helper(a);
 }
-
 
 float32 uint32_to_float32(uint32_t i)
@@ -773,11 +761,11 @@
 	result.parts.sign = 0;
 	result.parts.fraction = 0;
-
-	counter = countZeroes32(i);
-
+	
+	counter = count_zeroes32(i);
+	
 	exp = FLOAT32_BIAS + 32 - counter - 1;
 	
 	if (counter == 32) {
-		result.binary = 0;
+		result.bin = 0;
 		return result;
 	}
@@ -788,30 +776,28 @@
 		i >>= 1;
 	}
-
-	roundFloat32(&exp, &i);
-
+	
+	round_float32(&exp, &i);
+	
 	result.parts.fraction = i >> (32 - FLOAT32_FRACTION_SIZE - 2);
 	result.parts.exp = exp;
-
-	return result;
-}
-
-float32 int32_to_float32(int32_t i) 
+	
+	return result;
+}
+
+float32 int32_to_float32(int32_t i)
 {
 	float32 result;
-
-	if (i < 0) {
+	
+	if (i < 0)
 		result = uint32_to_float32((uint32_t) (-i));
-	} else {
+	else
 		result = uint32_to_float32((uint32_t) i);
-	}
 	
 	result.parts.sign = i < 0;
-
- 	return result;
-}
-
-
-float32 uint64_to_float32(uint64_t i) 
+	
+	return result;
+}
+
+float32 uint64_to_float32(uint64_t i)
 {
 	int counter;
@@ -822,11 +808,11 @@
 	result.parts.sign = 0;
 	result.parts.fraction = 0;
-
-	counter = countZeroes64(i);
-
+	
+	counter = count_zeroes64(i);
+	
 	exp = FLOAT32_BIAS + 64 - counter - 1;
 	
 	if (counter == 64) {
-		result.binary = 0;
+		result.bin = 0;
 		return result;
 	}
@@ -840,6 +826,6 @@
 	
 	j = (uint32_t) i;
-	roundFloat32(&exp, &j);
-
+	round_float32(&exp, &j);
+	
 	result.parts.fraction = j >> (32 - FLOAT32_FRACTION_SIZE - 2);
 	result.parts.exp = exp;
@@ -847,17 +833,16 @@
 }
 
-float32 int64_to_float32(int64_t i) 
+float32 int64_to_float32(int64_t i)
 {
 	float32 result;
-
-	if (i < 0) {
+	
+	if (i < 0)
 		result = uint64_to_float32((uint64_t) (-i));
-	} else {
+	else
 		result = uint64_to_float32((uint64_t) i);
-	}
 	
 	result.parts.sign = i < 0;
-
- 	return result;
+	
+	return result;
 }
 
@@ -871,42 +856,41 @@
 	result.parts.sign = 0;
 	result.parts.fraction = 0;
-
-	counter = countZeroes32(i);
-
+	
+	counter = count_zeroes32(i);
+	
 	exp = FLOAT64_BIAS + 32 - counter - 1;
 	
 	if (counter == 32) {
-		result.binary = 0;
+		result.bin = 0;
 		return result;
 	}
 	
 	frac = i;
-	frac <<= counter + 32 - 1; 
-
-	roundFloat64(&exp, &frac);
-
+	frac <<= counter + 32 - 1;
+	
+	round_float64(&exp, &frac);
+	
 	result.parts.fraction = frac >> (64 - FLOAT64_FRACTION_SIZE - 2);
 	result.parts.exp = exp;
-
-	return result;
-}
-
-float64 int32_to_float64(int32_t i) 
+	
+	return result;
+}
+
+float64 int32_to_float64(int32_t i)
 {
 	float64 result;
-
-	if (i < 0) {
+	
+	if (i < 0)
 		result = uint32_to_float64((uint32_t) (-i));
-	} else {
+	else
 		result = uint32_to_float64((uint32_t) i);
-	}
 	
 	result.parts.sign = i < 0;
-
- 	return result;
-}
-
-
-float64 uint64_to_float64(uint64_t i) 
+	
+	return result;
+}
+
+
+float64 uint64_to_float64(uint64_t i)
 {
 	int counter;
@@ -916,11 +900,11 @@
 	result.parts.sign = 0;
 	result.parts.fraction = 0;
-
-	counter = countZeroes64(i);
-
+	
+	counter = count_zeroes64(i);
+	
 	exp = FLOAT64_BIAS + 64 - counter - 1;
 	
 	if (counter == 64) {
-		result.binary = 0;
+		result.bin = 0;
 		return result;
 	}
@@ -931,7 +915,7 @@
 		i >>= 1;
 	}
-
-	roundFloat64(&exp, &i);
-
+	
+	round_float64(&exp, &i);
+	
 	result.parts.fraction = i >> (64 - FLOAT64_FRACTION_SIZE - 2);
 	result.parts.exp = exp;
@@ -939,19 +923,17 @@
 }
 
-float64 int64_to_float64(int64_t i) 
+float64 int64_to_float64(int64_t i)
 {
 	float64 result;
-
-	if (i < 0) {
+	
+	if (i < 0)
 		result = uint64_to_float64((uint64_t) (-i));
-	} else {
+	else
 		result = uint64_to_float64((uint64_t) i);
-	}
 	
 	result.parts.sign = i < 0;
-
- 	return result;
-}
-
+	
+	return result;
+}
 
 float128 uint32_to_float128(uint32_t i)
@@ -961,25 +943,25 @@
 	float128 result;
 	uint64_t frac_hi, frac_lo;
-
+	
 	result.parts.sign = 0;
 	result.parts.frac_hi = 0;
 	result.parts.frac_lo = 0;
-
-	counter = countZeroes32(i);
-
+	
+	counter = count_zeroes32(i);
+	
 	exp = FLOAT128_BIAS + 32 - counter - 1;
-
+	
 	if (counter == 32) {
-		result.binary.hi = 0;
-		result.binary.lo = 0;
-		return result;
-	}
-
+		result.bin.hi = 0;
+		result.bin.lo = 0;
+		return result;
+	}
+	
 	frac_hi = 0;
 	frac_lo = i;
 	lshift128(frac_hi, frac_lo, (counter + 96 - 1), &frac_hi, &frac_lo);
-
-	roundFloat128(&exp, &frac_hi, &frac_lo);
-
+	
+	round_float128(&exp, &frac_hi, &frac_lo);
+	
 	rshift128(frac_hi, frac_lo,
 	    (128 - FLOAT128_FRACTION_SIZE - 2), &frac_hi, &frac_lo);
@@ -987,5 +969,5 @@
 	result.parts.frac_lo = frac_lo;
 	result.parts.exp = exp;
-
+	
 	return result;
 }
@@ -994,14 +976,13 @@
 {
 	float128 result;
-
-	if (i < 0) {
+	
+	if (i < 0)
 		result = uint32_to_float128((uint32_t) (-i));
-	} else {
+	else
 		result = uint32_to_float128((uint32_t) i);
-	}
-
+	
 	result.parts.sign = i < 0;
-
- 	return result;
+	
+	return result;
 }
 
@@ -1013,25 +994,25 @@
 	float128 result;
 	uint64_t frac_hi, frac_lo;
-
+	
 	result.parts.sign = 0;
 	result.parts.frac_hi = 0;
 	result.parts.frac_lo = 0;
-
-	counter = countZeroes64(i);
-
+	
+	counter = count_zeroes64(i);
+	
 	exp = FLOAT128_BIAS + 64 - counter - 1;
-
+	
 	if (counter == 64) {
-		result.binary.hi = 0;
-		result.binary.lo = 0;
-		return result;
-	}
-
+		result.bin.hi = 0;
+		result.bin.lo = 0;
+		return result;
+	}
+	
 	frac_hi = 0;
 	frac_lo = i;
 	lshift128(frac_hi, frac_lo, (counter + 64 - 1), &frac_hi, &frac_lo);
-
-	roundFloat128(&exp, &frac_hi, &frac_lo);
-
+	
+	round_float128(&exp, &frac_hi, &frac_lo);
+	
 	rshift128(frac_hi, frac_lo,
 	    (128 - FLOAT128_FRACTION_SIZE - 2), &frac_hi, &frac_lo);
@@ -1039,5 +1020,5 @@
 	result.parts.frac_lo = frac_lo;
 	result.parts.exp = exp;
-
+	
 	return result;
 }
@@ -1046,14 +1027,13 @@
 {
 	float128 result;
-
-	if (i < 0) {
+	
+	if (i < 0)
 		result = uint64_to_float128((uint64_t) (-i));
-	} else {
+	else
 		result = uint64_to_float128((uint64_t) i);
-	}
-
+	
 	result.parts.sign = i < 0;
-
- 	return result;
+	
+	return result;
 }
 
Index: uspace/lib/softfloat/generic/div.c
===================================================================
--- uspace/lib/softfloat/generic/div.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/div.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -41,12 +41,13 @@
 #include <common.h>
 
-/**
- * Divide two single-precision floats.
- * 
+/** Divide two single-precision floats.
+ *
  * @param a Nominator.
  * @param b Denominator.
+ *
  * @return Result of division.
- */
-float32 divFloat32(float32 a, float32 b) 
+ *
+ */
+float32 div_float32(float32 a, float32 b)
 {
 	float32 result;
@@ -56,24 +57,24 @@
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
 	
-	if (isFloat32NaN(a)) {
-		if (isFloat32SigNaN(a)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	if (is_float32_nan(a)) {
+		if (is_float32_signan(a)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return a;
 	}
 	
-	if (isFloat32NaN(b)) {
-		if (isFloat32SigNaN(b)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	if (is_float32_nan(b)) {
+		if (is_float32_signan(b)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return b;
 	}
 	
-	if (isFloat32Infinity(a)) {
-		if (isFloat32Infinity(b)) {
+	if (is_float32_infinity(a)) {
+		if (is_float32_infinity(b)) {
 			/*FIXME: inf / inf */
-			result.binary = FLOAT32_NAN;
+			result.bin = FLOAT32_NAN;
 			return result;
 		}
@@ -83,7 +84,7 @@
 		return result;
 	}
-
-	if (isFloat32Infinity(b)) {
-		if (isFloat32Zero(a)) {
+	
+	if (is_float32_infinity(b)) {
+		if (is_float32_zero(a)) {
 			/* FIXME 0 / inf */
 			result.parts.exp = 0;
@@ -97,8 +98,8 @@
 	}
 	
-	if (isFloat32Zero(b)) {
-		if (isFloat32Zero(a)) {
+	if (is_float32_zero(b)) {
+		if (is_float32_zero(a)) {
 			/*FIXME: 0 / 0*/
-			result.binary = FLOAT32_NAN;
+			result.bin = FLOAT32_NAN;
 			return result;
 		}
@@ -121,8 +122,8 @@
 			return result;
 		}
-
+		
 		/* normalize it*/
 		afrac <<= 1;
-		/* afrac is nonzero => it must stop */	
+		/* afrac is nonzero => it must stop */
 		while (!(afrac & FLOAT32_HIDDEN_BIT_MASK)) {
 			afrac <<= 1;
@@ -130,8 +131,8 @@
 		}
 	}
-
+	
 	if (bexp == 0) {
 		bfrac <<= 1;
-		/* bfrac is nonzero => it must stop */	
+		/* bfrac is nonzero => it must stop */
 		while (!(bfrac & FLOAT32_HIDDEN_BIT_MASK)) {
 			bfrac <<= 1;
@@ -139,8 +140,8 @@
 		}
 	}
-
-	afrac =	(afrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE - 1);
-	bfrac =	(bfrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE);
-
+	
+	afrac = (afrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE - 1);
+	bfrac = (bfrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE);
+	
 	if (bfrac <= (afrac << 1)) {
 		afrac >>= 1;
@@ -169,6 +170,6 @@
 		++cexp;
 		cfrac >>= 1;
-	}	
-
+	}
+	
 	/* check overflow */
 	if (cexp >= FLOAT32_MAX_EXPONENT) {
@@ -178,5 +179,5 @@
 		return result;
 	}
-
+	
 	if (cexp < 0) {
 		/* FIXME: underflow */
@@ -190,5 +191,5 @@
 			cexp++;
 			cfrac >>= 1;
-		}	
+		}
 	} else {
 		result.parts.exp = (uint32_t) cexp;
@@ -197,15 +198,16 @@
 	result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); 
 	
-	return result;	
+	return result;
 }
 
-/**
- * Divide two double-precision floats.
+/** Divide two double-precision floats.
  *
  * @param a Nominator.
  * @param b Denominator.
+ *
  * @return Result of division.
- */
-float64 divFloat64(float64 a, float64 b) 
+ *
+ */
+float64 div_float64(float64 a, float64 b) 
 {
 	float64 result;
@@ -217,29 +219,29 @@
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
 	
-	if (isFloat64NaN(a)) {
-		if (isFloat64SigNaN(b)) {
-			/*FIXME: SigNaN*/
+	if (is_float64_nan(a)) {
+		if (is_float64_signan(b)) {
+			// FIXME: SigNaN
 			return b;
 		}
 		
-		if (isFloat64SigNaN(a)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+		if (is_float64_signan(a)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return a;
 	}
 	
-	if (isFloat64NaN(b)) {
-		if (isFloat64SigNaN(b)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	if (is_float64_nan(b)) {
+		if (is_float64_signan(b)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return b;
 	}
 	
-	if (isFloat64Infinity(a)) {
-		if (isFloat64Infinity(b) || isFloat64Zero(b)) {
-			/*FIXME: inf / inf */
-			result.binary = FLOAT64_NAN;
+	if (is_float64_infinity(a)) {
+		if (is_float64_infinity(b) || is_float64_zero(b)) {
+			// FIXME: inf / inf
+			result.bin = FLOAT64_NAN;
 			return result;
 		}
@@ -249,7 +251,7 @@
 		return result;
 	}
-
-	if (isFloat64Infinity(b)) {
-		if (isFloat64Zero(a)) {
+	
+	if (is_float64_infinity(b)) {
+		if (is_float64_zero(a)) {
 			/* FIXME 0 / inf */
 			result.parts.exp = 0;
@@ -263,8 +265,8 @@
 	}
 	
-	if (isFloat64Zero(b)) {
-		if (isFloat64Zero(a)) {
+	if (is_float64_zero(b)) {
+		if (is_float64_zero(a)) {
 			/*FIXME: 0 / 0*/
-			result.binary = FLOAT64_NAN;
+			result.bin = FLOAT64_NAN;
 			return result;
 		}
@@ -274,5 +276,5 @@
 		return result;
 	}
-
+	
 	afrac = a.parts.fraction;
 	aexp = a.parts.exp;
@@ -287,5 +289,5 @@
 			return result;
 		}
-
+		
 		/* normalize it*/
 		aexp++;
@@ -296,5 +298,5 @@
 		}
 	}
-
+	
 	if (bexp == 0) {
 		bexp++;
@@ -305,8 +307,8 @@
 		}
 	}
-
-	afrac =	(afrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 2);
-	bfrac =	(bfrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 1);
-
+	
+	afrac = (afrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 2);
+	bfrac = (bfrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 1);
+	
 	if (bfrac <= (afrac << 1)) {
 		afrac >>= 1;
@@ -330,16 +332,17 @@
 	
 	/* round and shift */
-	result = finishFloat64(cexp, cfrac, result.parts.sign);
+	result = finish_float64(cexp, cfrac, result.parts.sign);
 	return result;
 }
 
-/**
- * Divide two quadruple-precision floats.
+/** Divide two quadruple-precision floats.
  *
  * @param a Nominator.
  * @param b Denominator.
+ *
  * @return Result of division.
- */
-float128 divFloat128(float128 a, float128 b)
+ *
+ */
+float128 div_float128(float128 a, float128 b)
 {
 	float128 result;
@@ -349,33 +352,33 @@
 	uint64_t rem_hihi, rem_hilo, rem_lohi, rem_lolo;
 	uint64_t tmp_hihi, tmp_hilo, tmp_lohi, tmp_lolo;
-
+	
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (isFloat128NaN(a)) {
-		if (isFloat128SigNaN(b)) {
-			/*FIXME: SigNaN*/
+	
+	if (is_float128_nan(a)) {
+		if (is_float128_signan(b)) {
+			// FIXME: SigNaN
 			return b;
 		}
-
-		if (isFloat128SigNaN(a)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+		
+		if (is_float128_signan(a)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return a;
 	}
-
-	if (isFloat128NaN(b)) {
-		if (isFloat128SigNaN(b)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	
+	if (is_float128_nan(b)) {
+		if (is_float128_signan(b)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return b;
 	}
-
-	if (isFloat128Infinity(a)) {
-		if (isFloat128Infinity(b) || isFloat128Zero(b)) {
-			/*FIXME: inf / inf */
-			result.binary.hi = FLOAT128_NAN_HI;
-			result.binary.lo = FLOAT128_NAN_LO;
+	
+	if (is_float128_infinity(a)) {
+		if (is_float128_infinity(b) || is_float128_zero(b)) {
+			// FIXME: inf / inf
+			result.bin.hi = FLOAT128_NAN_HI;
+			result.bin.lo = FLOAT128_NAN_LO;
 			return result;
 		}
@@ -386,8 +389,8 @@
 		return result;
 	}
-
-	if (isFloat128Infinity(b)) {
-		if (isFloat128Zero(a)) {
-			/* FIXME 0 / inf */
+	
+	if (is_float128_infinity(b)) {
+		if (is_float128_zero(a)) {
+			// FIXME 0 / inf
 			result.parts.exp = 0;
 			result.parts.frac_hi = 0;
@@ -395,5 +398,5 @@
 			return result;
 		}
-		/* FIXME: num / inf*/
+		// FIXME: num / inf
 		result.parts.exp = 0;
 		result.parts.frac_hi = 0;
@@ -401,13 +404,13 @@
 		return result;
 	}
-
-	if (isFloat128Zero(b)) {
-		if (isFloat128Zero(a)) {
-			/*FIXME: 0 / 0*/
-			result.binary.hi = FLOAT128_NAN_HI;
-			result.binary.lo = FLOAT128_NAN_LO;
-			return result;
-		}
-		/* FIXME: division by zero */
+	
+	if (is_float128_zero(b)) {
+		if (is_float128_zero(a)) {
+			// FIXME: 0 / 0
+			result.bin.hi = FLOAT128_NAN_HI;
+			result.bin.lo = FLOAT128_NAN_LO;
+			return result;
+		}
+		// FIXME: division by zero
 		result.parts.exp = 0;
 		result.parts.frac_hi = 0;
@@ -415,5 +418,5 @@
 		return result;
 	}
-
+	
 	afrac_hi = a.parts.frac_hi;
 	afrac_lo = a.parts.frac_lo;
@@ -422,5 +425,5 @@
 	bfrac_lo = b.parts.frac_lo;
 	bexp = b.parts.exp;
-
+	
 	/* denormalized numbers */
 	if (aexp == 0) {
@@ -431,5 +434,5 @@
 			return result;
 		}
-
+		
 		/* normalize it*/
 		aexp++;
@@ -443,5 +446,5 @@
 		}
 	}
-
+	
 	if (bexp == 0) {
 		bexp++;
@@ -455,5 +458,5 @@
 		}
 	}
-
+	
 	or128(afrac_hi, afrac_lo,
 	    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
@@ -466,18 +469,18 @@
 	lshift128(bfrac_hi, bfrac_lo,
 	    (128 - FLOAT128_FRACTION_SIZE - 1), &bfrac_hi, &bfrac_lo);
-
+	
 	if (le128(bfrac_hi, bfrac_lo, afrac_hi, afrac_lo)) {
 		rshift128(afrac_hi, afrac_lo, 1, &afrac_hi, &afrac_lo);
 		aexp++;
 	}
-
+	
 	cexp = aexp - bexp + FLOAT128_BIAS - 2;
-
+	
 	cfrac_hi = div128est(afrac_hi, afrac_lo, bfrac_hi);
-
+	
 	mul128(bfrac_hi, bfrac_lo, 0x0ll, cfrac_hi,
 	    &tmp_lolo /* dummy */, &tmp_hihi, &tmp_hilo, &tmp_lohi);
-
-	/* sub192(afrac_hi, afrac_lo, 0, 
+	
+	/* sub192(afrac_hi, afrac_lo, 0,
 	 *     tmp_hihi, tmp_hilo, tmp_lohi
 	 *     &rem_hihi, &rem_hilo, &rem_lohi); */
@@ -487,8 +490,8 @@
 	}
 	rem_lohi = -tmp_lohi;
-
+	
 	while ((int64_t) rem_hihi < 0) {
 		--cfrac_hi;
-		/* add192(rem_hihi, rem_hilo, rem_lohi, 
+		/* add192(rem_hihi, rem_hilo, rem_lohi,
 		 *     0, bfrac_hi, bfrac_lo,
 		 *     &rem_hihi, &rem_hilo, &rem_lohi); */
@@ -498,11 +501,11 @@
 		}
 	}
-
+	
 	cfrac_lo = div128est(rem_hilo, rem_lohi, bfrac_lo);
-
+	
 	if ((cfrac_lo & 0x3FFF) <= 4) {
 		mul128(bfrac_hi, bfrac_lo, 0x0ll, cfrac_lo,
-	        &tmp_hihi /* dummy */, &tmp_hilo, &tmp_lohi, &tmp_lolo);
-
+		    &tmp_hihi /* dummy */, &tmp_hilo, &tmp_lohi, &tmp_lolo);
+		
 		/* sub192(rem_hilo, rem_lohi, 0,
 		 *     tmp_hilo, tmp_lohi, tmp_lolo,
@@ -513,5 +516,5 @@
 		}
 		rem_lolo = -tmp_lolo;
-
+		
 		while ((int64_t) rem_hilo < 0) {
 			--cfrac_lo;
@@ -524,13 +527,13 @@
 			}
 		}
-
+		
 		cfrac_lo |= ((rem_hilo | rem_lohi | rem_lolo) != 0 );
 	}
-
+	
 	shift_out = cfrac_lo << (64 - (128 - FLOAT128_FRACTION_SIZE - 1));
 	rshift128(cfrac_hi, cfrac_lo, (128 - FLOAT128_FRACTION_SIZE - 1),
 	    &cfrac_hi, &cfrac_lo);
-
-	result = finishFloat128(cexp, cfrac_hi, cfrac_lo, result.parts.sign, shift_out);
+	
+	result = finish_float128(cexp, cfrac_hi, cfrac_lo, result.parts.sign, shift_out);
 	return result;
 }
Index: uspace/lib/softfloat/generic/mul.c
===================================================================
--- uspace/lib/softfloat/generic/mul.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/mul.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -39,27 +39,28 @@
 #include <common.h>
 
-/**
- * Multiply two single-precision floats.
+/** Multiply two single-precision floats.
  *
  * @param a First input operand.
  * @param b Second input operand.
+ *
  * @return Result of multiplication.
- */
-float32 mulFloat32(float32 a, float32 b)
+ *
+ */
+float32 mul_float32(float32 a, float32 b)
 {
 	float32 result;
 	uint64_t frac1, frac2;
 	int32_t exp;
-
+	
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
 	
-	if (isFloat32NaN(a) || isFloat32NaN(b)) {
+	if (is_float32_nan(a) || is_float32_nan(b)) {
 		/* TODO: fix SigNaNs */
-		if (isFloat32SigNaN(a)) {
+		if (is_float32_signan(a)) {
 			result.parts.fraction = a.parts.fraction;
 			result.parts.exp = a.parts.exp;
 			return result;
 		}
-		if (isFloat32SigNaN(b)) { /* TODO: fix SigNaN */
+		if (is_float32_signan(b)) { /* TODO: fix SigNaN */
 			result.parts.fraction = b.parts.fraction;
 			result.parts.exp = b.parts.exp;
@@ -67,12 +68,12 @@
 		}
 		/* set NaN as result */
-		result.binary = FLOAT32_NAN;
-		return result;
-	}
-		
-	if (isFloat32Infinity(a)) { 
-		if (isFloat32Zero(b)) {
-			/* FIXME: zero * infinity */
-			result.binary = FLOAT32_NAN;
+		result.bin = FLOAT32_NAN;
+		return result;
+	}
+	
+	if (is_float32_infinity(a)) {
+		if (is_float32_zero(b)) {
+			/* FIXME: zero * infinity */
+			result.bin = FLOAT32_NAN;
 			return result;
 		}
@@ -81,9 +82,9 @@
 		return result;
 	}
-
-	if (isFloat32Infinity(b)) { 
-		if (isFloat32Zero(a)) {
-			/* FIXME: zero * infinity */
-			result.binary = FLOAT32_NAN;
+	
+	if (is_float32_infinity(b)) {
+		if (is_float32_zero(a)) {
+			/* FIXME: zero * infinity */
+			result.bin = FLOAT32_NAN;
 			return result;
 		}
@@ -92,5 +93,5 @@
 		return result;
 	}
-
+	
 	/* exp is signed so we can easy detect underflow */
 	exp = a.parts.exp + b.parts.exp;
@@ -100,5 +101,5 @@
 		/* FIXME: overflow */
 		/* set infinity as result */
-		result.binary = FLOAT32_INF;
+		result.bin = FLOAT32_INF;
 		result.parts.sign = a.parts.sign ^ b.parts.sign;
 		return result;
@@ -121,5 +122,5 @@
 	
 	frac2 = b.parts.fraction;
-
+	
 	if (b.parts.exp > 0) {
 		frac2 |= FLOAT32_HIDDEN_BIT_MASK;
@@ -127,26 +128,28 @@
 		++exp;
 	}
-
+	
 	frac1 <<= 1; /* one bit space for rounding */
-
+	
 	frac1 = frac1 * frac2;
-
+	
 	/* round and return */
-	while ((exp < FLOAT32_MAX_EXPONENT) && (frac1 >= (1 << (FLOAT32_FRACTION_SIZE + 2)))) { 
+	while ((exp < FLOAT32_MAX_EXPONENT) &&
+	    (frac1 >= (1 << (FLOAT32_FRACTION_SIZE + 2)))) {
 		/* 23 bits of fraction + one more for hidden bit (all shifted 1 bit left) */
 		++exp;
 		frac1 >>= 1;
 	}
-
+	
 	/* rounding */
 	/* ++frac1; FIXME: not works - without it is ok */
 	frac1 >>= 1; /* shift off rounding space */
 	
-	if ((exp < FLOAT32_MAX_EXPONENT) && (frac1 >= (1 << (FLOAT32_FRACTION_SIZE + 1)))) {
+	if ((exp < FLOAT32_MAX_EXPONENT) &&
+	    (frac1 >= (1 << (FLOAT32_FRACTION_SIZE + 1)))) {
 		++exp;
 		frac1 >>= 1;
 	}
-
-	if (exp >= FLOAT32_MAX_EXPONENT) {	
+	
+	if (exp >= FLOAT32_MAX_EXPONENT) {
 		/* TODO: fix overflow */
 		/* return infinity*/
@@ -157,6 +160,6 @@
 	
 	exp -= FLOAT32_FRACTION_SIZE;
-
-	if (exp <= FLOAT32_FRACTION_SIZE) { 
+	
+	if (exp <= FLOAT32_FRACTION_SIZE) {
 		/* denormalized number */
 		frac1 >>= 1; /* denormalize */
@@ -175,30 +178,31 @@
 	result.parts.fraction = frac1 & ((1 << FLOAT32_FRACTION_SIZE) - 1);
 	
-	return result;	
+	return result;
 }
 
-/**
- * Multiply two double-precision floats.
+/** Multiply two double-precision floats.
  *
  * @param a First input operand.
  * @param b Second input operand.
+ *
  * @return Result of multiplication.
- */
-float64 mulFloat64(float64 a, float64 b)
+ *
+ */
+float64 mul_float64(float64 a, float64 b)
 {
 	float64 result;
 	uint64_t frac1, frac2;
 	int32_t exp;
-
+	
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
 	
-	if (isFloat64NaN(a) || isFloat64NaN(b)) {
+	if (is_float64_nan(a) || is_float64_nan(b)) {
 		/* TODO: fix SigNaNs */
-		if (isFloat64SigNaN(a)) {
+		if (is_float64_signan(a)) {
 			result.parts.fraction = a.parts.fraction;
 			result.parts.exp = a.parts.exp;
 			return result;
 		}
-		if (isFloat64SigNaN(b)) { /* TODO: fix SigNaN */
+		if (is_float64_signan(b)) { /* TODO: fix SigNaN */
 			result.parts.fraction = b.parts.fraction;
 			result.parts.exp = b.parts.exp;
@@ -206,12 +210,12 @@
 		}
 		/* set NaN as result */
-		result.binary = FLOAT64_NAN;
-		return result;
-	}
-		
-	if (isFloat64Infinity(a)) { 
-		if (isFloat64Zero(b)) {
-			/* FIXME: zero * infinity */
-			result.binary = FLOAT64_NAN;
+		result.bin = FLOAT64_NAN;
+		return result;
+	}
+	
+	if (is_float64_infinity(a)) {
+		if (is_float64_zero(b)) {
+			/* FIXME: zero * infinity */
+			result.bin = FLOAT64_NAN;
 			return result;
 		}
@@ -220,9 +224,9 @@
 		return result;
 	}
-
-	if (isFloat64Infinity(b)) { 
-		if (isFloat64Zero(a)) {
-			/* FIXME: zero * infinity */
-			result.binary = FLOAT64_NAN;
+	
+	if (is_float64_infinity(b)) {
+		if (is_float64_zero(a)) {
+			/* FIXME: zero * infinity */
+			result.bin = FLOAT64_NAN;
 			return result;
 		}
@@ -231,10 +235,10 @@
 		return result;
 	}
-
+	
 	/* exp is signed so we can easy detect underflow */
 	exp = a.parts.exp + b.parts.exp - FLOAT64_BIAS;
 	
 	frac1 = a.parts.fraction;
-
+	
 	if (a.parts.exp > 0) {
 		frac1 |= FLOAT64_HIDDEN_BIT_MASK;
@@ -244,5 +248,5 @@
 	
 	frac2 = b.parts.fraction;
-
+	
 	if (b.parts.exp > 0) {
 		frac2 |= FLOAT64_HIDDEN_BIT_MASK;
@@ -250,10 +254,10 @@
 		++exp;
 	}
-
+	
 	frac1 <<= (64 - FLOAT64_FRACTION_SIZE - 1);
 	frac2 <<= (64 - FLOAT64_FRACTION_SIZE - 2);
-
+	
 	mul64(frac1, frac2, &frac1, &frac2);
-
+	
 	frac1 |= (frac2 != 0);
 	if (frac1 & (0x1ll << 62)) {
@@ -261,27 +265,28 @@
 		exp--;
 	}
-
-	result = finishFloat64(exp, frac1, result.parts.sign);
+	
+	result = finish_float64(exp, frac1, result.parts.sign);
 	return result;
 }
 
-/**
- * Multiply two quadruple-precision floats.
+/** Multiply two quadruple-precision floats.
  *
  * @param a First input operand.
  * @param b Second input operand.
+ *
  * @return Result of multiplication.
- */
-float128 mulFloat128(float128 a, float128 b)
+ *
+ */
+float128 mul_float128(float128 a, float128 b)
 {
 	float128 result;
 	uint64_t frac1_hi, frac1_lo, frac2_hi, frac2_lo, tmp_hi, tmp_lo;
 	int32_t exp;
-
+	
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (isFloat128NaN(a) || isFloat128NaN(b)) {
+	
+	if (is_float128_nan(a) || is_float128_nan(b)) {
 		/* TODO: fix SigNaNs */
-		if (isFloat128SigNaN(a)) {
+		if (is_float128_signan(a)) {
 			result.parts.frac_hi = a.parts.frac_hi;
 			result.parts.frac_lo = a.parts.frac_lo;
@@ -289,5 +294,5 @@
 			return result;
 		}
-		if (isFloat128SigNaN(b)) { /* TODO: fix SigNaN */
+		if (is_float128_signan(b)) { /* TODO: fix SigNaN */
 			result.parts.frac_hi = b.parts.frac_hi;
 			result.parts.frac_lo = b.parts.frac_lo;
@@ -296,14 +301,14 @@
 		}
 		/* set NaN as result */
-		result.binary.hi = FLOAT128_NAN_HI;
-		result.binary.lo = FLOAT128_NAN_LO;
-		return result;
-	}
-
-	if (isFloat128Infinity(a)) {
-		if (isFloat128Zero(b)) {
-			/* FIXME: zero * infinity */
-			result.binary.hi = FLOAT128_NAN_HI;
-			result.binary.lo = FLOAT128_NAN_LO;
+		result.bin.hi = FLOAT128_NAN_HI;
+		result.bin.lo = FLOAT128_NAN_LO;
+		return result;
+	}
+	
+	if (is_float128_infinity(a)) {
+		if (is_float128_zero(b)) {
+			/* FIXME: zero * infinity */
+			result.bin.hi = FLOAT128_NAN_HI;
+			result.bin.lo = FLOAT128_NAN_LO;
 			return result;
 		}
@@ -313,10 +318,10 @@
 		return result;
 	}
-
-	if (isFloat128Infinity(b)) {
-		if (isFloat128Zero(a)) {
-			/* FIXME: zero * infinity */
-			result.binary.hi = FLOAT128_NAN_HI;
-			result.binary.lo = FLOAT128_NAN_LO;
+	
+	if (is_float128_infinity(b)) {
+		if (is_float128_zero(a)) {
+			/* FIXME: zero * infinity */
+			result.bin.hi = FLOAT128_NAN_HI;
+			result.bin.lo = FLOAT128_NAN_LO;
 			return result;
 		}
@@ -326,22 +331,22 @@
 		return result;
 	}
-
+	
 	/* exp is signed so we can easy detect underflow */
 	exp = a.parts.exp + b.parts.exp - FLOAT128_BIAS - 1;
-
+	
 	frac1_hi = a.parts.frac_hi;
 	frac1_lo = a.parts.frac_lo;
-
+	
 	if (a.parts.exp > 0) {
 		or128(frac1_hi, frac1_lo,
-	        FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	        &frac1_hi, &frac1_lo);
-	} else {
-		++exp;
-	}
-
+		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
+		    &frac1_hi, &frac1_lo);
+	} else {
+		++exp;
+	}
+	
 	frac2_hi = b.parts.frac_hi;
 	frac2_lo = b.parts.frac_lo;
-
+	
 	if (b.parts.exp > 0) {
 		or128(frac2_hi, frac2_lo,
@@ -351,8 +356,8 @@
 		++exp;
 	}
-
+	
 	lshift128(frac2_hi, frac2_lo,
 	    128 - FLOAT128_FRACTION_SIZE, &frac2_hi, &frac2_lo);
-
+	
 	tmp_hi = frac1_hi;
 	tmp_lo = frac1_lo;
@@ -361,5 +366,5 @@
 	add128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &frac1_hi, &frac1_lo);
 	frac2_hi |= (frac2_lo != 0x0ll);
-
+	
 	if ((FLOAT128_HIDDEN_BIT_MASK_HI << 1) <= frac1_hi) {
 		frac2_hi >>= 1;
@@ -370,6 +375,6 @@
 		++exp;
 	}
-
-	result = finishFloat128(exp, frac1_hi, frac1_lo, result.parts.sign, frac2_hi);
+	
+	result = finish_float128(exp, frac1_hi, frac1_lo, result.parts.sign, frac2_hi);
 	return result;
 }
Index: uspace/lib/softfloat/generic/softfloat.c
===================================================================
--- uspace/lib/softfloat/generic/softfloat.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/softfloat.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -48,494 +48,609 @@
 #include <other.h>
 
-#include <functions.h>
-
 /* Arithmetic functions */
 
 float __addsf3(float a, float b)
 {
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-	if (fa.parts.sign != fb.parts.sign) {
-		if (fa.parts.sign) {
-			fa.parts.sign = 0;
-			return subFloat32(fb, fa).f;
-		};
-		fb.parts.sign = 0;
-		return subFloat32(fa, fb).f;
-	}
-	return addFloat32(fa, fb).f;
+	float_t fa;
+	float_t fb;
+	float_t res;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if (fa.data.parts.sign != fb.data.parts.sign) {
+		if (fa.data.parts.sign) {
+			fa.data.parts.sign = 0;
+			res.data = sub_float(fb.data, fa.data);
+			
+			return res.val;
+		}
+		
+		fb.data.parts.sign = 0;
+		res.data = sub_float(fa.data, fb.data);
+		
+		return res.val;
+	}
+	
+	res.data = add_float(fa.data, fb.data);
+	return res.val;
 }
 
 double __adddf3(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-	if (da.parts.sign != db.parts.sign) {
-		if (da.parts.sign) {
-			da.parts.sign = 0;
-			return subFloat64(db, da).d;
-		};
-		db.parts.sign = 0;
-		return subFloat64(da, db).d;
-	}
-	return addFloat64(da, db).d;
+	double_t da;
+	double_t db;
+	double_t res;
+	
+	da.val = a;
+	db.val = b;
+	
+	if (da.data.parts.sign != db.data.parts.sign) {
+		if (da.data.parts.sign) {
+			da.data.parts.sign = 0;
+			res.data = sub_double(db.data, da.data);
+			
+			return res.val;
+		}
+		
+		db.data.parts.sign = 0;
+		res.data = sub_double(da.data, db.data);
+		
+		return res.val;
+	}
+	
+	res.data = add_double(da.data, db.data);
+	return res.val;
 }
 
 long double __addtf3(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-	if (ta.parts.sign != tb.parts.sign) {
-		if (ta.parts.sign) {
-			ta.parts.sign = 0;
-			return subFloat128(tb, ta).ld;
-		};
-		tb.parts.sign = 0;
-		return subFloat128(ta, tb).ld;
-	}
-	return addFloat128(ta, tb).ld;
+	long_double_t ta;
+	long_double_t tb;
+	long_double_t res;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if (ta.data.parts.sign != tb.data.parts.sign) {
+		if (ta.data.parts.sign) {
+			ta.data.parts.sign = 0;
+			res.data = sub_long_double(tb.data, ta.data);
+			
+			return res.val;
+		}
+		
+		tb.data.parts.sign = 0;
+		res.data = sub_long_double(ta.data, tb.data);
+		
+		return res.val;
+	}
+	
+	res.data = add_long_double(ta.data, tb.data);
+	return res.val;
 }
 
 float __subsf3(float a, float b)
 {
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-	if (fa.parts.sign != fb.parts.sign) {
-		fb.parts.sign = !fb.parts.sign;
-		return addFloat32(fa, fb).f;
-	}
-	return subFloat32(fa, fb).f;
+	float_t fa;
+	float_t fb;
+	float_t res;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if (fa.data.parts.sign != fb.data.parts.sign) {
+		fb.data.parts.sign = !fb.data.parts.sign;
+		res.data = add_float(fa.data, fb.data);
+		
+		return res.val;
+	}
+	
+	res.data = sub_float(fa.data, fb.data);
+	return res.val;
 }
 
 double __subdf3(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-	if (da.parts.sign != db.parts.sign) {
-		db.parts.sign = !db.parts.sign;
-		return addFloat64(da, db).d;
-	}
-	return subFloat64(da, db).d;
+	double_t da;
+	double_t db;
+	double_t res;
+	
+	da.val = a;
+	db.val = b;
+	
+	if (da.data.parts.sign != db.data.parts.sign) {
+		db.data.parts.sign = !db.data.parts.sign;
+		res.data = add_double(da.data, db.data);
+		
+		return res.val;
+	}
+	
+	res.data = sub_double(da.data, db.data);
+	return res.val;
 }
 
 long double __subtf3(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-	if (ta.parts.sign != tb.parts.sign) {
-		tb.parts.sign = !tb.parts.sign;
-		return addFloat128(ta, tb).ld;
-	}
-	return subFloat128(ta, tb).ld;
-}
-
-float __mulsf3(float a, float b) 
-{
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-	return 	mulFloat32(fa, fb).f;
-}
-
-double __muldf3(double a, double b) 
-{
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-	return 	mulFloat64(da, db).d;
+	long_double_t ta;
+	long_double_t tb;
+	long_double_t res;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if (ta.data.parts.sign != tb.data.parts.sign) {
+		tb.data.parts.sign = !tb.data.parts.sign;
+		res.data = add_long_double(ta.data, tb.data);
+		
+		return res.val;
+	}
+	
+	res.data = sub_long_double(ta.data, tb.data);
+	return res.val;
+}
+
+float __mulsf3(float a, float b)
+{
+	float_t fa;
+	float_t fb;
+	float_t res;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	res.data = mul_float(fa.data, fb.data);
+	return res.val;
+}
+
+double __muldf3(double a, double b)
+{
+	double_t da;
+	double_t db;
+	double_t res;
+	
+	da.val = a;
+	db.val = b;
+	
+	res.data = mul_double(da.data, db.data);
+	return res.val;
 }
 
 long double __multf3(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-	return 	mulFloat128(ta, tb).ld;
-}
-
-float __divsf3(float a, float b) 
-{
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-	return 	divFloat32(fa, fb).f;
-}
-
-double __divdf3(double a, double b) 
-{
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-	return 	divFloat64(da, db).d;
+	long_double_t ta;
+	long_double_t tb;
+	long_double_t res;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	res.data = mul_long_double(ta.data, tb.data);
+	return res.val;
+}
+
+float __divsf3(float a, float b)
+{
+	float_t fa;
+	float_t fb;
+	float_t res;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	res.data = div_float(fa.data, fb.data);
+	return res.val;
+}
+
+double __divdf3(double a, double b)
+{
+	double_t da;
+	double_t db;
+	double_t res;
+	
+	da.val = a;
+	db.val = b;
+	
+	res.data = div_double(da.data, db.data);
+	return res.val;
 }
 
 long double __divtf3(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-	return 	divFloat128(ta, tb).ld;
+	long_double_t ta;
+	long_double_t tb;
+	long_double_t res;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	res.data = div_long_double(ta.data, tb.data);
+	return res.val;
 }
 
 float __negsf2(float a)
 {
-	float32 fa;
-	fa.f = a;
-	fa.parts.sign = !fa.parts.sign;
-	return fa.f;
+	float_t fa;
+	
+	fa.val = a;
+	fa.data.parts.sign = !fa.data.parts.sign;
+	
+	return fa.val;
 }
 
 double __negdf2(double a)
 {
-	float64 da;
-	da.d = a;
-	da.parts.sign = !da.parts.sign;
-	return da.d;
+	double_t da;
+	
+	da.val = a;
+	da.data.parts.sign = !da.data.parts.sign;
+	
+	return da.val;
 }
 
 long double __negtf2(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-	ta.parts.sign = !ta.parts.sign;
-	return ta.ld;
+	long_double_t ta;
+	
+	ta.val = a;
+	ta.data.parts.sign = !ta.data.parts.sign;
+	
+	return ta.val;
 }
 
 /* Conversion functions */
 
-double __extendsfdf2(float a) 
-{
-	float32 fa;
-	fa.f = a;
-	return convertFloat32ToFloat64(fa).d;
+double __extendsfdf2(float a)
+{
+	float_t fa;
+	double_t res;
+	
+	fa.val = a;
+	res.data = float_to_double(fa.data);
+	
+	return res.val;
 }
 
 long double __extendsftf2(float a)
 {
-	float32 fa;
-	fa.f = a;
-	return convertFloat32ToFloat128(fa).ld;
+	float_t fa;
+	long_double_t res;
+	
+	fa.val = a;
+	res.data = float_to_long_double(fa.data);
+	
+	return res.val;
 }
 
 long double __extenddftf2(double a)
 {
-	float64 da;
-	da.d = a;
-	return convertFloat64ToFloat128(da).ld;
-}
-
-float __truncdfsf2(double a) 
-{
-	float64 da;
-	da.d = a;
-	return convertFloat64ToFloat32(da).f;
+	double_t da;
+	long_double_t res;
+	
+	da.val = a;
+	res.data = double_to_long_double(da.data);
+	
+	return res.val;
+}
+
+float __truncdfsf2(double a)
+{
+	double_t da;
+	float_t res;
+	
+	da.val = a;
+	res.data = double_to_float(da.data);
+	
+	return res.val;
 }
 
 float __trunctfsf2(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-	return convertFloat128ToFloat32(ta).f;
+	long_double_t ta;
+	float_t res;
+	
+	ta.val = a;
+	res.data = long_double_to_float(ta.data);
+	
+	return res.val;
 }
 
 double __trunctfdf2(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-	return convertFloat128ToFloat64(ta).d;
+	long_double_t ta;
+	double_t res;
+	
+	ta.val = a;
+	res.data = long_double_to_double(ta.data);
+	
+	return res.val;
 }
 
 int __fixsfsi(float a)
 {
-	float32 fa;
-	fa.f = a;
-	
-	return float32_to_int(fa);
+	float_t fa;
+	
+	fa.val = a;
+	return float_to_int(fa.data);
 }
 
 int __fixdfsi(double a)
 {
-	float64 da;
-	da.d = a;
-	
-	return float64_to_int(da);
+	double_t da;
+	
+	da.val = a;
+	return double_to_int(da.data);
 }
 
 int __fixtfsi(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-
-	return float128_to_int(ta);
+	long_double_t ta;
+	
+	ta.val = a;
+	return long_double_to_int(ta.data);
 }
  
 long __fixsfdi(float a)
 {
-	float32 fa;
-	fa.f = a;
-	
-	return float32_to_long(fa);
+	float_t fa;
+	
+	fa.val = a;
+	return float_to_long(fa.data);
 }
 
 long __fixdfdi(double a)
 {
-	float64 da;
-	da.d = a;
-	
-	return float64_to_long(da);
+	double_t da;
+	
+	da.val = a;
+	return double_to_long(da.data);
 }
 
 long __fixtfdi(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-
-	return float128_to_long(ta);
+	long_double_t ta;
+	
+	ta.val = a;
+	return long_double_to_long(ta.data);
 }
  
 long long __fixsfti(float a)
 {
-	float32 fa;
-	fa.f = a;
-	
-	return float32_to_longlong(fa);
+	float_t fa;
+	
+	fa.val = a;
+	return float_to_llong(fa.data);
 }
 
 long long __fixdfti(double a)
 {
-	float64 da;
-	da.d = a;
-	
-	return float64_to_longlong(da);
+	double_t da;
+	
+	da.val = a;
+	return double_to_llong(da.data);
 }
 
 long long __fixtfti(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-
-	return float128_to_longlong(ta);
+	long_double_t ta;
+	
+	ta.val = a;
+	return long_double_to_llong(ta.data);
 }
 
 unsigned int __fixunssfsi(float a)
 {
-	float32 fa;
-	fa.f = a;
-	
-	return float32_to_uint(fa);
+	float_t fa;
+	
+	fa.val = a;
+	return float_to_uint(fa.data);
 }
 
 unsigned int __fixunsdfsi(double a)
 {
-	float64 da;
-	da.d = a;
-	
-	return float64_to_uint(da);
+	double_t da;
+	
+	da.val = a;
+	return double_to_uint(da.data);
 }
 
 unsigned int __fixunstfsi(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-
-	return float128_to_uint(ta);
+	long_double_t ta;
+	
+	ta.val = a;
+	return long_double_to_uint(ta.data);
 }
  
 unsigned long __fixunssfdi(float a)
 {
-	float32 fa;
-	fa.f = a;
-	
-	return float32_to_ulong(fa);
+	float_t fa;
+	
+	fa.val = a;
+	return float_to_ulong(fa.data);
 }
 
 unsigned long __fixunsdfdi(double a)
 {
-	float64 da;
-	da.d = a;
-	
-	return float64_to_ulong(da);
+	double_t da;
+	
+	da.val = a;
+	return double_to_ulong(da.data);
 }
 
 unsigned long __fixunstfdi(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-
-	return float128_to_ulong(ta);
+	long_double_t ta;
+	
+	ta.val = a;
+	return long_double_to_ulong(ta.data);
 }
  
 unsigned long long __fixunssfti(float a)
 {
-	float32 fa;
-	fa.f = a;
-	
-	return float32_to_ulonglong(fa);
+	float_t fa;
+	
+	fa.val = a;
+	return float_to_ullong(fa.data);
 }
 
 unsigned long long __fixunsdfti(double a)
 {
-	float64 da;
-	da.d = a;
-	
-	return float64_to_ulonglong(da);
+	double_t da;
+	
+	da.val = a;
+	return double_to_ullong(da.data);
 }
 
 unsigned long long __fixunstfti(long double a)
 {
-	float128 ta;
-	ta.ld = a;
-
-	return float128_to_ulonglong(ta);
+	long_double_t ta;
+	
+	ta.val = a;
+	return long_double_to_ullong(ta.data);
 }
  
 float __floatsisf(int i)
 {
-	float32 fa;
-	
-	fa = int_to_float32(i);
-	return fa.f;
+	float_t res;
+	
+	res.data = int_to_float(i);
+	return res.val;
 }
 
 double __floatsidf(int i)
 {
-	float64 da;
-	
-	da = int_to_float64(i);
-	return da.d;
+	double_t res;
+	
+	res.data = int_to_double(i);
+	return res.val;
 }
 
 long double __floatsitf(int i)
 {
-	float128 ta;
-
-	ta = int_to_float128(i);
-	return ta.ld;
+	long_double_t res;
+	
+	res.data = int_to_long_double(i);
+	return res.val;
 }
  
 float __floatdisf(long i)
 {
-	float32 fa;
-	
-	fa = long_to_float32(i);
-	return fa.f;
+	float_t res;
+	
+	res.data = long_to_float(i);
+	return res.val;
 }
 
 double __floatdidf(long i)
 {
-	float64 da;
-	
-	da = long_to_float64(i);
-	return da.d;
+	double_t res;
+	
+	res.data = long_to_double(i);
+	return res.val;
 }
 
 long double __floatditf(long i)
 {
-	float128 ta;
-
-	ta = long_to_float128(i);
-	return ta.ld;
-}
- 
+	long_double_t res;
+	
+	res.data = long_to_long_double(i);
+	return res.val;
+}
+
 float __floattisf(long long i)
 {
-	float32 fa;
-	
-	fa = longlong_to_float32(i);
-	return fa.f;
+	float_t res;
+	
+	res.data = llong_to_float(i);
+	return res.val;
 }
 
 double __floattidf(long long i)
 {
-	float64 da;
-	
-	da = longlong_to_float64(i);
-	return da.d;
+	double_t res;
+	
+	res.data = llong_to_double(i);
+	return res.val;
 }
 
 long double __floattitf(long long i)
 {
-	float128 ta;
-
-	ta = longlong_to_float128(i);
-	return ta.ld;
+	long_double_t res;
+	
+	res.data = llong_to_long_double(i);
+	return res.val;
 }
 
 float __floatunsisf(unsigned int i)
 {
-	float32 fa;
-	
-	fa = uint_to_float32(i);
-	return fa.f;
+	float_t res;
+	
+	res.data = uint_to_float(i);
+	return res.val;
 }
 
 double __floatunsidf(unsigned int i)
 {
-	float64 da;
-	
-	da = uint_to_float64(i);
-	return da.d;
+	double_t res;
+	
+	res.data = uint_to_double(i);
+	return res.val;
 }
 
 long double __floatunsitf(unsigned int i)
 {
-	float128 ta;
-
-	ta = uint_to_float128(i);
-	return ta.ld;
+	long_double_t res;
+	
+	res.data = uint_to_long_double(i);
+	return res.val;
 }
  
 float __floatundisf(unsigned long i)
 {
-	float32 fa;
-	
-	fa = ulong_to_float32(i);
-	return fa.f;
+	float_t res;
+	
+	res.data = ulong_to_float(i);
+	return res.val;
 }
 
 double __floatundidf(unsigned long i)
 {
-	float64 da;
-	
-	da = ulong_to_float64(i);
-	return da.d;
+	double_t res;
+	
+	res.data = ulong_to_double(i);
+	return res.val;
 }
 
 long double __floatunditf(unsigned long i)
 {
-	float128 ta;
-
-	ta = ulong_to_float128(i);
-	return ta.ld;
+	long_double_t res;
+	
+	res.data = ulong_to_long_double(i);
+	return res.val;
 }
  
 float __floatuntisf(unsigned long long i)
 {
-	float32 fa;
-	
-	fa = ulonglong_to_float32(i);
-	return fa.f;
+	float_t res;
+	
+	res.data = ullong_to_float(i);
+	return res.val;
 }
 
 double __floatuntidf(unsigned long long i)
 {
-	float64 da;
-	
-	da = ulonglong_to_float64(i);
-	return da.d;
+	double_t res;
+	
+	res.data = ullong_to_double(i);
+	return res.val;
 }
 
 long double __floatuntitf(unsigned long long i)
 {
-	float128 ta;
-
-	ta = ulonglong_to_float128(i);
-	return ta.ld;
+	long_double_t res;
+	
+	res.data = ullong_to_long_double(i);
+	return res.val;
 }
 
@@ -544,20 +659,21 @@
 int __cmpsf2(float a, float b) 
 {
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-
-	if ((isFloat32NaN(fa)) || (isFloat32NaN(fb))) {
-		return 1; /* no special constant for unordered - maybe signaled? */
-	}
-	
-	if (isFloat32eq(fa, fb)) {
-		return 0;
-	}
-	
-	if (isFloat32lt(fa, fb)) {
-		return -1;
-	}
-
+	float_t fa;
+	float_t fb;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if ((is_float_nan(fa.data)) || (is_float_nan(fb.data))) {
+		/* no special constant for unordered - maybe signaled? */
+		return 1;
+	}
+	
+	if (is_float_eq(fa.data, fb.data))
+		return 0;
+	
+	if (is_float_lt(fa.data, fb.data))
+		return -1;
+	
 	return 1;
 }
@@ -565,20 +681,21 @@
 int __cmpdf2(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-
-	if ((isFloat64NaN(da)) || (isFloat64NaN(db))) {
-		return 1; /* no special constant for unordered - maybe signaled? */
-	}
-
-	if (isFloat64eq(da, db)) {
-		return 0;
-	}
-
-	if (isFloat64lt(da, db)) {
-		return -1;
-	}
-
+	double_t da;
+	double_t db;
+	
+	da.val = a;
+	db.val = b;
+	
+	if ((is_double_nan(da.data)) || (is_double_nan(db.data))) {
+		/* no special constant for unordered - maybe signaled? */
+		return 1;
+	}
+	
+	if (is_double_eq(da.data, db.data))
+		return 0;
+	
+	if (is_double_lt(da.data, db.data))
+		return -1;
+	
 	return 1;
 }
@@ -586,84 +703,106 @@
 int __cmptf2(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		return 1; /* no special constant for unordered - maybe signaled? */
-	}
-
-	if (isFloat128eq(ta, tb)) {
-		return 0;
-	}
-
-	if (isFloat128lt(ta, tb)) {
-		return -1;
-	}
-
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data))) {
+		/* no special constant for unordered - maybe signaled? */
+		return 1;
+	}
+	
+	if (is_long_double_eq(ta.data, tb.data))
+		return 0;
+	
+	if (is_long_double_lt(ta.data, tb.data))
+		return -1;
+	
 	return 1;
 }
 
-int __unordsf2(float a, float b) 
-{
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-	return ((isFloat32NaN(fa)) || (isFloat32NaN(fb)));
+int __unordsf2(float a, float b)
+{
+	float_t fa;
+	float_t fb;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	return ((is_float_nan(fa.data)) || (is_float_nan(fb.data)));
 }
 
 int __unorddf2(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-	return ((isFloat64NaN(da)) || (isFloat64NaN(db)));
+	double_t da;
+	double_t db;
+	
+	da.val = a;
+	db.val = b;
+	
+	return ((is_double_nan(da.data)) || (is_double_nan(db.data)));
 }
 
 int __unordtf2(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-	return ((isFloat128NaN(ta)) || (isFloat128NaN(tb)));
-}
-
-int __eqsf2(float a, float b) 
-{
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-	if ((isFloat32NaN(fa)) || (isFloat32NaN(fb))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-	return isFloat32eq(fa, fb) - 1;
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	return ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)));
+}
+
+int __eqsf2(float a, float b)
+{
+	float_t fa;
+	float_t fb;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if ((is_float_nan(fa.data)) || (is_float_nan(fb.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	return is_float_eq(fa.data, fb.data) - 1;
 }
 
 int __eqdf2(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-	if ((isFloat64NaN(da)) || (isFloat64NaN(db))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-	return isFloat64eq(da, db) - 1;
+	double_t da;
+	double_t db;
+	
+	da.val = a;
+	db.val = b;
+	
+	if ((is_double_nan(da.data)) || (is_double_nan(db.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	return is_double_eq(da.data, db.data) - 1;
 }
 
 int __eqtf2(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-	return isFloat128eq(ta, tb) - 1;
-}
-
-int __nesf2(float a, float b) 
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	return is_long_double_eq(ta.data, tb.data) - 1;
+}
+
+int __nesf2(float a, float b)
 {
 	/* strange behavior, but it was in gcc documentation */
@@ -685,20 +824,20 @@
 int __gesf2(float a, float b)
 {
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-
-	if ((isFloat32NaN(fa)) || (isFloat32NaN(fb))) {
-		/* TODO: sigNaNs */
-		return -1;
-	}
-	
-	if (isFloat32eq(fa, fb)) {
-		return 0;
-	}
-	
-	if (isFloat32gt(fa, fb)) {
-		return 1;
-	}
+	float_t fa;
+	float_t fb;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if ((is_float_nan(fa.data)) || (is_float_nan(fb.data))) {
+		// TODO: sigNaNs
+		return -1;
+	}
+	
+	if (is_float_eq(fa.data, fb.data))
+		return 0;
+	
+	if (is_float_gt(fa.data, fb.data))
+		return 1;
 	
 	return -1;
@@ -707,21 +846,21 @@
 int __gedf2(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-
-	if ((isFloat64NaN(da)) || (isFloat64NaN(db))) {
-		/* TODO: sigNaNs */
-		return -1;
-	}
-
-	if (isFloat64eq(da, db)) {
-		return 0;
-	}
-
-	if (isFloat64gt(da, db)) {
-		return 1;
-	}
-
+	double_t da;
+	double_t db;
+	
+	da.val = a;
+	db.val = b;
+	
+	if ((is_double_nan(da.data)) || (is_double_nan(db.data))) {
+		// TODO: sigNaNs
+		return -1;
+	}
+	
+	if (is_double_eq(da.data, db.data))
+		return 0;
+	
+	if (is_double_gt(da.data, db.data))
+		return 1;
+	
 	return -1;
 }
@@ -729,21 +868,21 @@
 int __getf2(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		/* TODO: sigNaNs */
-		return -1;
-	}
-
-	if (isFloat128eq(ta, tb)) {
-		return 0;
-	}
-
-	if (isFloat128gt(ta, tb)) {
-		return 1;
-	}
-
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data))) {
+		// TODO: sigNaNs
+		return -1;
+	}
+	
+	if (is_long_double_eq(ta.data, tb.data))
+		return 0;
+	
+	if (is_long_double_gt(ta.data, tb.data))
+		return 1;
+	
 	return -1;
 }
@@ -751,17 +890,18 @@
 int __ltsf2(float a, float b)
 {
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-
-	if ((isFloat32NaN(fa)) || (isFloat32NaN(fb))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-
-	if (isFloat32lt(fa, fb)) {
-		return -1;
-	}
-
+	float_t fa;
+	float_t fb;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if ((is_float_nan(fa.data)) || (is_float_nan(fb.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	if (is_float_lt(fa.data, fb.data))
+		return -1;
+	
 	return 0;
 }
@@ -769,17 +909,18 @@
 int __ltdf2(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-
-	if ((isFloat64NaN(da)) || (isFloat64NaN(db))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-
-	if (isFloat64lt(da, db)) {
-		return -1;
-	}
-
+	double_t da;
+	double_t db;
+	
+	da.val = a;
+	db.val = b;
+	
+	if ((is_double_nan(da.data)) || (is_double_nan(db.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	if (is_double_lt(da.data, db.data))
+		return -1;
+	
 	return 0;
 }
@@ -787,17 +928,18 @@
 int __lttf2(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-
-	if (isFloat128lt(ta, tb)) {
-		return -1;
-	}
-
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	if (is_long_double_lt(ta.data, tb.data))
+		return -1;
+	
 	return 0;
 }
@@ -805,20 +947,20 @@
 int __lesf2(float a, float b)
 {
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-
-	if ((isFloat32NaN(fa)) || (isFloat32NaN(fb))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-	
-	if (isFloat32eq(fa, fb)) {
-		return 0;
-	}
-	
-	if (isFloat32lt(fa, fb)) {
-		return -1;
-	}
+	float_t fa;
+	float_t fb;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if ((is_float_nan(fa.data)) || (is_float_nan(fb.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	if (is_float_eq(fa.data, fb.data))
+		return 0;
+	
+	if (is_float_lt(fa.data, fb.data))
+		return -1;
 	
 	return 1;
@@ -827,21 +969,21 @@
 int __ledf2(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-
-	if ((isFloat64NaN(da)) || (isFloat64NaN(db))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-
-	if (isFloat64eq(da, db)) {
-		return 0;
-	}
-
-	if (isFloat64lt(da, db)) {
-		return -1;
-	}
-
+	double_t da;
+	double_t db;
+	
+	da.val = a;
+	db.val = b;
+	
+	if ((is_double_nan(da.data)) || (is_double_nan(db.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	if (is_double_eq(da.data, db.data))
+		return 0;
+	
+	if (is_double_lt(da.data, db.data))
+		return -1;
+	
 	return 1;
 }
@@ -849,21 +991,21 @@
 int __letf2(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		/* TODO: sigNaNs */
-		return 1;
-	}
-
-	if (isFloat128eq(ta, tb)) {
-		return 0;
-	}
-
-	if (isFloat128lt(ta, tb)) {
-		return -1;
-	}
-
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data))) {
+		// TODO: sigNaNs
+		return 1;
+	}
+	
+	if (is_long_double_eq(ta.data, tb.data))
+		return 0;
+	
+	if (is_long_double_lt(ta.data, tb.data))
+		return -1;
+	
 	return 1;
 }
@@ -871,17 +1013,18 @@
 int __gtsf2(float a, float b)
 {
-	float32 fa, fb;
-	fa.f = a;
-	fb.f = b;
-
-	if ((isFloat32NaN(fa)) || (isFloat32NaN(fb))) {
-		/* TODO: sigNaNs */
-		return -1;
-	}
-
-	if (isFloat32gt(fa, fb)) {
-		return 1;
-	}
-
+	float_t fa;
+	float_t fb;
+	
+	fa.val = a;
+	fb.val = b;
+	
+	if ((is_float_nan(fa.data)) || (is_float_nan(fb.data))) {
+		// TODO: sigNaNs
+		return -1;
+	}
+	
+	if (is_float_gt(fa.data, fb.data))
+		return 1;
+	
 	return 0;
 }
@@ -889,17 +1032,18 @@
 int __gtdf2(double a, double b)
 {
-	float64 da, db;
-	da.d = a;
-	db.d = b;
-
-	if ((isFloat64NaN(da)) || (isFloat64NaN(db))) {
-		/* TODO: sigNaNs */
-		return -1;
-	}
-
-	if (isFloat64gt(da, db)) {
-		return 1;
-	}
-
+	double_t da;
+	double_t db;
+	
+	da.val = a;
+	db.val = b;
+	
+	if ((is_double_nan(da.data)) || (is_double_nan(db.data))) {
+		// TODO: sigNaNs
+		return -1;
+	}
+	
+	if (is_double_gt(da.data, db.data))
+		return 1;
+	
 	return 0;
 }
@@ -907,24 +1051,21 @@
 int __gttf2(long double a, long double b)
 {
-	float128 ta, tb;
-	ta.ld = a;
-	tb.ld = b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		/* TODO: sigNaNs */
-		return -1;
-	}
-
-	if (isFloat128gt(ta, tb)) {
-		return 1;
-	}
-
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = a;
+	tb.val = b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data))) {
+		// TODO: sigNaNs
+		return -1;
+	}
+	
+	if (is_long_double_gt(ta.data, tb.data))
+		return 1;
+	
 	return 0;
 }
 
-
-
-#ifdef SPARC_SOFTFLOAT
-
 /* SPARC quadruple-precision wrappers */
 
@@ -1016,20 +1157,19 @@
 int _Qp_cmp(long double *a, long double *b)
 {
-	float128 ta, tb;
-	ta.ld = *a;
-	tb.ld = *b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = *a;
+	tb.val = *b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)))
 		return 3;
-	}
-
-	if (isFloat128eq(ta, tb)) {
-		return 0;
-	}
-
-	if (isFloat128lt(ta, tb)) {
-		return 1;
-	}
-
+	
+	if (is_long_double_eq(ta.data, tb.data))
+		return 0;
+	
+	if (is_long_double_lt(ta.data, tb.data))
+		return 1;
+	
 	return 2;
 }
@@ -1043,81 +1183,87 @@
 int _Qp_feq(long double *a, long double *b)
 {
-	float128 ta, tb;
-	ta.ld = *a;
-	tb.ld = *b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		return 0;
-	}
-
-	return isFloat128eq(ta, tb);
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = *a;
+	tb.val = *b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)))
+		return 0;
+	
+	return is_long_double_eq(ta.data, tb.data);
 }
 
 int _Qp_fge(long double *a, long double *b)
 {
-	float128 ta, tb;
-	ta.ld = *a;
-	tb.ld = *b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		return 0;
-	}
-
-	return isFloat128eq(ta, tb) || isFloat128gt(ta, tb);
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = *a;
+	tb.val = *b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)))
+		return 0;
+	
+	return is_long_double_eq(ta.data, tb.data) ||
+	    is_long_double_gt(ta.data, tb.data);
 }
 
 int _Qp_fgt(long double *a, long double *b)
 {
-	float128 ta, tb;
-	ta.ld = *a;
-	tb.ld = *b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		return 0;
-	}
-
-	return isFloat128gt(ta, tb);
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = *a;
+	tb.val = *b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)))
+		return 0;
+	
+	return is_long_double_gt(ta.data, tb.data);
 }
 
 int _Qp_fle(long double*a, long double *b)
 {
-	float128 ta, tb;
-	ta.ld = *a;
-	tb.ld = *b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		return 0;
-	}
-
-	return isFloat128eq(ta, tb) || isFloat128lt(ta, tb);
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = *a;
+	tb.val = *b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)))
+		return 0;
+	
+	return is_long_double_eq(ta.data, tb.data) ||
+	    is_long_double_lt(ta.data, tb.data);
 }
 
 int _Qp_flt(long double *a, long double *b)
 {
-	float128 ta, tb;
-	ta.ld = *a;
-	tb.ld = *b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		return 0;
-	}
-
-	return isFloat128lt(ta, tb);
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = *a;
+	tb.val = *b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)))
+		return 0;
+	
+	return is_long_double_lt(ta.data, tb.data);
 }
 
 int _Qp_fne(long double *a, long double *b)
 {
-	float128 ta, tb;
-	ta.ld = *a;
-	tb.ld = *b;
-
-	if ((isFloat128NaN(ta)) || (isFloat128NaN(tb))) {
-		return 1;
-	}
-
-	return !isFloat128eq(ta, tb);
-}
-
-#endif
+	long_double_t ta;
+	long_double_t tb;
+	
+	ta.val = *a;
+	tb.val = *b;
+	
+	if ((is_long_double_nan(ta.data)) || (is_long_double_nan(tb.data)))
+		return 0;
+	
+	return !is_long_double_eq(ta.data, tb.data);
+}
 
 /** @}
Index: uspace/lib/softfloat/generic/sub.c
===================================================================
--- uspace/lib/softfloat/generic/sub.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/generic/sub.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -39,34 +39,38 @@
 #include <common.h>
 
-/**
- * Subtract two single-precision floats with the same signs.
+/** Subtract two single-precision floats with the same sign.
  *
  * @param a First input operand.
  * @param b Second input operand.
+ *
  * @return Result of substraction.
- */
-float32 subFloat32(float32 a, float32 b)
+ *
+ */
+float32 sub_float32(float32 a, float32 b)
 {
 	int expdiff;
 	uint32_t exp1, exp2, frac1, frac2;
 	float32 result;
-
-	result.f = 0;
+	
+	result.bin = 0;
 	
 	expdiff = a.parts.exp - b.parts.exp;
-	if ((expdiff < 0 ) || ((expdiff == 0) && (a.parts.fraction < b.parts.fraction))) {
-		if (isFloat32NaN(b)) {
-			/* TODO: fix SigNaN */
-			if (isFloat32SigNaN(b)) {
-			}
-			return b;
-		}
-		
-		if (b.parts.exp == FLOAT32_MAX_EXPONENT) { 
-			b.parts.sign = !b.parts.sign; /* num -(+-inf) = -+inf */
-			return b;
-		}
-		
-		result.parts.sign = !a.parts.sign; 
+	if ((expdiff < 0 ) || ((expdiff == 0) &&
+	    (a.parts.fraction < b.parts.fraction))) {
+		if (is_float32_nan(b)) {
+			if (is_float32_signan(b)) {
+				// TODO: fix SigNaN
+			}
+			
+			return b;
+		}
+		
+		if (b.parts.exp == FLOAT32_MAX_EXPONENT) {
+			/* num -(+-inf) = -+inf */
+			b.parts.sign = !b.parts.sign;
+			return b;
+		}
+		
+		result.parts.sign = !a.parts.sign;
 		
 		frac1 = b.parts.fraction;
@@ -76,18 +80,20 @@
 		expdiff *= -1;
 	} else {
-		if (isFloat32NaN(a)) {
-			/* TODO: fix SigNaN */
-			if (isFloat32SigNaN(a) || isFloat32SigNaN(b)) {
-			}
-			return a;
-		}
-		
-		if (a.parts.exp == FLOAT32_MAX_EXPONENT) { 
+		if (is_float32_nan(a)) {
+			if ((is_float32_signan(a)) || (is_float32_signan(b))) {
+				// TODO: fix SigNaN
+			}
+			
+			return a;
+		}
+		
+		if (a.parts.exp == FLOAT32_MAX_EXPONENT) {
 			if (b.parts.exp == FLOAT32_MAX_EXPONENT) {
 				/* inf - inf => nan */
-				/* TODO: fix exception */
-				result.binary = FLOAT32_NAN;
+				// TODO: fix exception
+				result.bin = FLOAT32_NAN;
 				return result;
 			}
+			
 			return a;
 		}
@@ -98,5 +104,5 @@
 		exp1 = a.parts.exp;
 		frac2 = b.parts.fraction;
-		exp2 = b.parts.exp;	
+		exp2 = b.parts.exp;
 	}
 	
@@ -105,17 +111,18 @@
 		result.parts.fraction = frac1 - frac2;
 		if (result.parts.fraction > frac1) {
-			/* TODO: underflow exception */
+			// TODO: underflow exception
 			return result;
 		}
+		
 		result.parts.exp = 0;
 		return result;
 	}
-
+	
 	/* add hidden bit */
-	frac1 |= FLOAT32_HIDDEN_BIT_MASK; 
+	frac1 |= FLOAT32_HIDDEN_BIT_MASK;
 	
 	if (exp2 == 0) {
 		/* denormalized */
-		--expdiff;	
+		--expdiff;
 	} else {
 		/* normalized */
@@ -127,10 +134,9 @@
 	frac2 <<= 6;
 	
-	if (expdiff > FLOAT32_FRACTION_SIZE + 1) {
+	if (expdiff > FLOAT32_FRACTION_SIZE + 1)
 		goto done;
-	}
 	
 	frac1 = frac1 - (frac2 >> expdiff);
-
+	
 done:
 	/* TODO: find first nonzero digit and shift result and detect possibly underflow */
@@ -143,5 +149,5 @@
 	/* rounding - if first bit after fraction is set then round up */
 	frac1 += 0x20;
-
+	
 	if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
 		++exp1;
@@ -150,5 +156,5 @@
 	
 	/* Clear hidden bit and shift */
-	result.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); 
+	result.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK));
 	result.parts.exp = exp1;
 	
@@ -156,12 +162,13 @@
 }
 
-/**
- * Subtract two double-precision floats with the same signs.
+/** Subtract two double-precision floats with the same sign.
  *
  * @param a First input operand.
  * @param b Second input operand.
+ *
  * @return Result of substraction.
- */
-float64 subFloat64(float64 a, float64 b)
+ *
+ */
+float64 sub_float64(float64 a, float64 b)
 {
 	int expdiff;
@@ -169,22 +176,25 @@
 	uint64_t frac1, frac2;
 	float64 result;
-
-	result.d = 0;
+	
+	result.bin = 0;
 	
 	expdiff = a.parts.exp - b.parts.exp;
-	if ((expdiff < 0 ) || ((expdiff == 0) && (a.parts.fraction < b.parts.fraction))) {
-		if (isFloat64NaN(b)) {
-			/* TODO: fix SigNaN */
-			if (isFloat64SigNaN(b)) {
-			}
-			return b;
-		}
-		
-		if (b.parts.exp == FLOAT64_MAX_EXPONENT) { 
-			b.parts.sign = !b.parts.sign; /* num -(+-inf) = -+inf */
-			return b;
-		}
-		
-		result.parts.sign = !a.parts.sign; 
+	if ((expdiff < 0 ) ||
+	    ((expdiff == 0) && (a.parts.fraction < b.parts.fraction))) {
+		if (is_float64_nan(b)) {
+			if (is_float64_signan(b)) {
+				// TODO: fix SigNaN
+			}
+			
+			return b;
+		}
+		
+		if (b.parts.exp == FLOAT64_MAX_EXPONENT) {
+			/* num -(+-inf) = -+inf */
+			b.parts.sign = !b.parts.sign;
+			return b;
+		}
+		
+		result.parts.sign = !a.parts.sign;
 		
 		frac1 = b.parts.fraction;
@@ -194,18 +204,20 @@
 		expdiff *= -1;
 	} else {
-		if (isFloat64NaN(a)) {
-			/* TODO: fix SigNaN */
-			if (isFloat64SigNaN(a) || isFloat64SigNaN(b)) {
-			}
-			return a;
-		}
-		
-		if (a.parts.exp == FLOAT64_MAX_EXPONENT) { 
+		if (is_float64_nan(a)) {
+			if (is_float64_signan(a) || is_float64_signan(b)) {
+				// TODO: fix SigNaN
+			}
+			
+			return a;
+		}
+		
+		if (a.parts.exp == FLOAT64_MAX_EXPONENT) {
 			if (b.parts.exp == FLOAT64_MAX_EXPONENT) {
 				/* inf - inf => nan */
-				/* TODO: fix exception */
-				result.binary = FLOAT64_NAN;
+				// TODO: fix exception
+				result.bin = FLOAT64_NAN;
 				return result;
 			}
+			
 			return a;
 		}
@@ -216,5 +228,5 @@
 		exp1 = a.parts.exp;
 		frac2 = b.parts.fraction;
-		exp2 = b.parts.exp;	
+		exp2 = b.parts.exp;
 	}
 	
@@ -223,17 +235,18 @@
 		result.parts.fraction = frac1 - frac2;
 		if (result.parts.fraction > frac1) {
-			/* TODO: underflow exception */
+			// TODO: underflow exception
 			return result;
 		}
+		
 		result.parts.exp = 0;
 		return result;
 	}
-
+	
 	/* add hidden bit */
-	frac1 |= FLOAT64_HIDDEN_BIT_MASK; 
+	frac1 |= FLOAT64_HIDDEN_BIT_MASK;
 	
 	if (exp2 == 0) {
 		/* denormalized */
-		--expdiff;	
+		--expdiff;
 	} else {
 		/* normalized */
@@ -245,10 +258,9 @@
 	frac2 <<= 6;
 	
-	if (expdiff > FLOAT64_FRACTION_SIZE + 1) {
+	if (expdiff > FLOAT64_FRACTION_SIZE + 1)
 		goto done;
-	}
 	
 	frac1 = frac1 - (frac2 >> expdiff);
-
+	
 done:
 	/* TODO: find first nonzero digit and shift result and detect possibly underflow */
@@ -261,5 +273,5 @@
 	/* rounding - if first bit after fraction is set then round up */
 	frac1 += 0x20;
-
+	
 	if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) {
 		++exp1;
@@ -268,5 +280,5 @@
 	
 	/* Clear hidden bit and shift */
-	result.parts.fraction = ((frac1 >> 6) & (~FLOAT64_HIDDEN_BIT_MASK)); 
+	result.parts.fraction = ((frac1 >> 6) & (~FLOAT64_HIDDEN_BIT_MASK));
 	result.parts.exp = exp1;
 	
@@ -274,12 +286,13 @@
 }
 
-/**
- * Subtract two quadruple-precision floats with the same signs.
+/** Subtract two quadruple-precision floats with the same sign.
  *
  * @param a First input operand.
  * @param b Second input operand.
+ *
  * @return Result of substraction.
- */
-float128 subFloat128(float128 a, float128 b)
+ *
+ */
+float128 sub_float128(float128 a, float128 b)
 {
 	int expdiff;
@@ -287,25 +300,27 @@
 	uint64_t frac1_hi, frac1_lo, frac2_hi, frac2_lo, tmp_hi, tmp_lo;
 	float128 result;
-
-	result.binary.hi = 0;
-	result.binary.lo = 0;
-
+	
+	result.bin.hi = 0;
+	result.bin.lo = 0;
+	
 	expdiff = a.parts.exp - b.parts.exp;
 	if ((expdiff < 0 ) || ((expdiff == 0) &&
 	    lt128(a.parts.frac_hi, a.parts.frac_lo, b.parts.frac_hi, b.parts.frac_lo))) {
-		if (isFloat128NaN(b)) {
-			/* TODO: fix SigNaN */
-			if (isFloat128SigNaN(b)) {
-			}
-			return b;
-		}
-
+		if (is_float128_nan(b)) {
+			if (is_float128_signan(b)) {
+				// TODO: fix SigNaN
+			}
+			
+			return b;
+		}
+		
 		if (b.parts.exp == FLOAT128_MAX_EXPONENT) {
-			b.parts.sign = !b.parts.sign; /* num -(+-inf) = -+inf */
-			return b;
-		}
-
+			/* num -(+-inf) = -+inf */
+			b.parts.sign = !b.parts.sign;
+			return b;
+		}
+		
 		result.parts.sign = !a.parts.sign;
-
+		
 		frac1_hi = b.parts.frac_hi;
 		frac1_lo = b.parts.frac_lo;
@@ -316,24 +331,25 @@
 		expdiff *= -1;
 	} else {
-		if (isFloat128NaN(a)) {
-			/* TODO: fix SigNaN */
-			if (isFloat128SigNaN(a) || isFloat128SigNaN(b)) {
-			}
-			return a;
-		}
-
+		if (is_float128_nan(a)) {
+			if (is_float128_signan(a) || is_float128_signan(b)) {
+				// TODO: fix SigNaN
+			}
+			
+			return a;
+		}
+		
 		if (a.parts.exp == FLOAT128_MAX_EXPONENT) {
 			if (b.parts.exp == FLOAT128_MAX_EXPONENT) {
 				/* inf - inf => nan */
-				/* TODO: fix exception */
-				result.binary.hi = FLOAT128_NAN_HI;
-				result.binary.lo = FLOAT128_NAN_LO;
+				// TODO: fix exception
+				result.bin.hi = FLOAT128_NAN_HI;
+				result.bin.lo = FLOAT128_NAN_LO;
 				return result;
 			}
 			return a;
 		}
-
+		
 		result.parts.sign = a.parts.sign;
-
+		
 		frac1_hi = a.parts.frac_hi;
 		frac1_lo = a.parts.frac_lo;
@@ -343,5 +359,5 @@
 		exp2 = b.parts.exp;
 	}
-
+	
 	if (exp1 == 0) {
 		/* both are denormalized */
@@ -350,16 +366,17 @@
 		result.parts.frac_lo = tmp_lo;
 		if (lt128(frac1_hi, frac1_lo, result.parts.frac_hi, result.parts.frac_lo)) {
-			/* TODO: underflow exception */
+			// TODO: underflow exception
 			return result;
 		}
+		
 		result.parts.exp = 0;
 		return result;
 	}
-
+	
 	/* add hidden bit */
 	or128(frac1_hi, frac1_lo,
 	    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
 	    &frac1_hi, &frac1_lo);
-
+	
 	if (exp2 == 0) {
 		/* denormalized */
@@ -371,16 +388,15 @@
 		    &frac2_hi, &frac2_lo);
 	}
-
+	
 	/* create some space for rounding */
 	lshift128(frac1_hi, frac1_lo, 6, &frac1_hi, &frac1_lo);
 	lshift128(frac2_hi, frac2_lo, 6, &frac2_hi, &frac2_lo);
-
-	if (expdiff > FLOAT128_FRACTION_SIZE + 1) {
+	
+	if (expdiff > FLOAT128_FRACTION_SIZE + 1)
 		goto done;
-	}
-
+	
 	rshift128(frac2_hi, frac2_lo, expdiff, &tmp_hi, &tmp_lo);
 	sub128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &frac1_hi, &frac1_lo);
-
+	
 done:
 	/* TODO: find first nonzero digit and shift result and detect possibly underflow */
@@ -392,13 +408,13 @@
 		lshift128(frac1_hi, frac1_lo, 1, &frac1_hi, &frac1_lo);
 		/* TODO: fix underflow - frac1 == 0 does not necessary means underflow... */
-
+		
 		lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 6,
 		    &tmp_hi, &tmp_lo);
 		and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
 	}
-
+	
 	/* rounding - if first bit after fraction is set then round up */
 	add128(frac1_hi, frac1_lo, 0x0ll, 0x20ll, &frac1_hi, &frac1_lo);
-
+	
 	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 7,
 	   &tmp_hi, &tmp_lo);
@@ -408,5 +424,5 @@
 		rshift128(frac1_hi, frac1_lo, 1, &frac1_hi, &frac1_lo);
 	}
-
+	
 	/* Clear hidden bit and shift */
 	rshift128(frac1_hi, frac1_lo, 6, &frac1_hi, &frac1_lo);
@@ -416,7 +432,7 @@
 	result.parts.frac_hi = tmp_hi;
 	result.parts.frac_lo = tmp_lo;
-
+	
 	result.parts.exp = exp1;
-
+	
 	return result;
 }
Index: uspace/lib/softfloat/include/add.h
===================================================================
--- uspace/lib/softfloat/include/add.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/add.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -37,7 +37,8 @@
 #define __ADD_H__
 
-extern float32 addFloat32(float32, float32);
-extern float64 addFloat64(float64, float64);
-extern float128 addFloat128(float128, float128);
+extern float32 add_float32(float32, float32);
+extern float64 add_float64(float64, float64);
+extern float96 add_float96(float96, float96);
+extern float128 add_float128(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/common.h
===================================================================
--- uspace/lib/softfloat/include/common.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/common.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -39,14 +39,14 @@
 #include <sftypes.h>
 
-extern float64 finishFloat64(int32_t, uint64_t, char);
-extern float128 finishFloat128(int32_t, uint64_t, uint64_t, char, uint64_t);
+extern float64 finish_float64(int32_t, uint64_t, char);
+extern float128 finish_float128(int32_t, uint64_t, uint64_t, char, uint64_t);
 
-extern int countZeroes8(uint8_t);
-extern int countZeroes32(uint32_t);
-extern int countZeroes64(uint64_t);
+extern int count_zeroes8(uint8_t);
+extern int count_zeroes32(uint32_t);
+extern int count_zeroes64(uint64_t);
 
-extern void roundFloat32(int32_t *, uint32_t *);
-extern void roundFloat64(int32_t *, uint64_t *);
-extern void roundFloat128(int32_t *, uint64_t *, uint64_t *);
+extern void round_float32(int32_t *, uint32_t *);
+extern void round_float64(int32_t *, uint64_t *);
+extern void round_float128(int32_t *, uint64_t *, uint64_t *);
 
 extern void lshift128(uint64_t, uint64_t, int, uint64_t *, uint64_t *);
Index: uspace/lib/softfloat/include/comparison.h
===================================================================
--- uspace/lib/softfloat/include/comparison.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/comparison.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -37,33 +37,43 @@
 #define __COMPARISON_H__
 
-extern int isFloat32NaN(float32);
-extern int isFloat32SigNaN(float32);
+extern int is_float32_nan(float32);
+extern int is_float32_signan(float32);
 
-extern int isFloat32Infinity(float32);
-extern int isFloat32Zero(float32);
+extern int is_float32_infinity(float32);
+extern int is_float32_zero(float32);
 
-extern int isFloat32eq(float32, float32);
-extern int isFloat32lt(float32, float32);
-extern int isFloat32gt(float32, float32);
+extern int is_float32_eq(float32, float32);
+extern int is_float32_lt(float32, float32);
+extern int is_float32_gt(float32, float32);
 
-extern int isFloat64NaN(float64);
-extern int isFloat64SigNaN(float64);
+extern int is_float64_nan(float64);
+extern int is_float64_signan(float64);
 
-extern int isFloat64Infinity(float64);
-extern int isFloat64Zero(float64);
+extern int is_float64_infinity(float64);
+extern int is_float64_zero(float64);
 
-extern int isFloat64eq(float64, float64);
-extern int isFloat64lt(float64, float64);
-extern int isFloat64gt(float64, float64);
+extern int is_float64_eq(float64, float64);
+extern int is_float64_lt(float64, float64);
+extern int is_float64_gt(float64, float64);
 
-extern int isFloat128NaN(float128);
-extern int isFloat128SigNaN(float128);
+extern int is_float96_nan(float96);
+extern int is_float96_signan(float96);
 
-extern int isFloat128Infinity(float128);
-extern int isFloat128Zero(float128);
+extern int is_float96_infinity(float96);
+extern int is_float96_zero(float96);
 
-extern int isFloat128eq(float128, float128);
-extern int isFloat128lt(float128, float128);
-extern int isFloat128gt(float128, float128);
+extern int is_float96_eq(float96, float96);
+extern int is_float96_lt(float96, float96);
+extern int is_float96_gt(float96, float96);
+
+extern int is_float128_nan(float128);
+extern int is_float128_signan(float128);
+
+extern int is_float128_infinity(float128);
+extern int is_float128_zero(float128);
+
+extern int is_float128_eq(float128, float128);
+extern int is_float128_lt(float128, float128);
+extern int is_float128_gt(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/conversion.h
===================================================================
--- uspace/lib/softfloat/include/conversion.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/conversion.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -37,13 +37,17 @@
 #define __CONVERSION_H__
 
-extern float64 convertFloat32ToFloat64(float32);
-extern float128 convertFloat32ToFloat128(float32);
-extern float128 convertFloat64ToFloat128(float64);
+extern float64 float32_to_float64(float32);
+extern float96 float32_to_float96(float32);
+extern float128 float32_to_float128(float32);
+extern float96 float64_to_float96(float64);
+extern float128 float64_to_float128(float64);
+extern float128 float96_to_float128(float96);
 
-
-extern float32 convertFloat64ToFloat32(float64);
-extern float32 convertFloat128ToFloat32(float128);
-extern float64 convertFloat128ToFloat64(float128);
-
+extern float32 float64_to_float32(float64);
+extern float32 float96_to_float32(float96);
+extern float64 float96_to_float64(float96);
+extern float32 float128_to_float32(float128);
+extern float64 float128_to_float64(float128);
+extern float96 float128_to_float96(float128);
 
 extern uint32_t float32_to_uint32(float32);
@@ -59,4 +63,10 @@
 extern int64_t float64_to_int64(float64);
 
+extern uint32_t float96_to_uint32(float96);
+extern int32_t float96_to_int32(float96);
+
+extern uint64_t float96_to_uint64(float96);
+extern int64_t float96_to_int64(float96);
+
 extern uint32_t float128_to_uint32(float128);
 extern int32_t float128_to_int32(float128);
@@ -64,5 +74,4 @@
 extern uint64_t float128_to_uint64(float128);
 extern int64_t float128_to_int64(float128);
-
 
 extern float32 uint32_to_float32(uint32_t);
@@ -78,4 +87,10 @@
 extern float64 int64_to_float64(int64_t);
 
+extern float96 uint32_to_float96(uint32_t);
+extern float96 int32_to_float96(int32_t);
+
+extern float96 uint64_to_float96(uint64_t);
+extern float96 int64_to_float96(int64_t);
+
 extern float128 uint32_to_float128(uint32_t);
 extern float128 int32_to_float128(int32_t);
Index: uspace/lib/softfloat/include/div.h
===================================================================
--- uspace/lib/softfloat/include/div.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/div.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -37,7 +37,8 @@
 #define __DIV_H__
 
-extern float32 divFloat32(float32, float32);
-extern float64 divFloat64(float64, float64);
-extern float128 divFloat128(float128, float128);
+extern float32 div_float32(float32, float32);
+extern float64 div_float64(float64, float64);
+extern float96 div_float96(float96, float96);
+extern float128 div_float128(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/mul.h
===================================================================
--- uspace/lib/softfloat/include/mul.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/mul.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -37,7 +37,8 @@
 #define __MUL_H__
 
-extern float32 mulFloat32(float32, float32);
-extern float64 mulFloat64(float64, float64);
-extern float128 mulFloat128(float128, float128);
+extern float32 mul_float32(float32, float32);
+extern float64 mul_float64(float64, float64);
+extern float96 mul_float96(float96, float96);
+extern float128 mul_float128(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/sftypes.h
===================================================================
--- uspace/lib/softfloat/include/sftypes.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/sftypes.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -40,112 +40,566 @@
 #include <stdint.h>
 
-typedef union {
-	float f;
-	uint32_t binary;
-	
-	struct {
+/*
+ * For recognizing NaNs or infinity use specialized comparison
+ * functions, comparing with these constants is not sufficient.
+ */
+
+#define FLOAT32_NAN     UINT32_C(0x7FC00001)
+#define FLOAT32_SIGNAN  UINT32_C(0x7F800001)
+#define FLOAT32_INF     UINT32_C(0x7F800000)
+
+#define FLOAT64_NAN     UINT64_C(0x7FF8000000000001)
+#define FLOAT64_SIGNAN  UINT64_C(0x7FF0000000000001)
+#define FLOAT64_INF     UINT64_C(0x7FF0000000000000)
+
+#define FLOAT96_NAN_HI     UINT64_C(0x7FFF80000000)
+#define FLOAT96_NAN_LO     UINT32_C(0x00010000)
+#define FLOAT96_SIGNAN_HI  UINT64_C(0x7FFF00000000)
+#define FLOAT96_SIGNAN_LO  UINT32_C(0x00010000)
+
+#define FLOAT128_NAN_HI     UINT64_C(0x7FFF800000000000)
+#define FLOAT128_NAN_LO     UINT64_C(0x0000000000000001)
+#define FLOAT128_SIGNAN_HI  UINT64_C(0x7FFF000000000000)
+#define FLOAT128_SIGNAN_LO  UINT64_C(0x0000000000000001)
+#define FLOAT128_INF_HI     UINT64_C(0x7FFF000000000000)
+#define FLOAT128_INF_LO     UINT64_C(0x0000000000000000)
+
+#define FLOAT32_FRACTION_SIZE   23
+#define FLOAT64_FRACTION_SIZE   52
+#define FLOAT96_FRACTION_SIZE   64
+#define FLOAT128_FRACTION_SIZE  112
+#define FLOAT128_FRAC_HI_SIZE   48
+#define FLOAT128_FRAC_LO_SIZE   64
+
+#define FLOAT32_HIDDEN_BIT_MASK      UINT32_C(0x800000)
+#define FLOAT64_HIDDEN_BIT_MASK      UINT64_C(0x10000000000000)
+#define FLOAT128_HIDDEN_BIT_MASK_HI  UINT64_C(0x1000000000000)
+#define FLOAT128_HIDDEN_BIT_MASK_LO  UINT64_C(0x0000000000000000)
+
+#define FLOAT32_MAX_EXPONENT   0xFF
+#define FLOAT64_MAX_EXPONENT   0x7FF
+#define FLOAT96_MAX_EXPONENT   0x7FFF
+#define FLOAT128_MAX_EXPONENT  0x7FFF
+
+#define FLOAT32_BIAS   0x7F
+#define FLOAT64_BIAS   0x3FF
+#define FLOAT96_BIAS   0x3FFF
+#define FLOAT128_BIAS  0x3FFF
+
 #if defined(__BE__)
+
+typedef union {
+	uint32_t bin;
+	
+	struct {
 		uint32_t sign : 1;
 		uint32_t exp : 8;
 		uint32_t fraction : 23;
-#elif defined(__LE__)
-		uint32_t fraction : 23;
-		uint32_t exp : 8;
-		uint32_t sign : 1;
-#else
-	#error Unknown endianess
-#endif
-	} parts __attribute__ ((packed));
+	} parts __attribute__((packed));
 } float32;
 
 typedef union {
-	double d;
-	uint64_t binary;
-	
-	struct {
-#if defined(__BE__)
+	uint64_t bin;
+	
+	struct {
 		uint64_t sign : 1;
 		uint64_t exp : 11;
 		uint64_t fraction : 52;
-#elif defined(__LE__)
-		uint64_t fraction : 52;
-		uint64_t exp : 11;
+	} parts __attribute__((packed));
+} float64;
+
+typedef union {
+	struct {
+		uint64_t hi;
+		uint32_t lo;
+	} bin __attribute__((packed));
+	
+	struct {
+		uint64_t padding : 16;
 		uint64_t sign : 1;
-#else
-	#error Unknown endianess
-#endif
-	} parts __attribute__ ((packed));
-} float64;
-
-typedef union {
-	long double ld;
-	struct {
-#if defined(__BE__)
+		uint64_t exp : 15;
+		uint64_t fraction : 64;
+	} parts __attribute__((packed));
+} float96;
+
+typedef union {
+	struct {
 		uint64_t hi;
 		uint64_t lo;
-#elif defined(__LE__)
-		uint64_t lo;
-		uint64_t hi;
-#else
-	#error Unknown endianess
-#endif
-	} binary;
-
-	struct {
-#if defined(__BE__)
+	} bin __attribute__((packed));
+	
+	struct {
 		uint64_t sign : 1;
 		uint64_t exp : 15;
 		uint64_t frac_hi : 48;
 		uint64_t frac_lo : 64;
+	} parts __attribute__((packed));
+} float128;
+
 #elif defined(__LE__)
+
+typedef union {
+	uint32_t bin;
+	
+	struct {
+		uint32_t fraction : 23;
+		uint32_t exp : 8;
+		uint32_t sign : 1;
+	} parts __attribute__((packed));
+} float32;
+
+typedef union {
+	uint64_t bin;
+	
+	struct {
+		uint64_t fraction : 52;
+		uint64_t exp : 11;
+		uint64_t sign : 1;
+	} parts __attribute__((packed));
+} float64;
+
+typedef union {
+	struct {
+		uint32_t lo;
+		uint64_t hi;
+	} bin __attribute__((packed));
+	
+	struct {
+		uint64_t fraction : 64;
+		uint64_t exp : 15;
+		uint64_t sign : 1;
+		uint64_t padding : 16;
+	} parts __attribute__((packed));
+} float96;
+
+typedef union {
+	struct {
+		uint64_t lo;
+		uint64_t hi;
+	} bin __attribute__((packed));
+	
+	struct {
 		uint64_t frac_lo : 64;
 		uint64_t frac_hi : 48;
 		uint64_t exp : 15;
 		uint64_t sign : 1;
+	} parts __attribute__((packed));
+} float128;
+
 #else
 	#error Unknown endianess
 #endif
-	} parts __attribute__ ((packed));
-} float128;
-
-/*
- * For recognizing NaNs or infinity use specialized comparison functions,
- * comparing with these constants is not sufficient.
- */
-
-#define FLOAT32_NAN     0x7FC00001
-#define FLOAT32_SIGNAN  0x7F800001
-#define FLOAT32_INF     0x7F800000
-
-#define FLOAT64_NAN     0x7FF8000000000001ll
-#define FLOAT64_SIGNAN  0x7FF0000000000001ll
-#define FLOAT64_INF     0x7FF0000000000000ll
-
-#define FLOAT128_NAN_HI     0x7FFF800000000000ll
-#define FLOAT128_NAN_LO     0x0000000000000001ll
-#define FLOAT128_SIGNAN_HI  0x7FFF000000000000ll
-#define FLOAT128_SIGNAN_LO  0x0000000000000001ll
-#define FLOAT128_INF_HI     0x7FFF000000000000ll
-#define FLOAT128_INF_LO     0x0000000000000000ll
-
-#define FLOAT32_FRACTION_SIZE   23
-#define FLOAT64_FRACTION_SIZE   52
-#define FLOAT128_FRACTION_SIZE 112
-#define FLOAT128_FRAC_HI_SIZE   48
-#define FLOAT128_FRAC_LO_SIZE   64
-
-#define FLOAT32_HIDDEN_BIT_MASK      0x800000
-#define FLOAT64_HIDDEN_BIT_MASK      0x10000000000000ll
-#define FLOAT128_HIDDEN_BIT_MASK_HI  0x1000000000000ll
-#define FLOAT128_HIDDEN_BIT_MASK_LO  0x0000000000000000ll
-
-#define FLOAT32_MAX_EXPONENT  0xFF
-#define FLOAT64_MAX_EXPONENT  0x7FF
-#define FLOAT128_MAX_EXPONENT 0x7FFF
-
-#define FLOAT32_BIAS  0x7F
-#define FLOAT64_BIAS  0x3FF
-#define FLOAT80_BIAS  0x3FFF
-#define FLOAT128_BIAS 0x3FFF
+
+typedef union {
+	float val;
+	
+#if defined(FLOAT_SIZE_32)
+	float32 data;
+#elif defined(FLOAT_SIZE_64)
+	float64 data;
+#elif defined(FLOAT_SIZE_96)
+	float96 data;
+#elif defined(FLOAT_SIZE_128)
+	float128 data;
+#else
+	#error Unsupported float size
+#endif
+} float_t;
+
+typedef union {
+	double val;
+	
+#if defined(DOUBLE_SIZE_32)
+	float32 data;
+#elif defined(DOUBLE_SIZE_64)
+	float64 data;
+#elif defined(DOUBLE_SIZE_96)
+	float96 data;
+#elif defined(DOUBLE_SIZE_128)
+	float128 data;
+#else
+	#error Unsupported double size
+#endif
+} double_t;
+
+typedef union {
+	long double val;
+	
+#if defined(LONG_DOUBLE_SIZE_32)
+	float32 data;
+#elif defined(LONG_DOUBLE_SIZE_64)
+	float64 data;
+#elif defined(LONG_DOUBLE_SIZE_96)
+	float96 data;
+#elif defined(LONG_DOUBLE_SIZE_128)
+	float128 data;
+#else
+	#error Unsupported long double size
+#endif
+} long_double_t;
+
+
+#if defined(INT_SIZE_8)
+
+#define _to_int   _to_int8
+#define from_int  int8
+
+#elif defined(INT_SIZE_16)
+
+#define _to_int   _to_int16
+#define from_int  int16
+
+#elif defined(INT_SIZE_32)
+
+#define _to_int   _to_int32
+#define from_int  int32
+
+#elif defined(INT_SIZE_64)
+
+#define _to_int   _to_int64
+#define from_int  int64
+
+#endif
+
+
+#if defined(UINT_SIZE_8)
+
+#define _to_uint   _to_uint8
+#define from_uint  uint8
+
+#elif defined(UINT_SIZE_16)
+
+#define _to_uint   _to_uint16
+#define from_uint  uint16
+
+#elif defined(UINT_SIZE_32)
+
+#define _to_uint   _to_uint32
+#define from_uint  uint32
+
+#elif defined(UINT_SIZE_64)
+
+#define _to_uint   _to_uint64
+#define from_uint  uint64
+
+#endif
+
+
+#if defined(LONG_SIZE_8)
+
+#define _to_long   _to_int8
+#define from_long  int8
+
+#elif defined(LONG_SIZE_16)
+
+#define _to_long   _to_int16
+#define from_long  int16
+
+#elif defined(LONG_SIZE_32)
+
+#define _to_long   _to_int32
+#define from_long  int32
+
+#elif defined(LONG_SIZE_64)
+
+#define _to_long   _to_int64
+#define from_long  int64
+
+#endif
+
+
+#if defined(ULONG_SIZE_8)
+
+#define _to_ulong   _to_uint8
+#define from_ulong  uint8
+
+#elif defined(ULONG_SIZE_16)
+
+#define _to_ulong   _to_uint16
+#define from_ulong  uint16
+
+#elif defined(ULONG_SIZE_32)
+
+#define _to_ulong   _to_uint32
+#define from_ulong  uint32
+
+#elif defined(ULONG_SIZE_64)
+
+#define _to_ulong   _to_uint64
+#define from_ulong  uint64
+
+#endif
+
+
+#if defined(LLONG_SIZE_8)
+
+#define _to_llong   _to_int8
+#define from_llong  int8
+
+#elif defined(LLONG_SIZE_16)
+
+#define _to_llong   _to_int16
+#define from_llong  int16
+
+#elif defined(LLONG_SIZE_32)
+
+#define _to_llong   _to_int32
+#define from_llong  int32
+
+#elif defined(LLONG_SIZE_64)
+
+#define _to_llong   _to_int64
+#define from_llong  int64
+
+#endif
+
+
+#if defined(ULLONG_SIZE_8)
+
+#define _to_ullong   _to_uint8
+#define from_ullong  uint8
+
+#elif defined(ULLONG_SIZE_16)
+
+#define _to_ullong   _to_uint16
+#define from_ullong  uint16
+
+#elif defined(ULLONG_SIZE_32)
+
+#define _to_ullong   _to_uint32
+#define from_ullong  uint32
+
+#elif defined(ULLONG_SIZE_64)
+
+#define _to_ullong   _to_uint64
+#define from_ullong  uint64
+
+#endif
+
+
+#if defined(FLOAT_SIZE_32)
+
+#define add_float     add_float32
+#define sub_float     sub_float32
+#define mul_float     mul_float32
+#define div_float     div_float32
+#define _to_float     _to_float32
+#define from_float    float32
+#define is_float_nan  is_float32_nan
+#define is_float_eq   is_float32_eq
+#define is_float_lt   is_float32_lt
+#define is_float_gt   is_float32_gt
+
+#elif defined(FLOAT_SIZE_64)
+
+#define add_float     add_float64
+#define sub_float     sub_float64
+#define mul_float     mul_float64
+#define div_float     div_float64
+#define _to_float     _to_float64
+#define from_float    float64
+#define is_float_nan  is_float64_nan
+#define is_float_eq   is_float64_eq
+#define is_float_lt   is_float64_lt
+#define is_float_gt   is_float64_gt
+
+#elif defined(FLOAT_SIZE_96)
+
+#define add_float     add_float96
+#define sub_float     sub_float96
+#define mul_float     mul_float96
+#define div_float     div_float96
+#define _to_float     _to_float96
+#define from_float    float96
+#define is_float_nan  is_float96_nan
+#define is_float_eq   is_float96_eq
+#define is_float_lt   is_float96_lt
+#define is_float_gt   is_float96_gt
+
+#elif defined(FLOAT_SIZE_128)
+
+#define add_float     add_float128
+#define sub_float     sub_float128
+#define mul_float     mul_float128
+#define div_float     div_float128
+#define _to_float     _to_float128
+#define from_float    float128
+#define is_float_nan  is_float128_nan
+#define is_float_eq   is_float128_eq
+#define is_float_lt   is_float128_lt
+#define is_float_gt   is_float128_gt
+
+#endif
+
+
+#if defined(DOUBLE_SIZE_32)
+
+#define add_double     add_float32
+#define sub_double     sub_float32
+#define mul_double     mul_float32
+#define div_double     div_float32
+#define _to_double     _to_float32
+#define from_double    float32
+#define is_double_nan  is_float32_nan
+#define is_double_eq   is_float32_eq
+#define is_double_lt   is_float32_lt
+#define is_double_gt   is_float32_gt
+
+#elif defined(DOUBLE_SIZE_64)
+
+#define add_double     add_float64
+#define sub_double     sub_float64
+#define mul_double     mul_float64
+#define div_double     div_float64
+#define _to_double     _to_float64
+#define from_double    float64
+#define is_double_nan  is_float64_nan
+#define is_double_eq   is_float64_eq
+#define is_double_lt   is_float64_lt
+#define is_double_gt   is_float64_gt
+
+#elif defined(DOUBLE_SIZE_96)
+
+#define add_double     add_float96
+#define sub_double     sub_float96
+#define mul_double     mul_float96
+#define div_double     div_float96
+#define _to_double     _to_float96
+#define from_double    float96
+#define is_double_nan  is_float96_nan
+#define is_double_eq   is_float96_eq
+#define is_double_lt   is_float96_lt
+#define is_double_gt   is_float96_gt
+
+#elif defined(DOUBLE_SIZE_128)
+
+#define add_double     add_float128
+#define sub_double     sub_float128
+#define mul_double     mul_float128
+#define div_double     div_float128
+#define _to_double     _to_float128
+#define from_double    float128
+#define is_double_nan  is_float128_nan
+#define is_double_eq   is_float128_eq
+#define is_double_lt   is_float128_lt
+#define is_double_gt   is_float128_gt
+
+#endif
+
+
+#if defined(LONG_DOUBLE_SIZE_32)
+
+#define add_long_double     add_float32
+#define sub_long_double     sub_float32
+#define mul_long_double     mul_float32
+#define div_long_double     div_float32
+#define _to_long_double     _to_float32
+#define from_long_double    float32
+#define is_long_double_nan  is_float32_nan
+#define is_long_double_eq   is_float32_eq
+#define is_long_double_lt   is_float32_lt
+#define is_long_double_gt   is_float32_gt
+
+#elif defined(LONG_DOUBLE_SIZE_64)
+
+#define add_long_double     add_float64
+#define sub_long_double     sub_float64
+#define mul_long_double     mul_float64
+#define div_long_double     div_float64
+#define _to_long_double     _to_float64
+#define from_long_double    float64
+#define is_long_double_nan  is_float64_nan
+#define is_long_double_eq   is_float64_eq
+#define is_long_double_lt   is_float64_lt
+#define is_long_double_gt   is_float64_gt
+
+#elif defined(LONG_DOUBLE_SIZE_96)
+
+#define add_long_double     add_float96
+#define sub_long_double     sub_float96
+#define mul_long_double     mul_float96
+#define div_long_double     div_float96
+#define _to_long_double     _to_float96
+#define from_long_double    float96
+#define is_long_double_nan  is_float96_nan
+#define is_long_double_eq   is_float96_eq
+#define is_long_double_lt   is_float96_lt
+#define is_long_double_gt   is_float96_gt
+
+#elif defined(LONG_DOUBLE_SIZE_128)
+
+#define add_long_double     add_float128
+#define sub_long_double     sub_float128
+#define mul_long_double     mul_float128
+#define div_long_double     div_float128
+#define _to_long_double     _to_float128
+#define from_long_double    float128
+#define is_long_double_nan  is_float128_nan
+#define is_long_double_eq   is_float128_eq
+#define is_long_double_lt   is_float128_lt
+#define is_long_double_gt   is_float128_gt
+
+#endif
+
+
+#define CONCAT(a, b)       CONCAT_ARGS(a, b)
+#define CONCAT_ARGS(a, b)  a ## b
+
+#define float32_to_float32(arg)    (arg)
+#define float64_to_float64(arg)    (arg)
+#define float96_to_float96(arg)    (arg)
+#define float128_to_float128(arg)  (arg)
+
+#define float_to_double       CONCAT(from_float, _to_double)
+#define float_to_long_double  CONCAT(from_float, _to_long_double)
+#define float_to_int          CONCAT(from_float, _to_int)
+#define float_to_uint         CONCAT(from_float, _to_uint)
+#define float_to_long         CONCAT(from_float, _to_long)
+#define float_to_ulong        CONCAT(from_float, _to_ulong)
+#define float_to_llong        CONCAT(from_float, _to_llong)
+#define float_to_ullong       CONCAT(from_float, _to_ullong)
+
+#define double_to_float        CONCAT(from_double, _to_float)
+#define double_to_long_double  CONCAT(from_double, _to_long_double)
+#define double_to_int          CONCAT(from_double, _to_int)
+#define double_to_uint         CONCAT(from_double, _to_uint)
+#define double_to_long         CONCAT(from_double, _to_long)
+#define double_to_ulong        CONCAT(from_double, _to_ulong)
+#define double_to_llong        CONCAT(from_double, _to_llong)
+#define double_to_ullong       CONCAT(from_double, _to_ullong)
+
+#define long_double_to_float   CONCAT(from_long_double, _to_float)
+#define long_double_to_double  CONCAT(from_long_double, _to_double)
+#define long_double_to_int     CONCAT(from_long_double, _to_int)
+#define long_double_to_uint    CONCAT(from_long_double, _to_uint)
+#define long_double_to_long    CONCAT(from_long_double, _to_long)
+#define long_double_to_ulong   CONCAT(from_long_double, _to_ulong)
+#define long_double_to_llong   CONCAT(from_long_double, _to_llong)
+#define long_double_to_ullong  CONCAT(from_long_double, _to_ullong)
+
+#define int_to_float        CONCAT(from_int, _to_float)
+#define int_to_double       CONCAT(from_int, _to_double)
+#define int_to_long_double  CONCAT(from_int, _to_long_double)
+
+#define uint_to_float        CONCAT(from_uint, _to_float)
+#define uint_to_double       CONCAT(from_uint, _to_double)
+#define uint_to_long_double  CONCAT(from_uint, _to_long_double)
+
+#define long_to_float        CONCAT(from_long, _to_float)
+#define long_to_double       CONCAT(from_long, _to_double)
+#define long_to_long_double  CONCAT(from_long, _to_long_double)
+
+#define ulong_to_float        CONCAT(from_ulong, _to_float)
+#define ulong_to_double       CONCAT(from_ulong, _to_double)
+#define ulong_to_long_double  CONCAT(from_ulong, _to_long_double)
+
+#define llong_to_float        CONCAT(from_llong, _to_float)
+#define llong_to_double       CONCAT(from_llong, _to_double)
+#define llong_to_long_double  CONCAT(from_llong, _to_long_double)
+
+#define ullong_to_float        CONCAT(from_ullong, _to_float)
+#define ullong_to_double       CONCAT(from_ullong, _to_double)
+#define ullong_to_long_double  CONCAT(from_ullong, _to_long_double)
+
 
 #endif
Index: uspace/lib/softfloat/include/softfloat.h
===================================================================
--- uspace/lib/softfloat/include/softfloat.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/softfloat.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -169,8 +169,6 @@
 extern float __powisf2(float, int);
 extern double __powidf2 (double, int);
-extern long double __powitf2 (long double, int);
-extern long double __powixf2 (long double, int);
-
-
+extern long double __powitf2(long double, int);
+extern long double __powixf2(long double, int);
 
 /* SPARC quadruple-precision wrappers */
Index: uspace/lib/softfloat/include/sub.h
===================================================================
--- uspace/lib/softfloat/include/sub.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softfloat/include/sub.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -37,7 +37,8 @@
 #define __SUB_H__
 
-extern float32 subFloat32(float32, float32);
-extern float64 subFloat64(float64, float64);
-extern float128 subFloat128(float128, float128);
+extern float32 sub_float32(float32, float32);
+extern float64 sub_float64(float64, float64);
+extern float96 sub_float96(float96, float96);
+extern float128 sub_float128(float128, float128);
 
 #endif
Index: uspace/lib/softint/generic/division.c
===================================================================
--- uspace/lib/softint/generic/division.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softint/generic/division.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -37,8 +37,9 @@
 #include <division.h>
 
-#define ABSVAL(x) ( (x) > 0 ? (x) : -(x))
-#define SGN(x) ( (x) >= 0 ? 1 : 0 )
-				      
-static unsigned int divandmod32(unsigned int a, unsigned int b, unsigned int *remainder)
+#define ABSVAL(x)  ((x) > 0 ? (x) : -(x))
+#define SGN(x)     ((x) >= 0 ? 1 : 0)
+
+static unsigned int divandmod32(unsigned int a, unsigned int b,
+    unsigned int *remainder)
 {
 	unsigned int result;
@@ -53,29 +54,29 @@
 	}
 	
-	if ( a < b) {
+	if (a < b) {
 		*remainder = a;
 		return 0;
 	}
-
-	for ( ; steps > 0; steps--) {
+	
+	for (; steps > 0; steps--) {
 		/* shift one bit to remainder */
-		*remainder = ( (*remainder) << 1) | (( a >> 31) & 0x1);
+		*remainder = ((*remainder) << 1) | (( a >> 31) & 0x1);
 		result <<= 1;
 		
 		if (*remainder >= b) {
-				*remainder -= b;
-				result |= 0x1;
+			*remainder -= b;
+			result |= 0x1;
 		}
 		a <<= 1;
 	}
-
+	
 	return result;
 }
 
-
-static unsigned long long divandmod64(unsigned long long a, unsigned long long b, unsigned long long *remainder)
+static unsigned long long divandmod64(unsigned long long a,
+    unsigned long long b, unsigned long long *remainder)
 {
 	unsigned long long result;
-	int steps = sizeof(unsigned long long) * 8; 
+	int steps = sizeof(unsigned long long) * 8;
 	
 	*remainder = 0;
@@ -87,45 +88,45 @@
 	}
 	
-	if ( a < b) {
+	if (a < b) {
 		*remainder = a;
 		return 0;
 	}
-
-	for ( ; steps > 0; steps--) {
+	
+	for (; steps > 0; steps--) {
 		/* shift one bit to remainder */
-		*remainder = ( (*remainder) << 1) | ((a >> 63) & 0x1);
+		*remainder = ((*remainder) << 1) | ((a >> 63) & 0x1);
 		result <<= 1;
 		
 		if (*remainder >= b) {
-				*remainder -= b;
-				result |= 0x1;
+			*remainder -= b;
+			result |= 0x1;
 		}
 		a <<= 1;
 	}
-
+	
 	return result;
 }
 
 /* 32bit integer division */
-int __divsi3(int a, int b) 
-{
-	unsigned int rem;
-	int result;
-	
-	result = (int)divandmod32(ABSVAL(a), ABSVAL(b), &rem);
-
-	if ( SGN(a) == SGN(b)) return result;
+int __divsi3(int a, int b)
+{
+	unsigned int rem;
+	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b))
+		return result;
+	
 	return -result;
 }
 
 /* 64bit integer division */
-long long __divdi3(long long a, long long b) 
-{
-	unsigned long long rem;
-	long long result;
-	
-	result = (long long)divandmod64(ABSVAL(a), ABSVAL(b), &rem);
-
-	if ( SGN(a) == SGN(b)) return result;
+long long __divdi3(long long a, long long b)
+{
+	unsigned long long rem;
+	long long result = (long long) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b))
+		return result;
+	
 	return -result;
 }
@@ -141,5 +142,5 @@
 unsigned long long __udivdi3(unsigned long long a, unsigned long long b)
 {
-	unsigned long long  rem;
+	unsigned long long rem;
 	return divandmod64(a, b, &rem);
 }
@@ -152,13 +153,12 @@
 	
 	/* if divident is negative, remainder must be too */
-	if (!(SGN(a))) {
-		return -((int)rem);
-	}
-	
-	return (int)rem;
+	if (!(SGN(a)))
+		return -((int) rem);
+	
+	return (int) rem;
 }
 
 /* 64bit remainder of the signed division */
-long long __moddi3(long long a,long  long b)
+long long __moddi3(long long a, long long b)
 {
 	unsigned long long rem;
@@ -166,9 +166,8 @@
 	
 	/* if divident is negative, remainder must be too */
-	if (!(SGN(a))) {
-		return -((long long)rem);
-	}
-	
-	return (long long)rem;
+	if (!(SGN(a)))
+		return -((long long) rem);
+	
+	return (long long) rem;
 }
 
@@ -189,5 +188,40 @@
 }
 
-unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, unsigned long long *c)
+int __divmodsi3(int a, int b, int *c)
+{
+	unsigned int rem;
+	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
+unsigned int __udivmodsi3(unsigned int a, unsigned int b,
+    unsigned int *c)
+{
+	return divandmod32(a, b, c);
+}
+
+long long __divmoddi3(long long a, long long b, long long *c)
+{
+	unsigned long long rem;
+	long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
+	
+	if (SGN(a) == SGN(b)) {
+		*c = rem;
+		return result;
+	}
+	
+	*c = -rem;
+	return -result;
+}
+
+unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
+    unsigned long long *c)
 {
 	return divandmod64(a, b, c);
Index: uspace/lib/softint/include/comparison.h
===================================================================
--- uspace/lib/softint/include/comparison.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softint/include/comparison.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -38,8 +38,8 @@
 
 /* Signed comparison (a < b => 0, a == b => 1, a > b => 2). */
-int __cmpdi2 (long long a, long long b);
+extern int __cmpdi2(long long, long long);
 
 /* Unsigned comparison (a < b => 0, a == b => 1, a > b => 2). */
-int __ucmpdi2 (unsigned long long a, unsigned long long b);
+extern int __ucmpdi2(unsigned long long, unsigned long long);
 
 #endif
Index: uspace/lib/softint/include/division.h
===================================================================
--- uspace/lib/softint/include/division.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softint/include/division.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -29,5 +29,5 @@
 /** @addtogroup softint
  * @{
- */ 
+ */
 /**
  * @file
@@ -37,30 +37,22 @@
 #define __SOFTINT_DIVISION_H__
 
+extern int __divsi3(int, int);
+extern long long __divdi3(long long, long long);
 
-/* 32bit integer division */
-int __divsi3(int a, int b);
+extern unsigned int __udivsi3(unsigned int, unsigned int);
+extern unsigned long long __udivdi3(unsigned long long, unsigned long long);
 
-/* 64bit integer division */
-long long __divdi3(long long a, long long b);
+extern int __modsi3(int, int);
+extern long long __moddi3(long long, long long);
 
-/* 32bit unsigned integer division */
-unsigned int __udivsi3(unsigned int a, unsigned int b);
+extern unsigned int __umodsi3(unsigned int, unsigned int);
+extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
 
-/* 64bit unsigned integer division */
-unsigned long long __udivdi3(unsigned long long a, unsigned long long b);
+extern int __divmodsi3(int, int, int *);
+extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
 
-/* 32bit remainder of the signed division */
-int __modsi3(int a, int b);
-
-/* 64bit remainder of the signed division */
-long long __moddi3(long long a, long long b);
-
-/* 32bit remainder of the unsigned division */
-unsigned int __umodsi3(unsigned int a, unsigned int b);
-
-/* 64bit remainder of the unsigned division */
-unsigned long long __umoddi3(unsigned long long a, unsigned long long b);
-
-unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, unsigned long long *c); 
+extern long long __divmoddi3(long long, long long, long long *);
+extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
+    unsigned long long *);
 
 #endif
@@ -68,3 +60,2 @@
 /** @}
  */
-
Index: uspace/lib/softint/include/lltype.h
===================================================================
--- uspace/lib/softint/include/lltype.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softint/include/lltype.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -39,6 +39,6 @@
 #include <stdint.h>
 
-#define HALF_BIT_CNT (sizeof(int32_t) * sizeof(char))
-#define WHOLE_BIT_CNT (sizeof(int64_t) * sizeof(char))
+#define HALF_BIT_CNT   (sizeof(int32_t) * sizeof(char))
+#define WHOLE_BIT_CNT  (sizeof(int64_t) * sizeof(char))
 
 #ifdef __BE__
Index: uspace/lib/softint/include/multiplication.h
===================================================================
--- uspace/lib/softint/include/multiplication.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softint/include/multiplication.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -29,5 +29,5 @@
 /** @addtogroup softint
  * @{
- */ 
+ */
 /**
  * @file
@@ -38,5 +38,5 @@
 
 /* 64 bit multiplication */
-long long __muldi3(long long a, long long b);
+extern long long __muldi3(long long, long long);
 
 #endif
Index: uspace/lib/softint/include/shift.h
===================================================================
--- uspace/lib/softint/include/shift.h	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/lib/softint/include/shift.h	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -38,11 +38,11 @@
 
 /* Arithmetic/logical shift left. */
-long long __ashldi3 (long long val, int shift);
+extern long long __ashldi3(long long, int);
 
 /* Arithmetic shift right. */
-long long __ashrdi3 (long long val, int shift);
+extern long long __ashrdi3(long long, int);
 
 /* Logical shift right. */
-long long __lshrdi3 (long long val, int shift);
+extern long long __lshrdi3(long long, int);
 
 #endif
Index: uspace/srv/fs/exfat/exfat_fat.c
===================================================================
--- uspace/srv/fs/exfat/exfat_fat.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/srv/fs/exfat/exfat_fat.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -127,5 +127,5 @@
 {
 	exfat_cluster_t firstc = nodep->firstc;
-	exfat_cluster_t currc;
+	exfat_cluster_t currc = 0;
 	aoff64_t relbn = bn;
 	int rc;
Index: uspace/srv/hid/fb/port/ega.c
===================================================================
--- uspace/srv/hid/fb/port/ega.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/srv/hid/fb/port/ega.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -117,5 +117,5 @@
 	uint8_t glyph;
 	
-	if ((field->ch >= 0) && (field->ch < 128))
+	if (ascii_check(field->ch))
 		glyph = field->ch;
 	else
Index: uspace/srv/hid/fb/port/kchar.c
===================================================================
--- uspace/srv/hid/fb/port/kchar.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/srv/hid/fb/port/kchar.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -48,5 +48,5 @@
 static void kchar_putchar(wchar_t ch)
 {
-	if ((ch >= 0) && (ch < 128))
+	if (ascii_check(ch))
 		*kchar.addr = ch;
 	else
Index: uspace/srv/hid/fb/port/kfb.c
===================================================================
--- uspace/srv/hid/fb/port/kfb.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/srv/hid/fb/port/kfb.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -409,6 +409,6 @@
 	charfield_t *field = screenbuffer_field_at(vp->backbuf, col, row);
 	
-	pixel_t bgcolor;
-	pixel_t fgcolor;
+	pixel_t bgcolor = 0;
+	pixel_t fgcolor = 0;
 	attrs_rgb(field->attrs, &bgcolor, &fgcolor);
 	
@@ -525,6 +525,6 @@
 	}
 	
-	pixel_t bgcolor;
-	pixel_t fgcolor;
+	pixel_t bgcolor = 0;
+	pixel_t fgcolor = 0;
 	attrs_rgb(vp->attrs, &bgcolor, &fgcolor);
 	
Index: uspace/srv/hid/fb/port/niagara.c
===================================================================
--- uspace/srv/hid/fb/port/niagara.c	(revision d9f53877c83a2ddc2668567168e75a24406af55c)
+++ uspace/srv/hid/fb/port/niagara.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -68,5 +68,5 @@
 static void niagara_putchar(wchar_t ch)
 {
-	if ((ch >= 0) && (ch < 128))
+	if (ascii_check(ch))
 		niagara_putc(ch);
 	else
