Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/Makefile.common	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -52,6 +52,6 @@
 #define CAT_VERSION "0.0.1"
 #define CAT_DEFAULT_BUFLEN 1024
-
-static const char *cat_oops = "That option is not yet supported\n";
+#define CAT_FULL_FILE 0
+
 static const char *hexchars = "0123456789abcdef";
 
@@ -163,10 +163,12 @@
 }
 
-static unsigned int cat_file(const char *fname, size_t blen, bool hex)
+static unsigned int cat_file(const char *fname, size_t blen, bool hex,
+    off64_t head, off64_t tail, bool tail_first)
 {
 	int fd, bytes = 0, count = 0, reads = 0;
 	char *buff = NULL;
 	int i;
-	size_t offset = 0;
+	size_t offset = 0, copied_bytes = 0;
+	off64_t file_size = 0, length = 0;
 
 	fd = open(fname, O_RDONLY);
@@ -183,8 +185,34 @@
 	}
 
+	if (tail != CAT_FULL_FILE) {
+		file_size = lseek(fd, 0, SEEK_END);
+		if (head == CAT_FULL_FILE) {
+			head = file_size;
+			length = tail;
+		} else if (tail_first) {
+			length = head;
+		} else {
+			if (tail > head)
+				tail = head;
+			length = tail;
+		}
+
+		if (tail_first) {
+			lseek(fd, (tail >= file_size) ? 0 : (file_size - tail), SEEK_SET);
+		} else {
+			lseek(fd, ((head - tail) >= file_size) ? 0 : (head - tail), SEEK_SET);
+		}
+	} else
+		length = head;
+
 	do {
-		bytes = read(fd, buff, blen);
+		bytes = read(fd, buff + copied_bytes, (
+			(length != CAT_FULL_FILE && length - (off64_t)count <= (off64_t)(blen - copied_bytes)) ?
+			(size_t)(length - count) :
+			(blen - copied_bytes) ) );
+		bytes += copied_bytes;
+		copied_bytes = 0;
+
 		if (bytes > 0) {
-			count += bytes;
 			buff[bytes] = '\0';
 			offset = 0;
@@ -193,4 +221,5 @@
 					paged_char(hexchars[((uint8_t)buff[i])/16]);
 					paged_char(hexchars[((uint8_t)buff[i])%16]);
+					paged_char(((count+i+1) & 0xf) == 0 ? '\n' : ' ');
 				}
 				else {
@@ -199,4 +228,10 @@
 						/* Reached end of string */
 						break;
+					} else if (c == U_SPECIAL && offset + 2 >= (size_t)bytes) {
+						/* If an extended character is cut off due to the size of the buffer,
+						   we will copy it over to the next buffer so it can be read correctly. */
+						copied_bytes = bytes - offset + 1;
+						memcpy(buff, buff + offset - 1, copied_bytes);
+						break;
 					}
 					paged_char(c);
@@ -204,7 +239,8 @@
 				
 			}
+			count += bytes;
 			reads++;
 		}
-	} while (bytes > 0 && !should_quit);
+	} while (bytes > 0 && !should_quit && (count < length || length == CAT_FULL_FILE));
 
 	close(fd);
@@ -223,8 +259,11 @@
 int cmd_cat(char **argv)
 {
-	unsigned int argc, i, ret = 0, buffer = 0;
+	unsigned int argc, i, ret = 0;
+	size_t buffer = 0;
 	int c, opt_ind;
+	aoff64_t head = CAT_FULL_FILE, tail = CAT_FULL_FILE;
 	bool hex = false;
 	bool more = false;
+	bool tailFirst = false;
 	sysarg_t rows, cols;
 	int rc;
@@ -254,11 +293,22 @@
 			return CMD_SUCCESS;
 		case 'H':
-			printf("%s", cat_oops);
-			return CMD_FAILURE;
+			if (!optarg || str_uint64_t(optarg, NULL, 10, false, &head) != EOK ) {
+				puts("Invalid head size\n");
+				return CMD_FAILURE;
+			}
+			break;
 		case 't':
-			printf("%s", cat_oops);
-			return CMD_FAILURE;
+			if (!optarg || str_uint64_t(optarg, NULL, 10, false, &tail) != EOK ) {
+				puts("Invalid tail size\n");
+				return CMD_FAILURE;
+			}
+			if (head == CAT_FULL_FILE)
+				tailFirst = true;
+			break;
 		case 'b':
-			printf("%s", cat_oops);
+			if (!optarg || str_size_t(optarg, NULL, 10, false, &buffer) != EOK ) {
+				puts("Invalid buffer size\n");
+				return CMD_FAILURE;
+			}
 			break;
 		case 'm':
@@ -279,5 +329,5 @@
 	}
 
-	if (buffer <= 0)
+	if (buffer < 4)
 		buffer = CAT_DEFAULT_BUFLEN;
 	
@@ -295,5 +345,5 @@
 
 	for (i = optind; argv[i] != NULL && !should_quit; i++)
-		ret += cat_file(argv[i], buffer, hex);
+		ret += cat_file(argv[i], buffer, hex, head, tail, tailFirst);
 
 	if (ret)
Index: uspace/app/bdsh/cmds/modules/cat/cat.h
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/bdsh/cmds/modules/cat/cat.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -4,5 +4,5 @@
 /* Prototypes for the cat command, excluding entry points */
 
