Index: uspace/lib/c/generic/ddi.c
===================================================================
--- uspace/lib/c/generic/ddi.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/lib/c/generic/ddi.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -69,7 +69,7 @@
  *
  */
-int physmem_map(uintptr_t phys, size_t pages, unsigned int flags, void **virt)
-{
-	return (int) __SYSCALL5(SYS_PHYSMEM_MAP, (sysarg_t) phys,
+errno_t physmem_map(uintptr_t phys, size_t pages, unsigned int flags, void **virt)
+{
+	return (errno_t) __SYSCALL5(SYS_PHYSMEM_MAP, (sysarg_t) phys,
 	    pages, flags, (sysarg_t) virt, (sysarg_t) __entry);
 }
@@ -85,7 +85,7 @@
  *
  */
-int physmem_unmap(void *virt)
-{
-	return (int) __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt);
+errno_t physmem_unmap(void *virt)
+{
+	return (errno_t) __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt);
 }
 
@@ -110,8 +110,8 @@
  *
  */
-int dmamem_map(void *virt, size_t size, unsigned int map_flags,
+errno_t dmamem_map(void *virt, size_t size, unsigned int map_flags,
     unsigned int flags, uintptr_t *phys)
 {
-	return (int) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
+	return (errno_t) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
 	    (sysarg_t) map_flags, (sysarg_t) flags & ~DMAMEM_FLAGS_ANONYMOUS,
 	    (sysarg_t) phys, (sysarg_t) virt, 0);
@@ -138,22 +138,22 @@
  *
  */
-int dmamem_map_anonymous(size_t size, uintptr_t constraint,
+errno_t dmamem_map_anonymous(size_t size, uintptr_t constraint,
     unsigned int map_flags, unsigned int flags, uintptr_t *phys, void **virt)
 {
 	*phys = constraint;
 	
-	return (int) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
+	return (errno_t) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
 	    (sysarg_t) map_flags, (sysarg_t) flags | DMAMEM_FLAGS_ANONYMOUS,
 	    (sysarg_t) phys, (sysarg_t) virt, (sysarg_t) __entry);
 }
 
-int dmamem_unmap(void *virt, size_t size)
-{
-	return (int) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, (sysarg_t) size, 0);
-}
-
-int dmamem_unmap_anonymous(void *virt)
-{
-	return (int) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, 0,
+errno_t dmamem_unmap(void *virt, size_t size)
+{
+	return (errno_t) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, (sysarg_t) size, 0);
+}
+
+errno_t dmamem_unmap_anonymous(void *virt)
+{
+	return (errno_t) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, 0,
 	    DMAMEM_FLAGS_ANONYMOUS);
 }
@@ -173,5 +173,5 @@
  *
  */
-static int iospace_enable(task_id_t id, void *ioaddr, size_t size)
+static errno_t iospace_enable(task_id_t id, void *ioaddr, size_t size)
 {
 	const ddi_ioarg_t arg = {
@@ -181,5 +181,5 @@
 	};
 	
-	return (int) __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
+	return (errno_t) __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
 }
 
@@ -197,5 +197,5 @@
  *
  */
-static int iospace_disable(task_id_t id, void *ioaddr, size_t size)
+static errno_t iospace_disable(task_id_t id, void *ioaddr, size_t size)
 {
 	const ddi_ioarg_t arg = {
@@ -205,5 +205,5 @@
 	};
 	
-	return (int) __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg);
+	return (errno_t) __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg);
 }
 
@@ -213,5 +213,5 @@
  * @param virt  Virtual address for application's PIO operations. 
  */
-int pio_enable_range(addr_range_t *range, void **virt)
+errno_t pio_enable_range(addr_range_t *range, void **virt)
 {
 	return pio_enable(RNGABSPTR(*range), RNGSZ(*range), virt);
@@ -229,5 +229,5 @@
  *
  */
-int pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt)
+errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt)
 {
 	uintptr_t addr;
@@ -271,5 +271,5 @@
  *
  */
-int pio_enable(void *pio_addr, size_t size, void **virt)
+errno_t pio_enable(void *pio_addr, size_t size, void **virt)
 {
 #ifdef IO_SPACE_BOUNDARY
@@ -291,5 +291,5 @@
 	
 	void *virt_page = AS_AREA_ANY;
-	int rc = physmem_map(phys_frame, pages,
+	errno_t rc = physmem_map(phys_frame, pages,
 	    AS_AREA_READ | AS_AREA_WRITE, &virt_page);
 	if (rc != EOK)
@@ -309,5 +309,5 @@
  *
  */
-int pio_disable(void *virt, size_t size)
+errno_t pio_disable(void *virt, size_t size)
 {
 #ifdef IO_SPACE_BOUNDARY
