diff --git a/drivers/adb_kbd.c b/drivers/adb_kbd.c
index 0784ec8..10a5197 100644
--- a/drivers/adb_kbd.c
+++ b/drivers/adb_kbd.c
@@ -483,7 +483,7 @@ static int adb_kbd_read (void *private)
     int key;
     int ret;
 
-    kbd = (void *)dev->state;
+    kbd = (void *)(uintptr_t)dev->state;
 
     if (kbd->len > 0) {
         ret = kbd->sequence[kbd->len-- - 1];
@@ -531,7 +531,7 @@ void *adb_kbd_new (char *path, void *private)
 			ADB_kbd_us, ADB_sequences);
         kbd->next_key = -1;
         kbd->len = 0;
-	dev->state = (int32_t)kbd;
+	dev->state = (uint32_t)(uintptr_t)kbd;
 	my_adb_dev = dev;
     }
 
diff --git a/drivers/cuda.c b/drivers/cuda.c
index c254720..4d784de 100644
--- a/drivers/cuda.c
+++ b/drivers/cuda.c
@@ -65,12 +65,12 @@
 
 static uint8_t cuda_readb (cuda_t *dev, int reg)
 {
-	    return *(volatile uint8_t *)(dev->base + reg);
+	    return *(volatile uint8_t *)(uintptr_t)(dev->base + reg);
 }
 
 static void cuda_writeb (cuda_t *dev, int reg, uint8_t val)
 {
-	    *(volatile uint8_t *)(dev->base + reg) = val;
+	    *(volatile uint8_t *)(uintptr_t)(dev->base + reg) = val;
 }
 
 static void cuda_wait_irq (cuda_t *dev)
diff --git a/drivers/escc.c b/drivers/escc.c
index 809cfa8..c70e7ea 100644
--- a/drivers/escc.c
+++ b/drivers/escc.c
@@ -54,19 +54,19 @@ static volatile unsigned char *serial_dev;
 #define Rx_CH_AV        0x1     /* Rx Character Available */
 #define Tx_BUF_EMP      0x4     /* Tx Buffer empty */
 
-int uart_charav(int port)
+int uart_charav(uintptr_t port)
 {
     return (CTRL(port) & Rx_CH_AV) != 0;
 }
 
-char uart_getchar(int port)
+char uart_getchar(uintptr_t port)
 {
     while (!uart_charav(port))
         ;
     return DATA(port) & 0177;
 }
 
-static void uart_putchar(int port, unsigned char c)
+static void uart_putchar(uintptr_t port, unsigned char c)
 {
     if (!serial_dev)
         return;
@@ -102,7 +102,7 @@ static void uart_init_line(volatile unsigned char *port, unsigned long baud)
 
 }
 