-static unsigned int cat_file(const char *, size_t, bool);
+static unsigned int cat_file(const char *, size_t, bool, off64_t, off64_t, bool);
 
 #endif /* CAT_H */
Index: uspace/app/binutils/Makefile
===================================================================
--- uspace/app/binutils/Makefile	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/binutils/Makefile	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -112,5 +112,5 @@
 endif
 ifeq ($(PLATFORM),arm32)
-TARGET = arm-linux-gnu
+TARGET = arm-linux-gnueabi
 endif
 ifeq ($(PLATFORM),ia32)
Index: uspace/app/getterm/Makefile
===================================================================
--- uspace/app/getterm/Makefile	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/getterm/Makefile	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -29,5 +29,5 @@
 
 USPACE_PREFIX = ../..
-DEFS = -DRELEASE=$(RELEASE) "-DNAME=$(NAME)"
+DEFS = -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)"
 BINARY = getterm
 
Index: uspace/app/getterm/version.c
===================================================================
--- uspace/app/getterm/version.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/getterm/version.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -40,4 +40,5 @@
 #include "version.h"
 
+static const char *copyright = STRING(COPYRIGHT);
 static const char *release = STRING(RELEASE);
 static const char *name = STRING(NAME);
@@ -61,5 +62,5 @@
 	printf("HelenOS release %s (%s)%s%s\n", release, name, revision, timestamp);
 	printf("Running on %s (%s)\n", arch, term);
-	printf("Copyright (c) 2001-2011 HelenOS project\n\n");
+	printf("%s\n\n", copyright);
 }
 
Index: uspace/app/sbi/src/run_texpr.c
===================================================================
--- uspace/app/sbi/src/run_texpr.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/sbi/src/run_texpr.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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/sportdmp/sportdmp.c
===================================================================
--- uspace/app/sportdmp/sportdmp.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/sportdmp/sportdmp.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -27,20 +27,20 @@
  */
 
+#include <device/char_dev.h>
 #include <errno.h>
+#include <ipc/serial_ctl.h>
+#include <loc.h>
 #include <stdio.h>
-#include <devman.h>
-#include <ipc/devman.h>
-#include <device/char_dev.h>
-#include <ipc/serial_ctl.h>
 
 #define BUF_SIZE 1
 
-static void syntax_print() {
-	fprintf(stderr, "Usage: sportdmp <baud> <device_path>\n");
+static void syntax_print(void)
+{
+	fprintf(stderr, "Usage: sportdmp <baud> <device_service>\n");
 }
 
 int main(int argc, char **argv)
 {
-	const char* devpath = "/hw/pci0/00:01.0/com1/a";
+	const char* svc_path = "devices/\\hw\\pci0\\00:01.0\\com1\\a";
 	sysarg_t baud = 9600;
 	
@@ -56,5 +56,5 @@
 	
 	if (argc > 2) {
-		devpath = argv[2];
+		svc_path = argv[2];
 	}
 	
@@ -64,15 +64,15 @@
 	}
 	
-	devman_handle_t device;
-	int rc = devman_fun_get_handle(devpath, &device, IPC_FLAG_BLOCKING);
+	service_id_t svc_id;
+	int rc = loc_service_get_id(svc_path, &svc_id, IPC_FLAG_BLOCKING);
 	if (rc != EOK) {
-		fprintf(stderr, "Cannot open device %s\n", devpath);
+		fprintf(stderr, "Cannot find device service %s\n", svc_path);
 		return 1;
 	}
 	
-	async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, device,
+	async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
 	    IPC_FLAG_BLOCKING);
 	if (!sess) {
-		fprintf(stderr, "Cannot connect device\n");
+		fprintf(stderr, "Failed connecting to service %s\n", svc_path);
 	}
 	
@@ -83,5 +83,5 @@
 	
 	if (rc != EOK) {
-		fprintf(stderr, "Cannot set serial properties\n");
+		fprintf(stderr, "Failed setting serial properties\n");
 		return 2;
 	}
@@ -89,5 +89,5 @@
 	uint8_t *buf = (uint8_t *) malloc(BUF_SIZE);
 	if (buf == NULL) {
-		fprintf(stderr, "Cannot allocate buffer\n");
+		fprintf(stderr, "Failed allocating buffer\n");
 		return 3;
 	}
Index: uspace/app/tester/fault/fault2.c
===================================================================
--- uspace/app/tester/fault/fault2.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/tester/fault/fault2.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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/app/tester/hw/serial/serial1.c
===================================================================
--- uspace/app/tester/hw/serial/serial1.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/tester/hw/serial/serial1.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -42,6 +42,5 @@
 #include <async.h>
 #include <ipc/services.h>
-#include <ipc/devman.h>
-#include <devman.h>
+#include <loc.h>
 #include <device/char_dev.h>
 #include <str.h>
@@ -71,19 +70,19 @@
 		}
 	
-	devman_handle_t handle;
-	int res = devman_fun_get_handle("/hw/pci0/00:01.0/com1/a", &handle,
-	    IPC_FLAG_BLOCKING);
+	service_id_t svc_id;
+	int res = loc_service_get_id("devices/\\hw\\pci0\\00:01.0\\com1\\a",
+	    &svc_id, IPC_FLAG_BLOCKING);
 	if (res != EOK)
-		return "Could not get serial device handle";
-	
-	async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, handle,
+		return "Failed getting serial port service ID";
+	
+	async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
 	    IPC_FLAG_BLOCKING);
 	if (!sess)
