Index: kernel/arch/ia64/include/asm.h
===================================================================
--- kernel/arch/ia64/include/asm.h	(revision 699f3bcdc98661bd594c7b8a7ce07aa2ccc02155)
+++ kernel/arch/ia64/include/asm.h	(revision 86a34d3e4d287b5a98f96a5b7e0a0a001d5529f8)
@@ -44,10 +44,16 @@
 #define IA64_IOSPACE_ADDRESS  0xE001000000000000ULL
 
+#define IO_SPACE_BOUNDARY       ((void *) (64 * 1024))
+
 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v)
 {
-	uintptr_t prt = (uintptr_t) port;
-	
-	*((ioport8_t *) (IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
+	
+		*((ioport8_t *) (IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	} else {
+		*port = v;
+	}
 	
 	asm volatile (
@@ -59,8 +65,12 @@
 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v)
 {
-	uintptr_t prt = (uintptr_t) port;
-	
-	*((ioport16_t *) (IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
+	
+		*((ioport16_t *) (IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	} else {
+		*port = v;
+	}
 	
 	asm volatile (
@@ -72,8 +82,12 @@
 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v)
 {
-	uintptr_t prt = (uintptr_t) port;
-	
-	*((ioport32_t *) (IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
+	
+		*((ioport32_t *) (IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
+	} else {
+		*port = v;
+	}
 	
 	asm volatile (
@@ -85,39 +99,63 @@
 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port)
 {
-	uintptr_t prt = (uintptr_t) port;
-	
-	asm volatile (
-		"mf\n"
-		::: "memory"
-	);
-	
-	return *((ioport8_t *) (IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	uint8_t v;
+
+	asm volatile (
+		"mf\n"
+		::: "memory"
+	);
+
+	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;
 }
 
 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port)
 {
-	uintptr_t prt = (uintptr_t) port;
-	
-	asm volatile (
-		"mf\n"
-		::: "memory"
-	);
-	
-	return *((ioport16_t *) (IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	uint16_t v;
+
+	asm volatile (
+		"mf\n"
+		::: "memory"
+	);
+
+	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;
 }
 
 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port)
 {
-	uintptr_t prt = (uintptr_t) port;
-	
-	asm volatile (
-		"mf\n"
-		::: "memory"
-	);
-	
-	return *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
-	    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	uint32_t v;
+	
+	asm volatile (
+		"mf\n"
+		::: "memory"
+	);
+	
+	if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
+		uintptr_t prt = (uintptr_t) port;
+		
+		v = *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
+		    ((prt & 0xfff) | ((prt >> 2) << 12))));
+	} else {
+		v = *port;
+	}
+
+	return v;
 }
 
Index: uspace/lib/c/arch/ia64/include/ddi.h
===================================================================
--- uspace/lib/c/arch/ia64/include/ddi.h	(revision 699f3bcdc98661bd594c7b8a7ce07aa2ccc02155)
+++ uspace/lib/c/arch/ia64/include/ddi.h	(revision 86a34d3e4d287b5a98f96a5b7e0a0a001d5529f8)
@@ -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;
 }
 