-int uart_init(uint64_t port, unsigned long speed)
+int uart_init(uintptr_t port, unsigned long speed)
 {
 #ifdef CONFIG_DRIVER_ESCC_SUN
     serial_dev = map_io(port & ~7ULL, ZS_REGS);
@@ -116,7 +116,7 @@ int uart_init(uint64_t port, unsigned long speed)
 
 void serial_putchar(int c)
 {
-    uart_putchar((int)serial_dev, (unsigned char) (c & 0xff));
+    uart_putchar((uintptr_t)serial_dev, (unsigned char) (c & 0xff));
 }
 
 void serial_cls(void)
@@ -140,7 +140,7 @@ escc_read(unsigned long *address)
     addr = (char *)cell2pointer(POP());
 
     if (len < 1)
-        printk("escc_read: bad len, addr %x len %x\n", (unsigned int)addr, len);
+        printk("escc_read: bad len, addr %p len %x\n", addr, len);
 
     if (uart_charav(*address)) {
         *addr = (char)uart_getchar(*address);
@@ -369,7 +369,7 @@ ob_zs_init(uint64_t base, uint64_t offset, int intr, int slave, int keyboard)
 #else
 
 static void
-escc_add_channel(const char *path, const char *node, uint32_t addr,
+escc_add_channel(const char *path, const char *node, uintptr_t addr,
                  uint32_t offset)
 {
     char buf[64], tty[32];
@@ -430,7 +430,7 @@ escc_add_channel(const char *path, const char *node, uint32_t addr,
 }
 
 void
-escc_init(const char *path, unsigned long addr)
+escc_init(const char *path, uintptr_t addr)
 {
     char buf[64];
     int props[2];
diff --git a/drivers/macio.c b/drivers/macio.c
index d6d1696..55528c1 100644
--- a/drivers/macio.c
+++ b/drivers/macio.c
@@ -43,7 +43,7 @@ arch_nvram_size( void )
                 return NW_IO_NVRAM_SIZE >> NW_IO_NVRAM_SHIFT;
 }
 
-void macio_nvram_init(const char *path, uint32_t addr)
+void macio_nvram_init(const char *path, uintptr_t addr)
 {
 	phandle_t chosen, aliases;
 	phandle_t dnode;
@@ -145,7 +145,7 @@ arch_nvram_get( char *buf )
 }
 
 static void
-openpic_init(const char *path, uint32_t addr)
+openpic_init(const char *path, uintptr_t addr)
 {
         phandle_t target_node;
         phandle_t dnode;
@@ -238,7 +238,7 @@ NODE_METHODS(ob_macio) = {
 };
 
 void
-ob_macio_heathrow_init(const char *path, uint32_t addr)
+ob_macio_heathrow_init(const char *path, uintptr_t addr)
 {
         phandle_t aliases;
 
@@ -253,7 +253,7 @@ ob_macio_heathrow_init(const char *path, uint32_t addr)
 }
 
 void
-ob_macio_keylargo_init(const char *path, uint32_t addr)
+ob_macio_keylargo_init(const char *path, uintptr_t addr)
 {
         phandle_t aliases;
 
diff --git a/drivers/macio.h b/drivers/macio.h
index d580387..9fcd167 100644
--- a/drivers/macio.h
+++ b/drivers/macio.h
@@ -1,5 +1,5 @@
 extern phandle_t pic_handle;
 
-void ob_macio_heathrow_init(const char *path, uint32_t addr);
-void ob_macio_keylargo_init(const char *path, uint32_t addr);
-void macio_nvram_init(const char *path, uint32_t addr);
+void ob_macio_heathrow_init(const char *path, uintptr_t addr);
+void ob_macio_keylargo_init(const char *path, uintptr_t addr);
+void macio_nvram_init(const char *path, uintptr_t addr);
diff --git a/include/arch/ppc/io.h b/include/arch/ppc/io.h
index d7c78a0..e5180f2 100644
--- a/include/arch/ppc/io.h
+++ b/include/arch/ppc/io.h
@@ -22,15 +22,15 @@ extern uint32_t isa_io_base;
  * are arrays of bytes, and byte-swapping is not appropriate in
  * that case.  - paulus
  */
-#define insw(port, buf, ns)	_insw((uint16_t *)((port)+isa_io_base), (buf), (ns))
-#define outsw(port, buf, ns)	_outsw((uint16_t *)((port)+isa_io_base), (buf), (ns))
-
-#define inb(port)		in_8((uint8_t *)((port)+isa_io_base))
-#define outb(val, port)		out_8((uint8_t *)((port)+isa_io_base), (val))
-#define inw(port)		in_le16((uint16_t *)((port)+isa_io_base))
-#define outw(val, port)		out_le16((uint16_t *)((port)+isa_io_base), (val))
-#define inl(port)		in_le32((uint32_t *)((port)+isa_io_base))
-#define outl(val, port)		out_le32((uint32_t *)((port)+isa_io_base), (val))
+#define insw(port, buf, ns)	_insw((uint16_t *)(uintptr_t)((port)+isa_io_base), (buf), (ns))
+#define outsw(port, buf, ns)	_outsw((uint16_t *)(uintptr_t)((port)+isa_io_base), (buf), (ns))
+
+#define inb(port)		in_8((uint8_t *)(uintptr_t)((port)+isa_io_base))
+#define outb(val, port)		out_8((uint8_t *)(uintptr_t)((port)+isa_io_base), (val))
+#define inw(port)		in_le16((uint16_t *)(uintptr_t)((port)+isa_io_base))
+#define outw(val, port)		out_le16((uint16_t *)(uintptr_t)((port)+isa_io_base), (val))
+#define inl(port)		in_le32((uint32_t *)(uintptr_t)((port)+isa_io_base))
+#define outl(val, port)		out_le32((uint32_t *)(uintptr_t)((port)+isa_io_base), (val))
 
 /*
  * 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
diff --git a/include/drivers/drivers.h b/include/drivers/drivers.h
index 6829572..cf17d8e 100644
--- a/include/drivers/drivers.h
+++ b/include/drivers/drivers.h
@@ -113,9 +113,9 @@ char uart_getchar(int port);
 void serial_putchar(int c);
 #endif
 #ifdef CONFIG_DRIVER_ESCC
-int uart_init(uint64_t port, unsigned long speed);
-int uart_charav(int port);
-char uart_getchar(int port);
+int uart_init(uintptr_t port, unsigned long speed);
+int uart_charav(uintptr_t port);
+char uart_getchar(uintptr_t port);
 void serial_putchar(int c);
 void serial_cls(void);
 #ifdef CONFIG_DRIVER_ESCC_SUN
diff --git a/include/kernel/stack.h b/include/kernel/stack.h
index 809ffe9..44fef0f 100644
--- a/include/kernel/stack.h
+++ b/include/kernel/stack.h
@@ -31,8 +31,8 @@ typedef ucell phandle_t;
 
 
 #ifdef NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH
-#define pointer2cell(x) ((ucell)(x))
-#define cell2pointer(x) ((u8 *)(x))
+#define pointer2cell(x) ((ucell)(uintptr_t)(x))
+#define cell2pointer(x) ((u8 *)(uintptr_t)(x))
 #endif
 #ifdef NATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH
 #define pointer2cell(x) ((ucell)(((unsigned long)(x))-base_address))