-		return "Unable to connect to serial device";
+		return "Failed connecting to serial device";
 	
 	char *buf = (char *) malloc(cnt + 1);
 	if (buf == NULL) {
 		async_hangup(sess);
-		return "Failed to allocate input buffer";
+		return "Failed allocating input buffer";
 	}
 	
@@ -112,9 +111,9 @@
 		free(buf);
 		async_hangup(sess);
-		return "Failed to set serial communication parameters";
-	}
-	
-	TPRINTF("Trying to read %zu characters from serial device "
-	    "(handle=%" PRIun ")\n", cnt, handle);
+		return "Failed setting serial communication parameters";
+	}
+	
+	TPRINTF("Trying reading %zu characters from serial device "
+	    "(svc_id=%" PRIun ")\n", cnt, svc_id);
 	
 	size_t total = 0;
@@ -130,5 +129,5 @@
 			free(buf);
 			async_hangup(sess);
-			return "Failed read from serial device";
+			return "Failed reading from serial device";
 		}
 		
@@ -165,5 +164,5 @@
 				free(buf);
 				async_hangup(sess);
-				return "Failed write to serial device";
+				return "Failed writing to serial device";
 			}
 			
Index: uspace/app/websrv/websrv.c
===================================================================
--- uspace/app/websrv/websrv.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/app/websrv/websrv.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -201,5 +201,5 @@
 {
 	if (str_cmp(uri, "/") == 0)
-		uri = "/index.htm";
+		uri = "/index.html";
 	
 	char *fname;
Index: uspace/dist/data/web/bar.htm
===================================================================
--- uspace/dist/data/web/bar.htm	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<html>
-    <head>
-	<title>Bar!</title>
-    </head>
-    <body>
-	<h1>Bar!</h1>
-
-	<a href="/">Back to top</a>
-    </body>
-</html>
Index: uspace/dist/data/web/bar.html
===================================================================
--- uspace/dist/data/web/bar.html	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/dist/data/web/bar.html	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -0,0 +1,10 @@
+<html>
+    <head>
+	<title>Bar!</title>
+    </head>
+    <body>
+	<h1>Bar!</h1>
+
+	<a href="/">Back to top</a>
+    </body>
+</html>
Index: uspace/dist/data/web/foo.htm
===================================================================
--- uspace/dist/data/web/foo.htm	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<html>
-    <head>
-	<title>Foo!</title>
-    </head>
-    <body>
-	<h1>Foo!</h1>
-
-	<a href="/">Back to top</a>
-    </body>
-</html>
Index: uspace/dist/data/web/foo.html
===================================================================
--- uspace/dist/data/web/foo.html	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/dist/data/web/foo.html	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -0,0 +1,10 @@
+<html>
+    <head>
+	<title>Foo!</title>
+    </head>
+    <body>
+	<h1>Foo!</h1>
+
+	<a href="/">Back to top</a>
+    </body>
+</html>
Index: uspace/dist/data/web/index.htm
===================================================================
--- uspace/dist/data/web/index.htm	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(revision )
@@ -1,19 +1,0 @@
-<html>
-    <head>
-        <title>
-    	    Hello from HelenOS!
-        </title>
-    </head>
-    <body>
-        <h1>Hello from HelenOS!</h1>
-        <img src="helenos.png" alt="" style="float: left; margin: 6px;">
-        <p>
-            This web page is brought to you by courtesy of HelenOS web server
-    	    and TCP/IP stack.
-        </p>
-	<p>
-    	    Now <a href="foo.htm">go to page foo</a> or <a href="bar.htm">go
-    	    to bar</a>.
-        </p>
-    </body>
-</html>
Index: uspace/dist/data/web/index.html
===================================================================
--- uspace/dist/data/web/index.html	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/dist/data/web/index.html	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -0,0 +1,19 @@
+<html>
+    <head>
+        <title>
+    	    Hello from HelenOS!
+        </title>
+    </head>
+    <body>
+        <h1>Hello from HelenOS!</h1>
+        <img src="helenos.png" alt="" style="float: left; margin: 6px;">
+        <p>
+            This web page is brought to you by courtesy of HelenOS web server
+    	    and TCP/IP stack.
+        </p>
+	<p>
+    	    Now <a href="foo.html">go to page foo</a> or <a href="bar.html">go
+    	    to bar</a>.
+        </p>
+    </body>
+</html>
Index: uspace/drv/bus/isa/isa.c
===================================================================
--- uspace/drv/bus/isa/isa.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/isa/isa.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -66,6 +66,4 @@
 #include <ops/hw_res.h>
 
-#include <devman.h>
-#include <ipc/devman.h>
 #include <device/hw_res.h>
 
Index: uspace/drv/bus/usb/ehci/Makefile
===================================================================
--- uspace/drv/bus/usb/ehci/Makefile	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/ehci/Makefile	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/ehci/main.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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: uspace/drv/bus/usb/ehci/pci.c
===================================================================
--- uspace/drv/bus/usb/ehci/pci.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/drv/bus/usb/ehci/pci.h
===================================================================
--- uspace/drv/bus/usb/ehci/pci.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/drv/bus/usb/ehci/res.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/drv/bus/usb/ehci/res.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/ohci/Makefile	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/ohci/hw_struct/hcca.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/ohci/ohci.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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: uspace/drv/bus/usb/ohci/pci.c
===================================================================
--- uspace/drv/bus/usb/ohci/pci.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/drv/bus/usb/ohci/pci.h
===================================================================
--- uspace/drv/bus/usb/ohci/pci.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/drv/bus/usb/ohci/res.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/drv/bus/usb/ohci/res.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/uhci/Makefile	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -44,5 +44,5 @@
 	hc.c \
 	main.c \
-	pci.c \
+	res.c \
 	root_hub.c \
 	transfer_list.c \
Index: uspace/drv/bus/usb/uhci/pci.c
===================================================================
--- uspace/drv/bus/usb/uhci/pci.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/drv/bus/usb/uhci/pci.h
===================================================================
--- uspace/drv/bus/usb/uhci/pci.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/drv/bus/usb/uhci/res.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
+++ uspace/drv/bus/usb/uhci/res.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/uhci/uhci.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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/drv/bus/usb/uhcirh/port.c
===================================================================
--- uspace/drv/bus/usb/uhcirh/port.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/uhcirh/port.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -37,5 +37,4 @@
 #include <str_error.h>
 #include <async.h>
-#include <devman.h>
 
 #include <usb/usb.h>    /* usb_address_t */
Index: uspace/drv/bus/usb/usbhub/port.c
===================================================================
--- uspace/drv/bus/usb/usbhub/port.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/bus/usb/usbhub/port.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -35,5 +35,4 @@
 
 #include <bool.h>
-#include <devman.h>
 #include <errno.h>
 #include <str_error.h>
Index: uspace/drv/char/ns8250/ns8250.c
===================================================================
--- uspace/drv/char/ns8250/ns8250.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/char/ns8250/ns8250.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -74,4 +74,56 @@
 #define DLAB_MASK (1 << 7)
 
+/** Interrupt Enable Register definition. */
+#define	NS8250_IER_RXREADY	(1 << 0)
+#define	NS8250_IER_THRE		(1 << 1)
+#define	NS8250_IER_RXSTATUS	(1 << 2)
+#define	NS8250_IER_MODEM_STATUS	(1 << 3)
+
+/** Interrupt ID Register definition. */
+#define	NS8250_IID_ACTIVE	(1 << 0)
+
+/** FIFO Control Register definition. */
+#define	NS8250_FCR_FIFOENABLE	(1 << 0)
+#define	NS8250_FCR_RXFIFORESET	(1 << 1)
+#define	NS8250_FCR_TXFIFORESET	(1 << 2)
+#define	NS8250_FCR_DMAMODE	(1 << 3)
+#define	NS8250_FCR_RXTRIGGERLOW	(1 << 6)
+#define	NS8250_FCR_RXTRIGGERHI	(1 << 7)
+
+/** Line Control Register definition. */
+#define	NS8250_LCR_STOPBITS	(1 << 2)
+#define	NS8250_LCR_PARITY	(1 << 3)
+#define	NS8250_LCR_SENDBREAK	(1 << 6)
+#define	NS8250_LCR_DLAB		(1 << 7)
+
+/** Modem Control Register definition. */
+#define	NS8250_MCR_DTR		(1 << 0)
+#define	NS8250_MCR_RTS		(1 << 1)
+#define	NS8250_MCR_OUT1		(1 << 2)
+#define	NS8250_MCR_OUT2		(1 << 3)
+#define	NS8250_MCR_LOOPBACK	(1 << 4)
+#define	NS8250_MCR_ALL		(0x1f)
+
+/** Line Status Register definition. */
+#define	NS8250_LSR_RXREADY	(1 << 0)
+#define	NS8250_LSR_OE		(1 << 1)
+#define	NS8250_LSR_PE		(1 << 2)
+#define	NS8250_LSR_FE		(1 << 3)
+#define	NS8250_LSR_BREAK	(1 << 4)
+#define	NS8250_LSR_THRE		(1 << 5)
+#define	NS8250_LSR_TSE		(1 << 6)
+
+/** Modem Status Register definition. */
+#define	NS8250_MSR_DELTACTS	(1 << 0)
+#define	NS8250_MSR_DELTADSR	(1 << 1)
+#define	NS8250_MSR_RITRAILING	(1 << 2)
+#define	NS8250_MSR_DELTADCD	(1 << 3)
+#define	NS8250_MSR_CTS		(1 << 4)
+#define	NS8250_MSR_DSR		(1 << 5)
+#define	NS8250_MSR_RI		(1 << 6)
+#define	NS8250_MSR_DCD		(1 << 7)
+#define	NS8250_MSR_SIGNALS	(NS8250_MSR_CTS | NS8250_MSR_DSR \
+    | NS8250_MSR_RI | NS8250_MSR_DCD)
+
 /** Obtain soft-state structure from function node */
 #define NS8250(fnode) ((ns8250_t *) ((fnode)->dev->driver_data))
