Index: uspace/lib/c/generic/ddi.c
===================================================================
--- uspace/lib/c/generic/ddi.c	(revision 6ff23ff32c8aa9d6ad8d06f1743ca1b0d68c14bc)
+++ uspace/lib/c/generic/ddi.c	(revision f175d221bec6983bcf290d98513c54aeef80b0a4)
@@ -220,8 +220,9 @@
 /** Enable PIO for specified HW resource wrt. to the PIO window.
  *
- * @param win      PIO window. May be NULL if the resources are known to be
- *                 absolute.
- * @param res      Resources specifying the I/O range wrt. to the PIO window.
- * @param virt     Virtual address for application's PIO operations.
+ * @param win        PIO window. May be NULL if the resources are known to be
+ *                   absolute.
+ * @param res        Resources specifying the I/O range wrt. to the PIO window.
+ * @param[out] virt  Virtual address for application's PIO operations.
+ * @param[out] size  If non-NULL, size of the enabled resource.
  *
  * @return EOK on success.
@@ -229,8 +230,9 @@
  *
  */
-errno_t 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,
+    size_t *size)
 {
 	uintptr_t addr;
-	size_t size;
+	size_t sz;
 
 	switch (res->type) {
@@ -242,5 +244,5 @@
 			addr += win->io.base;
 		}
-		size = res->res.io_range.size;
+		sz = res->res.io_range.size;
 		break;
 	case MEM_RANGE:
@@ -251,5 +253,5 @@
 			addr += win->mem.base;
 		}
-		size = res->res.mem_range.size;
+		sz = res->res.mem_range.size;
 		break;
 	default:
@@ -257,5 +259,8 @@
 	}
 
-	return pio_enable((void *) addr, size, virt);
+	if (size)
+		*size = sz;
+
+	return pio_enable((void *) addr, sz, virt);
 }
 
