Index: arch/amd64/Makefile.inc
===================================================================
--- arch/amd64/Makefile.inc	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ arch/amd64/Makefile.inc	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -89,4 +89,5 @@
 	arch/$(ARCH)/src/pm.c \
 	arch/$(ARCH)/src/context.S \
+	arch/$(ARCH)/src/ddi/ddi.c \
 	arch/$(ARCH)/src/drivers/ega.c \
 	arch/$(ARCH)/src/drivers/i8254.c \
Index: arch/amd64/src/ddi/ddi.c
===================================================================
--- arch/amd64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
+++ arch/amd64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * 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.
+ */
+
+#include <ddi/ddi.h>
+#include <proc/task.h>
+#include <arch/types.h>
+#include <typedefs.h>
+
+/** Enable I/O space range for task.
+ *
+ * Interrupts are disabled and task is locked.
+ *
+ * @param task Task.
+ * @param ioaddr Startign I/O space address.
+ * @param size Size of the enabled I/O range.
+ *
+ * @return 0 on success or an error code from errno.h.
+ */
+int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size)
+{
+	return 0;
+}
Index: arch/ia32/Makefile.inc
===================================================================
--- arch/ia32/Makefile.inc	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ arch/ia32/Makefile.inc	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -128,4 +128,5 @@
 	arch/$(ARCH)/src/mm/page.c \
 	arch/$(ARCH)/src/mm/tlb.c \
+	arch/$(ARCH)/src/ddi/ddi.c \
 	arch/$(ARCH)/src/drivers/i8254.c \
 	arch/$(ARCH)/src/drivers/i8259.c \
Index: arch/ia32/src/ddi/ddi.c
===================================================================
--- arch/ia32/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
+++ arch/ia32/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * 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.
+ */
+
+#include <ddi/ddi.h>
+#include <proc/task.h>
+#include <arch/types.h>
+#include <typedefs.h>
+
+/** Enable I/O space range for task.
+ *
+ * Interrupts are disabled and task is locked.
+ *
+ * @param task Task.
+ * @param ioaddr Startign I/O space address.
+ * @param size Size of the enabled I/O range.
+ *
+ * @return 0 on success or an error code from errno.h.
+ */
+int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size)
+{
+	return 0;
+}
Index: arch/ia64/Makefile.inc
===================================================================
--- arch/ia64/Makefile.inc	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ arch/ia64/Makefile.inc	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -86,3 +86,4 @@
 	arch/$(ARCH)/src/mm/tlb.c \
 	arch/$(ARCH)/src/proc/scheduler.c \
+	arch/$(ARCH)/src/ddi/ddi.c \
 	arch/$(ARCH)/src/drivers/it.c
Index: arch/ia64/src/ddi/ddi.c
===================================================================
--- arch/ia64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
+++ arch/ia64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * 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.
+ */
+
+#include <ddi/ddi.h>
+#include <proc/task.h>
+#include <arch/types.h>
+#include <typedefs.h>
+
+/** Enable I/O space range for task.
+ *
+ * Interrupts are disabled and task is locked.
+ *
+ * @param task Task.
+ * @param ioaddr Startign I/O space address.
+ * @param size Size of the enabled I/O range.
+ *
+ * @return 0 on success or an error code from errno.h.
+ */
+int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size)
+{
+	return 0;
+}
Index: arch/mips32/Makefile.inc
===================================================================
--- arch/mips32/Makefile.inc	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ arch/mips32/Makefile.inc	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -126,4 +126,5 @@
 	arch/$(ARCH)/src/mm/as.c \
 	arch/$(ARCH)/src/fpu_context.c \
+	arch/$(ARCH)/src/ddi/ddi.c \
 	arch/$(ARCH)/src/drivers/arc.c \
 	arch/$(ARCH)/src/drivers/msim.c \
Index: arch/mips32/src/ddi/ddi.c
===================================================================
--- arch/mips32/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
+++ arch/mips32/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * 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.
+ */
+
+#include <ddi/ddi.h>
+#include <proc/task.h>
+#include <arch/types.h>
+#include <typedefs.h>
+
+/** Enable I/O space range for task.
+ *
+ * Interrupts are disabled and task is locked.
+ *
+ * @param task Task.
+ * @param ioaddr Startign I/O space address.
+ * @param size Size of the enabled I/O range.
+ *
+ * @return 0 on success or an error code from errno.h.
+ */
+int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size)
+{
+	return 0;
+}
Index: arch/ppc32/Makefile.inc
===================================================================
--- arch/ppc32/Makefile.inc	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ arch/ppc32/Makefile.inc	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -69,4 +69,5 @@
 	arch/$(ARCH)/src/cpu/cpu.c \
 	arch/$(ARCH)/src/proc/scheduler.c \