@@ -96,4 +148,15 @@
 } stop_bit_t;
 
+/** 8250 UART registers layout. */
+typedef struct {
+	ioport8_t data;		/**< Data register. */
+	ioport8_t ier;		/**< Interrupt Enable Reg. */
+	ioport8_t iid;		/**< Interrupt ID Reg. */
+	ioport8_t lcr;		/**< Line Control Reg. */
+	ioport8_t mcr;		/**< Modem Control Reg. */
+	ioport8_t lsr;		/**< Line Status Reg. */
+	ioport8_t msr;		/**< Modem Status Reg. */
+} ns8250_regs_t;
+
 /** The driver data for the serial port devices. */
 typedef struct ns8250 {
@@ -102,4 +165,6 @@
 	/** DDF function node */
 	ddf_fun_t *fun;
+	/** I/O registers **/
+	ns8250_regs_t *regs;
 	/** Is there any client conntected to the device? */
 	bool client_connected;
@@ -124,7 +189,7 @@
  *			otherwise.
  */
-static bool ns8250_received(ioport8_t *port)
-{
-	return (pio_read_8(port + 5) & 1) != 0;
+static bool ns8250_received(ns8250_regs_t *regs)
+{
+	return (pio_read_8(&regs->lsr) & NS8250_LSR_RXREADY) != 0;
 }
 
@@ -134,7 +199,7 @@
  * @return		The data read.
  */
-static uint8_t ns8250_read_8(ioport8_t *port)
-{
-	return pio_read_8(port);
+static uint8_t ns8250_read_8(ns8250_regs_t *regs)
+{
+	return pio_read_8(&regs->data);
 }
 
@@ -143,7 +208,7 @@
  * @param port		The base address of the serial port device's ports.
  */
-static bool is_transmit_empty(ioport8_t *port)
-{
-	return (pio_read_8(port + 5) & 0x20) != 0;
+static bool is_transmit_empty(ns8250_regs_t *regs)
+{
+	return (pio_read_8(&regs->lsr) & NS8250_LSR_THRE) != 0;
 }
 
@@ -153,10 +218,10 @@
  * @param c		The character to be written to the serial port device.
  */
-static void ns8250_write_8(ioport8_t *port, uint8_t c)
-{
-	while (!is_transmit_empty(port))
+static void ns8250_write_8(ns8250_regs_t *regs, uint8_t c)
+{
+	while (!is_transmit_empty(regs))
 		;
 	
-	pio_write_8(port, c);
+	pio_write_8(&regs->data, c);
 }
 
@@ -193,5 +258,5 @@
 {
 	fibril_mutex_lock(&ns->mutex);
-	ns8250_write_8(ns->port, c);
+	ns8250_write_8(ns->regs, c);
 	fibril_mutex_unlock(&ns->mutex);
 }
@@ -212,5 +277,5 @@
 		ns8250_putchar(ns, (uint8_t) buf[idx]);
 	
-	return 0;
+	return count;
 }
 
@@ -266,4 +331,6 @@
 		return false;
 	}
+
+	ns->regs = (ns8250_regs_t *)ns->port;
 	
 	return true;
@@ -279,19 +346,19 @@
 	ddf_msg(LVL_DEBUG, "ns8250_dev_probe %s", ns->dev->name);
 	
-	ioport8_t *port_addr = ns->port;
 	bool res = true;
 	uint8_t olddata;
 	
-	olddata = pio_read_8(port_addr + 4);
-	
-	pio_write_8(port_addr + 4, 0x10);
-	if (pio_read_8(port_addr + 6) & 0xf0)
+	olddata = pio_read_8(&ns->regs->mcr);
+	
+	pio_write_8(&ns->regs->mcr, NS8250_MCR_LOOPBACK);
+	if (pio_read_8(&ns->regs->msr) & NS8250_MSR_SIGNALS)
 		res = false;
 	
-	pio_write_8(port_addr + 4, 0x1f);
-	if ((pio_read_8(port_addr + 6) & 0xf0) != 0xf0)
+	pio_write_8(&ns->regs->mcr, NS8250_MCR_ALL);
+	if ((pio_read_8(&ns->regs->msr) & NS8250_MSR_SIGNALS) 
+	    != NS8250_MSR_SIGNALS)
 		res = false;
 	
-	pio_write_8(port_addr + 4, olddata);
+	pio_write_8(&ns->regs->mcr, olddata);
 	
 	if (!res) {
@@ -390,8 +457,10 @@
  * @param port		The base address of the serial port device's ports.
  */
-static inline void ns8250_port_interrupts_enable(ioport8_t *port)
-{
-	pio_write_8(port + 1, 0x1);	/* Interrupt when data received. */
-	pio_write_8(port + 4, 0xB);
+static inline void ns8250_port_interrupts_enable(ns8250_regs_t *regs)
+{
+	/* Interrupt when data received. */
+	pio_write_8(&regs->ier, NS8250_IER_RXREADY);
+	pio_write_8(&regs->mcr, NS8250_MCR_DTR | NS8250_MCR_RTS 
+	    | NS8250_MCR_OUT2);
 }
 
@@ -400,7 +469,7 @@
  * @param port		The base address of the serial port device's ports
  */
-static inline void ns8250_port_interrupts_disable(ioport8_t *port)
-{
-	pio_write_8(port + 1, 0x0);	/* Disable all interrupts. */
+static inline void ns8250_port_interrupts_disable(ns8250_regs_t *regs)
+{
+	pio_write_8(&regs->ier, 0x0);	/* Disable all interrupts. */
 }
 
@@ -431,5 +500,5 @@
 
 	/* Enable interrupt on the serial port. */
-	ns8250_port_interrupts_enable(ns->port);
+	ns8250_port_interrupts_enable(ns->regs);
 	
 	return EOK;
@@ -443,8 +512,8 @@
  * @param port		The base address of the serial port device's ports.
  */
-static inline void enable_dlab(ioport8_t *port)
-{
-	uint8_t val = pio_read_8(port + 3);
-	pio_write_8(port + 3, val | DLAB_MASK);
+static inline void enable_dlab(ns8250_regs_t *regs)
+{
+	uint8_t val = pio_read_8(&regs->lcr);
+	pio_write_8(&regs->lcr, val | NS8250_LCR_DLAB);
 }
 
@@ -453,8 +522,8 @@
  * @param port		The base address of the serial port device's ports.
  */
-static inline void clear_dlab(ioport8_t *port)
-{
-	uint8_t val = pio_read_8(port + 3);
-	pio_write_8(port + 3, val & (~DLAB_MASK));
+static inline void clear_dlab(ns8250_regs_t *regs)
+{
+	uint8_t val = pio_read_8(&regs->lcr);
+	pio_write_8(&regs->lcr, val & (~NS8250_LCR_DLAB));
 }
 
@@ -466,5 +535,5 @@
  *			if the specified baud_rate is not valid).
  */
-static int ns8250_port_set_baud_rate(ioport8_t *port, unsigned int baud_rate)
+static int ns8250_port_set_baud_rate(ns8250_regs_t *regs, unsigned int baud_rate)
 {
 	uint16_t divisor;
@@ -482,12 +551,12 @@
 	
 	/* Enable DLAB to be able to access baud rate divisor. */
-	enable_dlab(port);
+	enable_dlab(regs);
 	
 	/* Set divisor low byte. */
-	pio_write_8(port + 0, div_low);
+	pio_write_8(&regs->data, div_low);
 	/* Set divisor high byte. */
-	pio_write_8(port + 1, div_high);
-	
-	clear_dlab(port);
+	pio_write_8(&regs->ier, div_high);
+	
+	clear_dlab(regs);
 	
 	return EOK;
@@ -499,5 +568,5 @@
  * @param baud_rate	The ouput parameter to which the baud rate is stored.
  */
-static unsigned int ns8250_port_get_baud_rate(ioport8_t *port)
+static unsigned int ns8250_port_get_baud_rate(ns8250_regs_t *regs)
 {
 	uint16_t divisor;
@@ -505,12 +574,12 @@
 	
 	/* Enable DLAB to be able to access baud rate divisor. */
-	enable_dlab(port);
+	enable_dlab(regs);
 	
 	/* Get divisor low byte. */
-	div_low = pio_read_8(port + 0);
+	div_low = pio_read_8(&regs->data);
 	/* Get divisor high byte. */
-	div_high = pio_read_8(port + 1);
-	
-	clear_dlab(port);
+	div_high = pio_read_8(&regs->ier);
+	
+	clear_dlab(regs);
 	
 	divisor = (div_high << 8) | div_low;
@@ -525,11 +594,11 @@
  * @param stop_bits	The number of stop bits used (one or two).
  */
-static void ns8250_port_get_com_props(ioport8_t *port, unsigned int *parity,
+static void ns8250_port_get_com_props(ns8250_regs_t *regs, unsigned int *parity,
     unsigned int *word_length, unsigned int *stop_bits)
 {
 	uint8_t val;
 	
-	val = pio_read_8(port + 3);
-	*parity = ((val >> 3) & 7);
+	val = pio_read_8(&regs->lcr);
+	*parity = ((val >> NS8250_LCR_PARITY) & 7);
 	
 	switch (val & 3) {
@@ -548,5 +617,5 @@
 	}
 	
-	if ((val >> 2) & 1)
+	if ((val >> NS8250_LCR_STOPBITS) & 1)
 		*stop_bits = 2;
 	else
@@ -562,5 +631,5 @@
  *			is invalid.
  */
-static int ns8250_port_set_com_props(ioport8_t *port, unsigned int parity,
+static int ns8250_port_set_com_props(ns8250_regs_t *regs, unsigned int parity,
     unsigned int word_length, unsigned int stop_bits)
 {
@@ -586,8 +655,8 @@
 	switch (stop_bits) {
 	case 1:
-		val |= ONE_STOP_BIT << 2;
+		val |= ONE_STOP_BIT << NS8250_LCR_STOPBITS;
 		break;
 	case 2:
-		val |= TWO_STOP_BITS << 2;
+		val |= TWO_STOP_BITS << NS8250_LCR_STOPBITS;
 		break;
 	default:
@@ -601,5 +670,5 @@
 	case SERIAL_MARK_PARITY:
 	case SERIAL_SPACE_PARITY:
-		val |= parity << 3;
+		val |= parity << NS8250_LCR_PARITY;
 		break;
 	default:
@@ -607,5 +676,5 @@
 	}
 	
-	pio_write_8(port + 3, val);
+	pio_write_8(&regs->lcr, val);
 	
 	return EOK;
@@ -620,19 +689,20 @@
 static void ns8250_initialize_port(ns8250_t *ns)
 {
-	ioport8_t *port = ns->port;
-	
 	/* Disable interrupts. */
-	ns8250_port_interrupts_disable(port);
+	ns8250_port_interrupts_disable(ns->regs);
 	/* Set baud rate. */
-	ns8250_port_set_baud_rate(port, 38400);
+	ns8250_port_set_baud_rate(ns->regs, 38400);
 	/* 8 bits, no parity, two stop bits. */
-	ns8250_port_set_com_props(port, SERIAL_NO_PARITY, 8, 2);
+	ns8250_port_set_com_props(ns->regs, SERIAL_NO_PARITY, 8, 2);
 	/* Enable FIFO, clear them, with 14-byte threshold. */
-	pio_write_8(port + 2, 0xC7);
+	pio_write_8(&ns->regs->iid, NS8250_FCR_FIFOENABLE
+	    | NS8250_FCR_RXFIFORESET | NS8250_FCR_TXFIFORESET 
+	    | NS8250_FCR_RXTRIGGERLOW | NS8250_FCR_RXTRIGGERHI);
 	/*
 	 * RTS/DSR set (Request to Send and Data Terminal Ready lines enabled),
 	 * Aux Output2 set - needed for interrupts.
 	 */
-	pio_write_8(port + 4, 0x0B);
+	pio_write_8(&ns->regs->mcr, NS8250_MCR_DTR | NS8250_MCR_RTS
+	    | NS8250_MCR_OUT2);
 }
 
@@ -644,9 +714,9 @@
 {
 	/* Disable FIFO */
-	pio_write_8(ns->port + 2, 0x00);
+	pio_write_8(&ns->regs->iid, 0x00);
 	/* Disable DTR, RTS, OUT1, OUT2 (int. enable) */
-	pio_write_8(ns->port + 4, 0x00);
+	pio_write_8(&ns->regs->mcr, 0x00);
 	/* Disable all interrupts from the port */
-	ns8250_port_interrupts_disable(ns->port);
+	ns8250_port_interrupts_disable(ns->regs);
 }
 
@@ -658,5 +728,5 @@
 static void ns8250_read_from_device(ns8250_t *ns)
 {
-	ioport8_t *port = ns->port;
+	ns8250_regs_t *regs = ns->regs;
 	bool cont = true;
 	
@@ -664,7 +734,7 @@
 		fibril_mutex_lock(&ns->mutex);
 		
-		cont = ns8250_received(port);
+		cont = ns8250_received(regs);
 		if (cont) {
-			uint8_t val = ns8250_read_8(port);
+			uint8_t val = ns8250_read_8(regs);
 			
 			if (ns->client_connected) {
@@ -896,11 +966,11 @@
 {
 	ns8250_t *data = (ns8250_t *) dev->driver_data;
-	ioport8_t *port = data->port;
+	ns8250_regs_t *regs = data->regs;
 	
 	fibril_mutex_lock(&data->mutex);
-	ns8250_port_interrupts_disable(port);
-	*baud_rate = ns8250_port_get_baud_rate(port);
-	ns8250_port_get_com_props(port, parity, word_length, stop_bits);
-	ns8250_port_interrupts_enable(port);
+	ns8250_port_interrupts_disable(regs);
+	*baud_rate = ns8250_port_get_baud_rate(regs);
+	ns8250_port_get_com_props(regs, parity, word_length, stop_bits);
+	ns8250_port_interrupts_enable(regs);
 	fibril_mutex_unlock(&data->mutex);
 	
@@ -927,13 +997,13 @@
 	
 	ns8250_t *data = (ns8250_t *) dev->driver_data;
-	ioport8_t *port = data->port;
+	ns8250_regs_t *regs = data->regs;
 	int ret;
 	
 	fibril_mutex_lock(&data->mutex);
-	ns8250_port_interrupts_disable(port);
-	ret = ns8250_port_set_baud_rate(port, baud_rate);
+	ns8250_port_interrupts_disable(regs);
+	ret = ns8250_port_set_baud_rate(regs, baud_rate);
 	if (ret == EOK)
-		ret = ns8250_port_set_com_props(port, parity, word_length, stop_bits);
-	ns8250_port_interrupts_enable(port);
+		ret = ns8250_port_set_com_props(regs, parity, word_length, stop_bits);
+	ns8250_port_interrupts_enable(regs);
 	fibril_mutex_unlock(&data->mutex);
 	
Index: uspace/drv/char/ps2mouse/main.c
===================================================================
--- uspace/drv/char/ps2mouse/main.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/char/ps2mouse/main.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -35,5 +35,4 @@
 #include <libarch/inttypes.h>
 #include <ddf/driver.h>
-#include <devman.h>
 #include <device/hw_res_parsed.h>
 #include <errno.h>
Index: uspace/drv/char/xtkbd/main.c
===================================================================
--- uspace/drv/char/xtkbd/main.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/char/xtkbd/main.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -35,5 +35,4 @@
 #include <libarch/inttypes.h>
 #include <ddf/driver.h>
-#include <devman.h>
 #include <device/hw_res_parsed.h>
 #include <errno.h>
Index: uspace/drv/infrastructure/root/root.c
===================================================================
--- uspace/drv/infrastructure/root/root.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/infrastructure/root/root.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -53,6 +53,4 @@
 #include <ddf/driver.h>
 #include <ddf/log.h>
-#include <devman.h>
-#include <ipc/devman.h>
 
 #define NAME "root"
Index: uspace/drv/infrastructure/rootpc/rootpc.c
===================================================================
--- uspace/drv/infrastructure/rootpc/rootpc.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/infrastructure/rootpc/rootpc.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -48,6 +48,4 @@
 #include <ddf/driver.h>
 #include <ddf/log.h>
-#include <devman.h>
-#include <ipc/devman.h>
 #include <ipc/dev_iface.h>
 #include <ops/hw_res.h>
Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/drv/nic/e1k/e1k.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -46,5 +46,4 @@
 #include <ddf/log.h>
 #include <ddf/interrupt.h>
-#include <devman.h>
 #include <device/hw_res_parsed.h>
 #include <device/pci.h>
Index: uspace/lib/c/arch/arm32/Makefile.common
===================================================================
--- uspace/lib/c/arch/arm32/Makefile.common	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/c/arch/arm32/Makefile.common	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -28,5 +28,5 @@
 #
 
-GCC_CFLAGS += -ffixed-r9 -mtp=soft -mapcs-frame -fno-omit-frame-pointer
+GCC_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -march=armv4
 
 ENDIANESS = LE
Index: uspace/lib/c/arch/arm32/src/eabi.S
===================================================================
--- uspace/lib/c/arch/arm32/src/eabi.S	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/c/arch/arm32/src/eabi.S	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -1,4 +1,4 @@
 #
-# Copyright (c) 2007 Pavel Jancik
+# Copyright (c) 2012 Martin Decky
 # All rights reserved.
 #
@@ -31,5 +31,68 @@
 .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 {lr}
+	bl __divsi3
+	pop {lr}
+	mov pc, lr
+
+__aeabi_uidiv:
+	push {lr}
+	bl __udivsi3
+	pop {lr}
+	mov pc, lr
+
+__aeabi_idivmod:
+	push {lr}
+	sub sp, sp, #12
+	add r2, sp, #4
+	bl __udivmodsi3
+	ldr r1, [sp, #4]
+	add sp, sp, #12
+	pop {lr}
+	mov pc, lr
+
+__aeabi_uidivmod:
+	push {lr}
+	sub sp, sp, #12
+	add r2, sp, #4
+	bl __udivmodsi3
+	ldr r1, [sp, #4]
+	add sp, sp, #12
+	pop {lr}
+	mov pc, lr
+
+__aeabi_ldivmod:
+	push {lr}
+	sub sp, sp, #24
+	push {sp}
+	bl __divmoddi3
+	add sp, sp, #4
+	pop {r2, r3}
+	add sp, sp, #16
+	pop {lr}
+	mov pc, lr
+
+__aeabi_uldivmod:
+	push {lr}
+	sub sp, sp, #24
+	push {sp}
+	bl __udivmoddi3
+	add sp, sp, #4
+	pop {r2, r3}
+	add sp, sp, #16
+	pop {lr}
+	mov pc, lr
Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/c/generic/str.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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/net/generic/net_remote.c
===================================================================
--- uspace/lib/net/generic/net_remote.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/net/generic/net_remote.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -40,5 +40,4 @@
 #include <malloc.h>
 #include <async.h>
-#include <devman.h>
 #include <generic.h>
 #include <net/modules.h>
Index: uspace/lib/softfloat/Makefile
===================================================================
--- uspace/lib/softfloat/Makefile	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/Makefile	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -29,5 +29,5 @@
 
 USPACE_PREFIX = ../..
-EXTRA_CFLAGS = -Iinclude -Iarch/$(UARCH)/include/
+EXTRA_CFLAGS = -Iinclude
 LIBRARY = libsoftfloat
 
Index: uspace/lib/softfloat/arch/abs32le/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/abs32le/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/amd64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/amd64/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/arm32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/arm32/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/ia32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/ia32/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/ia64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/ia64/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/mips32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/mips32/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/mips32eb/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/mips32eb/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/mips64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/mips64/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/ppc32/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/ppc32/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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: uspace/lib/softfloat/arch/sparc64/include/functions.h
===================================================================
--- uspace/lib/softfloat/arch/sparc64/include/functions.h	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ 	(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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/add.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/common.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/comparison.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/conversion.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/div.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/mul.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/softfloat.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/generic/sub.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/add.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/common.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/comparison.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/conversion.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/div.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/mul.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/sftypes.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/softfloat.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softfloat/include/sub.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softint/generic/division.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softint/include/comparison.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softint/include/division.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softint/include/lltype.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softint/include/multiplication.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/softint/include/shift.h	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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/lib/usb/src/ddfiface.c
===================================================================
--- uspace/lib/usb/src/ddfiface.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/usb/src/ddfiface.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -33,5 +33,4 @@
  * Implementations of DDF interfaces functions (actual implementation).
  */
-#include <ipc/devman.h>
 #include <devman.h>
 #include <async.h>
Index: uspace/lib/usbvirt/src/ipc_dev.c
===================================================================
--- uspace/lib/usbvirt/src/ipc_dev.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/usbvirt/src/ipc_dev.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -38,5 +38,4 @@
 #include <assert.h>
 #include <async.h>
-#include <devman.h>
 #include <usbvirt/device.h>
 #include <usbvirt/ipc.h>
Index: uspace/lib/usbvirt/src/ipc_hc.c
===================================================================
--- uspace/lib/usbvirt/src/ipc_hc.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/lib/usbvirt/src/ipc_hc.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -38,5 +38,4 @@
 #include <assert.h>
 #include <async.h>
-#include <devman.h>
 #include <usbvirt/device.h>
 #include <usbvirt/ipc.h>
Index: uspace/srv/fs/exfat/exfat_fat.c
===================================================================
--- uspace/srv/fs/exfat/exfat_fat.c	(revision e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/srv/fs/exfat/exfat_fat.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/srv/hid/fb/port/ega.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/srv/hid/fb/port/kchar.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/srv/hid/fb/port/kfb.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -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 e61aa802b6438793f4a350ef8eec5266ca467d80)
+++ uspace/srv/hid/fb/port/niagara.c	(revision 9b0a6b4e30ea5901e04229bc4f2ef37343a9e601)
@@ -68,5 +68,5 @@
 static void niagara_putchar(wchar_t ch)
 {
-	if ((ch >= 0) && (ch < 128))
+	if (ascii_check(ch))
 		niagara_putc(ch);
 	else
