Index: ioemu/cpu-all.h
===================================================================
--- ioemu.orig/cpu-all.h	2007-05-03 18:38:09.000000000 +0100
+++ ioemu/cpu-all.h	2007-05-03 19:00:05.000000000 +0100
@@ -830,7 +830,7 @@
 
 /* memory API */
 
-extern int phys_ram_size;
+extern uint64_t phys_ram_size;
 extern int phys_ram_fd;
 extern uint8_t *phys_ram_base;
 extern uint8_t *phys_ram_dirty;
Index: ioemu/hw/pc.c
===================================================================
--- ioemu.orig/hw/pc.c	2007-05-03 18:44:07.000000000 +0100
+++ ioemu/hw/pc.c	2007-05-03 19:00:05.000000000 +0100
@@ -156,7 +156,7 @@
 }
 
 /* hd_table must contain 4 block drivers */
-static void cmos_init(int ram_size, int boot_device, BlockDriverState **hd_table)
+static void cmos_init(uint64_t ram_size, int boot_device, BlockDriverState **hd_table)
 {
     RTCState *s = rtc_state;
     int val;
@@ -445,7 +445,7 @@
 }
 
 /* PC hardware initialisation */
-static void pc_init1(int ram_size, int vga_ram_size, int boot_device,
+static void pc_init1(uint64_t ram_size, int vga_ram_size, int boot_device,
                      DisplayState *ds, const char **fd_filename, int snapshot,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename,
@@ -738,7 +738,7 @@
 #endif
 }
 
-static void pc_init_pci(int ram_size, int vga_ram_size, int boot_device,
+static void pc_init_pci(uint64_t ram_size, int vga_ram_size, int boot_device,
                         DisplayState *ds, const char **fd_filename, 
                         int snapshot, 
                         const char *kernel_filename, 
@@ -751,7 +751,7 @@
              initrd_filename, 1);
 }
 
-static void pc_init_isa(int ram_size, int vga_ram_size, int boot_device,
+static void pc_init_isa(uint64_t ram_size, int vga_ram_size, int boot_device,
                         DisplayState *ds, const char **fd_filename, 
                         int snapshot, 
                         const char *kernel_filename, 
Index: ioemu/vl.c
===================================================================
--- ioemu.orig/vl.c	2007-05-03 18:57:23.000000000 +0100
+++ ioemu/vl.c	2007-05-03 19:00:05.000000000 +0100
@@ -132,7 +132,7 @@
 const char* keyboard_layout = NULL;
 int64_t ticks_per_sec;
 int boot_device = 'c';
-int ram_size;
+uint64_t ram_size;
 int pit_min_timer_count = 0;
 int nb_nics;
 NICInfo nd_table[MAX_NICS];
@@ -6818,7 +6818,7 @@
                 help();
                 break;
             case QEMU_OPTION_m:
-                ram_size = atoi(optarg) * 1024 * 1024;
+                ram_size = atol(optarg) * 1024 * 1024;
                 if (ram_size <= 0)
                     help();
                 if (ram_size > PHYS_RAM_MAX_SIZE) {
Index: ioemu/vl.h
===================================================================
--- ioemu.orig/vl.h	2007-05-03 18:57:23.000000000 +0100
+++ ioemu/vl.h	2007-05-03 19:00:05.000000000 +0100
@@ -151,7 +151,7 @@
 extern int xc_handle;
 extern int domid;
 
-extern int ram_size;
+extern uint64_t ram_size;
 extern int bios_size;
 extern int rtc_utc;
 extern int cirrus_vga_enabled;
@@ -688,7 +688,7 @@
 
 #ifndef QEMU_TOOL
 
-typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size, 
+typedef void QEMUMachineInitFunc(uint64_t ram_size, int vga_ram_size, 
                                  int boot_device,
              DisplayState *ds, const char **fd_filename, int snapshot,
              const char *kernel_filename, const char *kernel_cmdline,
Index: ioemu/hw/vga.c
===================================================================
--- ioemu.orig/hw/vga.c	2007-05-03 18:59:25.000000000 +0100
+++ ioemu/hw/vga.c	2007-05-03 19:00:05.000000000 +0100
@@ -1379,7 +1379,8 @@
 static void vga_draw_graphic(VGAState *s, int full_update)
 {
     int y1, y, update, page_min, page_max, linesize, y_start, double_scan, mask;
-    int width, height, shift_control, line_offset, page0, page1, bwidth;
+    int width, height, shift_control, line_offset, bwidth;
+    ram_addr_t page0, page1;
     int disp_width, multi_scan, multi_run;
     uint8_t *d;
     uint32_t v, addr1, addr;