+	arch/$(ARCH)/src/ddi/ddi.c \
 	arch/$(ARCH)/src/drivers/cuda.c \
 	arch/$(ARCH)/src/mm/as.c \
Index: arch/ppc32/src/ddi/ddi.c
===================================================================
--- arch/ppc32/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
+++ arch/ppc32/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * 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.
+ */
+
+#include <ddi/ddi.h>
+#include <proc/task.h>
+#include <arch/types.h>
+#include <typedefs.h>
+
+/** Enable I/O space range for task.
+ *
+ * Interrupts are disabled and task is locked.
+ *
+ * @param task Task.
+ * @param ioaddr Startign I/O space address.
+ * @param size Size of the enabled I/O range.
+ *
+ * @return 0 on success or an error code from errno.h.
+ */
+int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size)
+{
+	return 0;
+}
Index: arch/ppc64/Makefile.inc
===================================================================
--- arch/ppc64/Makefile.inc	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ arch/ppc64/Makefile.inc	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -68,4 +68,5 @@
 	arch/$(ARCH)/src/asm.S \
 	arch/$(ARCH)/src/cpu/cpu.c \
+	arch/$(ARCH)/src/ddi/ddi.c \
 	arch/$(ARCH)/src/proc/scheduler.c \
 	arch/$(ARCH)/src/mm/as.c \
Index: arch/ppc64/src/ddi/ddi.c
===================================================================
--- arch/ppc64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
+++ arch/ppc64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * 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.
+ */
+
+#include <ddi/ddi.h>
+#include <proc/task.h>
+#include <arch/types.h>
+#include <typedefs.h>
+
+/** Enable I/O space range for task.
+ *
+ * Interrupts are disabled and task is locked.
+ *
+ * @param task Task.
+ * @param ioaddr Startign I/O space address.
+ * @param size Size of the enabled I/O range.
+ *
+ * @return 0 on success or an error code from errno.h.
+ */
+int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size)
+{
+	return 0;
+}
Index: arch/sparc64/Makefile.inc
===================================================================
--- arch/sparc64/Makefile.inc	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ arch/sparc64/Makefile.inc	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -90,3 +90,4 @@
 	arch/$(ARCH)/src/trap/exception.c \
 	arch/$(ARCH)/src/trap/interrupt.c \
+	arch/$(ARCH)/src/ddi/ddi.c \
 	arch/$(ARCH)/src/drivers/tick.c
Index: arch/sparc64/src/ddi/ddi.c
===================================================================
--- arch/sparc64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
+++ arch/sparc64/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Jakub Jermar
+ * 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.
+ */
+
+#include <ddi/ddi.h>
+#include <proc/task.h>
+#include <arch/types.h>
+#include <typedefs.h>
+
+/** Enable I/O space range for task.
+ *
+ * Interrupts are disabled and task is locked.
+ *
+ * @param task Task.
+ * @param ioaddr Startign I/O space address.
+ * @param size Size of the enabled I/O range.
+ *
+ * @return 0 on success or an error code from errno.h.
+ */
+int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size)
+{
+	return 0;
+}
Index: generic/include/ddi/ddi.h
===================================================================
--- generic/include/ddi/ddi.h	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ generic/include/ddi/ddi.h	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -32,6 +32,13 @@
 #include <ddi/ddi_arg.h>
 #include <arch/types.h>
+#include <typedefs.h>
 
-extern __native sys_map_physmem(ddi_arg_t *uspace_ddi_arg);
+extern __native sys_map_physmem(ddi_memarg_t *uspace_mem_arg);
+extern __native sys_enable_iospace(ddi_ioarg_t *uspace_io_arg);
+
+/*
+ * Interface to be implemented by all architectures.
+ */
+extern int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size);
 
 #endif
Index: generic/include/ddi/ddi_arg.h
===================================================================
--- generic/include/ddi/ddi_arg.h	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ generic/include/ddi/ddi_arg.h	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -37,5 +37,12 @@
 	unsigned long pages;		/** Number of pages to map. */
 	int writable;			/** True if the mapping should be writable. */
-} ddi_arg_t;
+} ddi_memarg_t;
+
+/** Structure encapsulating arguments for SYS_ENABLE_IOSPACE syscall. */
+typedef struct {
+	unsigned long long task_id;	/** ID of the destination task. */
+	void *ioaddr;			/** Starting I/O space address. */
+	unsigned long size;		/** Number of bytes. */
+} ddi_ioarg_t;
 
 #endif
