Index: uspace/lib/c/arch/ia64/include/ddi.h
===================================================================
--- uspace/lib/c/arch/ia64/include/ddi.h	(revision 1ab4aca491cf0003d347c3cd744f19376766cddd)
+++ uspace/lib/c/arch/ia64/include/ddi.h	(revision 1924bd430b10bc842d09d99ede55d445ffc680ca)
@@ -52,8 +52,12 @@
 static inline void pio_write_8(ioport8_t *port, uint8_t v)
 {
-	uintptr_t prt = (uintptr_t) port;
+	if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
 
-	*((ioport8_t *)(IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+		*((ioport8_t *)(IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	} else {
+		*port = v;
+	}
 
 	asm volatile ("mf\n" ::: "memory");
@@ -62,8 +66,12 @@
 static inline void pio_write_16(ioport16_t *port, uint16_t v)
 {
-	uintptr_t prt = (uintptr_t) port;
+	if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
 
-	*((ioport16_t *)(IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+		*((ioport16_t *)(IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	} else {
+		*port = v;
+	}
 
 	asm volatile ("mf\n" ::: "memory");
@@ -72,8 +80,12 @@
 static inline void pio_write_32(ioport32_t *port, uint32_t v)
 {
-	uintptr_t prt = (uintptr_t) port;
+	if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
 
-	*((ioport32_t *)(IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+		*((ioport32_t *)(IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	} else {
+		*port = v;
+	}
 
 	asm volatile ("mf\n" ::: "memory");
@@ -82,30 +94,54 @@
 static inline uint8_t pio_read_8(ioport8_t *port)
 {
-	uintptr_t prt = (uintptr_t) port;
+	uint8_t v;
 
 	asm volatile ("mf\n" ::: "memory");
 
-	return *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
+
+		v = *((ioport8_t *)(IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	} else {
+		v = *port;
+	}
+
+	return v;
 }
 
 static inline uint16_t pio_read_16(ioport16_t *port)
 {
-	uintptr_t prt = (uintptr_t) port;
+	uint16_t v;
 
 	asm volatile ("mf\n" ::: "memory");
 
-	return *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
+
+		v = *((ioport16_t *)(IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	} else {
+		v = *port;
+	}
+
+	return v;
 }
 
 static inline uint32_t pio_read_32(ioport32_t *port)
 {
-	uintptr_t prt = (uintptr_t) port;
+	uint32_t v;
 
 	asm volatile ("mf\n" ::: "memory");
 
-	return *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	if (port < (ioport32_t *) port) {
+		uintptr_t prt = (uintptr_t) port;
+
+		v = *((ioport32_t *)(IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	} else {
+		v = *port;
+	}
+
+	return v;
 }
 
