Index: ioemu/cpu-all.h
===================================================================
--- ioemu.orig/cpu-all.h	2007-05-02 16:04:46.000000000 +0100
+++ ioemu/cpu-all.h	2007-05-02 16:05:50.000000000 +0100
@@ -822,7 +822,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-02 16:04:46.000000000 +0100
+++ ioemu/hw/pc.c	2007-05-02 16:05:50.000000000 +0100
@@ -155,7 +155,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;
@@ -610,7 +610,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,
@@ -882,7 +882,7 @@
     }
 }
 
-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, 
@@ -895,7 +895,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-02 16:05:50.000000000 +0100
+++ ioemu/vl.c	2007-05-02 16:05:50.000000000 +0100
@@ -122,7 +122,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];
@@ -5899,7 +5899,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-02 16:05:50.000000000 +0100
+++ ioemu/vl.h	2007-05-02 16:05:50.000000000 +0100
@@ -146,7 +146,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;
@@ -561,7 +561,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-02 16:05:50.000000000 +0100
+++ ioemu/hw/vga.c	2007-05-02 16:05:50.000000000 +0100
@@ -1365,7 +1365,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;
