Index: uspace/lib/c/arch/ia32/include/ddi.h
===================================================================
--- uspace/lib/c/arch/ia32/include/ddi.h	(revision c1a5d8da48d474feb86320c58506cba65757900e)
+++ uspace/lib/c/arch/ia32/include/ddi.h	(revision 667a4f84d6f4121641eb400329f6775769df3b1b)
@@ -41,63 +41,81 @@
 static inline uint8_t pio_read_8(ioport8_t *port)
 {
-	uint8_t val;
-	
-	asm volatile (
-		"inb %w[port], %b[val]\n"
-		: [val] "=a" (val)
-		: [port] "d" (port)
-	);
-	
-	return val;
+	if (((void *)port) < IO_SPACE_BOUNDARY) {
+		uint8_t val;
+		asm volatile (
+			"inb %w[port], %b[val]\n"
+			: [val] "=a" (val)
+			: [port] "d" (port)
+		);
+		return val;
+	} else {
+		return (uint8_t) *port;
+	}
 }
 
 static inline uint16_t pio_read_16(ioport16_t *port)
 {
-	uint16_t val;
-	
-	asm volatile (
-		"inw %w[port], %w[val]\n"
-		: [val] "=a" (val)
-		: [port] "d" (port)
-	);
-	
-	return val;
+	if (((void *)port) < IO_SPACE_BOUNDARY) {
+		uint16_t val;
+		asm volatile (
+			"inw %w[port], %w[val]\n"
+			: [val] "=a" (val)
+			: [port] "d" (port)
+		);
+		return val;
+	} else {
+		return (uint16_t) *port;
+	}
 }
 
 static inline uint32_t pio_read_32(ioport32_t *port)
 {
-	uint32_t val;
-	
-	asm volatile (
-		"inl %w[port], %[val]\n"
-		: [val] "=a" (val)
-		: [port] "d" (port)
-	);
-	
-	return val;
+	if (((void *)port) < IO_SPACE_BOUNDARY) {
+		uint32_t val;
+		asm volatile (
+			"inl %w[port], %[val]\n"
+			: [val] "=a" (val)
+			: [port] "d" (port)
+		);
+		return val;
+	} else {
+		return (uint32_t) *port;
+	}
 }
 
 static inline void pio_write_8(ioport8_t *port, uint8_t val)
 {
-	asm volatile (
-		"outb %b[val], %w[port]\n"
-		:: [val] "a" (val), [port] "d" (port)
-	);
+	if (((void *)port) < IO_SPACE_BOUNDARY) {
+		asm volatile (
+			"outb %b[val], %w[port]\n"
+			:: [val] "a" (val), [port] "d" (port)
+		);	
+	} else {
+		*((uint8_t *) port) = val;
+	}
 }
 
 static inline void pio_write_16(ioport16_t *port, uint16_t val)
 {
-	asm volatile (
-		"outw %w[val], %w[port]\n"
-		:: [val] "a" (val), [port] "d" (port)
-	);
+	if (((void *)port) < IO_SPACE_BOUNDARY) {
+		asm volatile (
+			"outw %w[val], %w[port]\n"
+			:: [val] "a" (val), [port] "d" (port)
+		);
+	} else {
+		*((uint16_t *) port) = val;
+	}
 }
 
 static inline void pio_write_32(ioport32_t *port, uint32_t val)
 {
-	asm volatile (
-		"outl %[val], %w[port]\n"
-		:: [val] "a" (val), [port] "d" (port)
-	);
+	if (((void *)port) < IO_SPACE_BOUNDARY) {
+		asm volatile (
+			"outl %[val], %w[port]\n"
+			:: [val] "a" (val), [port] "d" (port)
+		);
+	} else {
+		*((uint32_t *) port) = val;
+	}
 }
 