Index: generic/include/syscall/syscall.h
===================================================================
--- generic/include/syscall/syscall.h	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ generic/include/syscall/syscall.h	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -50,4 +50,5 @@
 	SYS_IPC_HANGUP,
 	SYS_MAP_PHYSMEM,
+	SYS_ENABLE_IOSPACE,
 	SYSCALL_END
 } syscall_t;
Index: generic/src/ddi/ddi.c
===================================================================
--- generic/src/ddi/ddi.c	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ generic/src/ddi/ddi.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -112,5 +112,75 @@
 }
 
+/** Enable range of I/O space for task.
+ *
+ * @param id Task ID of the destination task.
+ * @param ioaddr Starting I/O address.
+ * @param size Size of the enabled I/O space..
+ *
+ * @return 0 on success, EPERM if the caller lacks capabilities to use this syscall,
+ *	   ENOENT if there is no task matching the specified ID.
+ */
+static int ddi_enable_iospace(task_id_t id, __address ioaddr, size_t size)
+{
+	ipl_t ipl;
+	cap_t caps;
+	task_t *t;
+	int rc;
+	
+	/*
+	 * Make sure the caller is authorised to make this syscall.
+	 */
+	caps = cap_get(TASK);
+	if (!(caps & CAP_IO_MANAGER))
+		return EPERM;
+	
+	ipl = interrupts_disable();
+	spinlock_lock(&tasks_lock);
+	
+	t = task_find_by_id(id);
+	
+	if (!t) {
+		/*
+		 * There is no task with the specified ID.
+		 */
+		spinlock_unlock(&tasks_lock);
+		interrupts_restore(ipl);
+		return ENOENT;
+	}
+
+	/*
+	 * TODO: We are currently lacking support for task destroying.
+	 * Once it is added to the kernel, we must take care to
+	 * synchronize in a way that prevents race conditions here.
+	 */
+	
+	/* Lock the task and release the lock protecting tasks_btree. */
+	spinlock_lock(&t->lock);
+	spinlock_unlock(&tasks_lock);
+
+	rc = ddi_enable_iospace_arch(t, ioaddr, size);
+	
+	spinlock_unlock(&t->lock);
+	interrupts_restore(ipl);
+	return rc;
+}
+
 /** Wrapper for SYS_MAP_PHYSMEM syscall.
+ *
+ * @param User space address of memory DDI argument structure.
+ *
+ * @return 0 on success, otherwise it returns error code found in errno.h
+ */ 
+__native sys_map_physmem(ddi_memarg_t *uspace_mem_arg)
+{
+	ddi_memarg_t arg;
+	
+	copy_from_uspace(&arg, uspace_mem_arg, sizeof(ddi_memarg_t));
+	return (__native) ddi_map_physmem((task_id_t) arg.task_id, ALIGN_DOWN((__address) arg.phys_base, FRAME_SIZE),
+					  ALIGN_DOWN((__address) arg.virt_base, PAGE_SIZE), (count_t) arg.pages,
+					  (bool) arg.writable);
+}
+
+/** Wrapper for SYS_ENABLE_IOSPACE syscall.
  *
  * @param User space address of DDI argument structure.
@@ -118,11 +188,9 @@
  * @return 0 on success, otherwise it returns error code found in errno.h
  */ 
-__native sys_map_physmem(ddi_arg_t *uspace_ddi_arg)
+__native sys_enable_iospace(ddi_ioarg_t *uspace_io_arg)
 {
-	ddi_arg_t arg;
+	ddi_ioarg_t arg;
 	
-	copy_from_uspace(&arg, uspace_ddi_arg, sizeof(ddi_arg_t));
-	return (__native) ddi_map_physmem((task_id_t) arg.task_id, ALIGN_DOWN((__address) arg.phys_base, FRAME_SIZE),
-					  ALIGN_DOWN((__address) arg.virt_base, PAGE_SIZE), (count_t) arg.pages,
-					  (bool) arg.writable);
+	copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
+	return (__native) ddi_enable_iospace((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size);
 }
Index: generic/src/syscall/syscall.c
===================================================================
--- generic/src/syscall/syscall.c	(revision 9c1ecf97b370f5342999a51032e078c14f33f5d9)
+++ generic/src/syscall/syscall.c	(revision f52e54dadbe80854e27bf629c007718c8506e33f)
@@ -94,4 +94,5 @@
 	sys_ipc_wait_for_call,
 	sys_ipc_hangup,
-	sys_map_physmem
+	sys_map_physmem,
+	sys_enable_iospace
 };
