I updated the >2G memory patch a bit. It seems that Linux and the BSDs
do not support having more than 4G of memory on Sparc32. There may
have been real machines with up to 5G of memory and even 16G on Crays,
but probably Linux hasn't been ported to those systems.

Therefore I don't have much interest to continue to this direction. Is
the patch OK for other targets? I'd like to commit this soon.
Index: qemu/cpu-all.h
===================================================================
--- qemu.orig/cpu-all.h	2007-09-29 12:29:47.000000000 +0000
+++ qemu/cpu-all.h	2007-09-29 12:30:12.000000000 +0000
@@ -771,7 +771,7 @@
 
 /* memory API */
 
-extern int phys_ram_size;
+extern unsigned long phys_ram_size;
 extern int phys_ram_fd;
 extern uint8_t *phys_ram_base;
 extern uint8_t *phys_ram_dirty;
@@ -797,8 +797,8 @@
 void cpu_register_physical_memory(target_phys_addr_t start_addr,
                                   unsigned long size,
                                   unsigned long phys_offset);
-uint32_t cpu_get_physical_page_desc(target_phys_addr_t addr);
-ram_addr_t qemu_ram_alloc(unsigned int size);
+unsigned long cpu_get_physical_page_desc(target_phys_addr_t addr);
+ram_addr_t qemu_ram_alloc(unsigned long size);
 void qemu_ram_free(ram_addr_t addr);
 int cpu_register_io_memory(int io_index,
                            CPUReadMemoryFunc **mem_read,
Index: qemu/exec.c
===================================================================
--- qemu.orig/exec.c	2007-09-29 12:30:03.000000000 +0000
+++ qemu/exec.c	2007-09-29 12:30:12.000000000 +0000
@@ -72,9 +72,11 @@
 #define TARGET_VIRT_ADDR_SPACE_BITS 42
 #elif defined(TARGET_PPC64)
 #define TARGET_PHYS_ADDR_SPACE_BITS 42
-#else
+#elif USE_KQEMU
 /* Note: for compatibility with kqemu, we use 32 bits for x86_64 */
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
+#else
+#define TARGET_PHYS_ADDR_SPACE_BITS 42
 #endif
 
 TranslationBlock tbs[CODE_GEN_MAX_BLOCKS];
@@ -86,7 +88,7 @@
 uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE] __attribute__((aligned (32)));
 uint8_t *code_gen_ptr;
 
-int phys_ram_size;
+unsigned long phys_ram_size;
 int phys_ram_fd;
 uint8_t *phys_ram_base;
 uint8_t *phys_ram_dirty;
@@ -111,7 +113,7 @@
 
 typedef struct PhysPageDesc {
     /* offset in host memory of the page + io_index in the low 12 bits */
-    uint32_t phys_offset;
+    unsigned long phys_offset;
 } PhysPageDesc;
 
 #define L2_BITS 10
@@ -122,7 +124,7 @@
  */
 #define L1_BITS (TARGET_VIRT_ADDR_SPACE_BITS - L2_BITS - TARGET_PAGE_BITS)
 #else
-#define L1_BITS (32 - L2_BITS - TARGET_PAGE_BITS)
+#define L1_BITS (42 - L2_BITS - TARGET_PAGE_BITS)
 #endif
 
 #define L1_SIZE (1 << L1_BITS)
@@ -211,7 +213,7 @@
     memset(l1_phys_map, 0, L1_SIZE * sizeof(void *));
 }
 
-static inline PageDesc *page_find_alloc(unsigned int index)
+static inline PageDesc *page_find_alloc(unsigned long index)
 {
     PageDesc **lp, *p;
 
@@ -1938,7 +1940,7 @@
 
 static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
                              int memory);
-static void *subpage_init (target_phys_addr_t base, uint32_t *phys,
+static void *subpage_init (target_phys_addr_t base, unsigned long *phys,
                            int orig_memory);
 #define CHECK_SUBPAGE(addr, start_addr, start_addr2, end_addr, end_addr2, \
                       need_subpage)                                     \
@@ -2031,7 +2033,7 @@
 }
 
 /* XXX: temporary until new memory mapping API */
-uint32_t cpu_get_physical_page_desc(target_phys_addr_t addr)
+unsigned long cpu_get_physical_page_desc(target_phys_addr_t addr)
 {
     PhysPageDesc *p;
 
@@ -2042,11 +2044,11 @@
 }
 
 /* XXX: better than nothing */
-ram_addr_t qemu_ram_alloc(unsigned int size)
+ram_addr_t qemu_ram_alloc(unsigned long size)
 {
     ram_addr_t addr;
     if ((phys_ram_alloc_offset + size) >= phys_ram_size) {
-        fprintf(stderr, "Not enough memory (requested_size = %u, max memory = %d)\n",
+        fprintf(stderr, "Not enough memory (requested_size = %lu, max memory = %lu)\n",
                 size, phys_ram_size);
         abort();
     }
@@ -2382,7 +2384,7 @@
     return 0;
 }
 
-static void *subpage_init (target_phys_addr_t base, uint32_t *phys,
+static void *subpage_init (target_phys_addr_t base, unsigned long *phys,
                            int orig_memory)
 {
     subpage_t *mmio;
Index: qemu/vl.c
===================================================================
--- qemu.orig/vl.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/vl.c	2007-09-29 12:30:12.000000000 +0000
@@ -126,7 +126,11 @@
 //#define DEBUG_UNUSED_IOPORT
 //#define DEBUG_IOPORT
 
+#if HOST_LONG_BITS < 64
 #define PHYS_RAM_MAX_SIZE (2047 * 1024 * 1024)
+#else
+#define PHYS_RAM_MAX_SIZE (2047 * 1024 * 1024 * 1024ULL)
+#endif
 
 #ifdef TARGET_PPC
 #define DEFAULT_RAM_SIZE 144
@@ -161,7 +165,7 @@
 const char* keyboard_layout = NULL;
 int64_t ticks_per_sec;
 int boot_device = 'c';
-int ram_size;
+unsigned long ram_size;
 int pit_min_timer_count = 0;
 int nb_nics;
 NICInfo nd_table[MAX_NICS];
@@ -7852,12 +7856,12 @@
                 help(0);
                 break;
             case QEMU_OPTION_m:
-                ram_size = atoi(optarg) * 1024 * 1024;
+                ram_size = atol(optarg) * 1024 * 1024;
                 if (ram_size <= 0)
                     help(1);
                 if (ram_size > PHYS_RAM_MAX_SIZE) {
                     fprintf(stderr, "qemu: at most %d MB RAM can be simulated\n",
-                            PHYS_RAM_MAX_SIZE / (1024 * 1024));
+                            (int)(PHYS_RAM_MAX_SIZE / (1024 * 1024)));
                     exit(1);
                 }
                 break;
Index: qemu/vl.h
===================================================================
--- qemu.orig/vl.h	2007-09-29 12:30:03.000000000 +0000
+++ qemu/vl.h	2007-09-29 12:30:12.000000000 +0000
@@ -162,7 +162,7 @@
 
 void main_loop_wait(int timeout);
 
-extern int ram_size;
+extern unsigned long ram_size;
 extern int bios_size;
 extern int rtc_utc;
 extern int cirrus_vga_enabled;
@@ -723,7 +723,7 @@
 
 #ifndef QEMU_TOOL
 
-typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size,
+typedef void QEMUMachineInitFunc(unsigned long 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: qemu/hw/pc.c
===================================================================
--- qemu.orig/hw/pc.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/pc.c	2007-09-29 12:30:12.000000000 +0000
@@ -152,7 +152,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(unsigned long ram_size, unsigned long above_bios_ram_size, int boot_device, BlockDriverState **hd_table)
 {
     RTCState *s = rtc_state;
     int val;
@@ -174,6 +174,11 @@
     rtc_set_memory(s, 0x30, val);
     rtc_set_memory(s, 0x31, val >> 8);
 
+    val = (unsigned int)above_bios_ram_size / 65536;
+    rtc_set_memory(s, 0x5b, val);
+    rtc_set_memory(s, 0x5c, val >> 8);
+    rtc_set_memory(s, 0x5d, above_bios_ram_size/0x100000000);
+
     if (ram_size > (16 * 1024 * 1024))
         val = (ram_size / 65536) - ((16 * 1024 * 1024) / 65536);
     else
@@ -662,7 +667,7 @@
 }
 
 /* PC hardware initialisation */
-static void pc_init1(int ram_size, int vga_ram_size, int boot_device,
+static void pc_init1(unsigned long 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,
@@ -670,7 +675,7 @@
 {
     char buf[1024];
     int ret, linux_boot, i;
-    ram_addr_t ram_addr, vga_ram_addr, bios_offset, vga_bios_offset;
+    ram_addr_t ram_addr, vga_ram_addr, bios_offset, vga_bios_offset, above_bios_mem_size = 0;
     int bios_size, isa_bios_size, vga_bios_size;
     PCIBus *pci_bus;
     int piix3_devfn = -1;
@@ -679,6 +684,10 @@
     qemu_irq *cpu_irq;
     qemu_irq *i8259;
 
+    if (ram_size >= 0xf0000000) {
+        above_bios_mem_size = ram_size - 0xf0000000;
+        ram_size = 0xf0000000;
+    }
     linux_boot = (kernel_filename != NULL);
 
     /* init CPUs */
@@ -699,8 +708,10 @@
     }
 
     /* allocate RAM */
-    ram_addr = qemu_ram_alloc(ram_size);
+    ram_addr = qemu_ram_alloc(ram_size + above_bios_mem_size);
     cpu_register_physical_memory(0, ram_size, ram_addr);
+    if(above_bios_mem_size > 0)
+        cpu_register_physical_memory(0x100000000, above_bios_mem_size, ram_addr + ram_size);
 
     /* allocate VGA RAM */
     vga_ram_addr = qemu_ram_alloc(vga_ram_size);
@@ -898,7 +909,7 @@
 
     floppy_controller = fdctrl_init(i8259[6], 2, 0, 0x3f0, fd_table);
 
-    cmos_init(ram_size, boot_device, bs_table);
+    cmos_init(ram_size - 128 * 1024 * 1024, above_bios_mem_size, boot_device, bs_table);
 
     if (pci_enabled && usb_enabled) {
         usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
@@ -937,7 +948,7 @@
 #endif
 }
 
-static void pc_init_pci(int ram_size, int vga_ram_size, int boot_device,
+static void pc_init_pci(unsigned long ram_size, int vga_ram_size, int boot_device,
                         DisplayState *ds, const char **fd_filename,
                         int snapshot,
                         const char *kernel_filename,
@@ -951,7 +962,7 @@
              initrd_filename, 1);
 }
 
-static void pc_init_isa(int ram_size, int vga_ram_size, int boot_device,
+static void pc_init_isa(unsigned long ram_size, int vga_ram_size, int boot_device,
                         DisplayState *ds, const char **fd_filename,
                         int snapshot,
                         const char *kernel_filename,
Index: qemu/hw/vga.c
===================================================================
--- qemu.orig/hw/vga.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/vga.c	2007-09-29 12:30:12.000000000 +0000
@@ -1415,10 +1415,11 @@
 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;
     int disp_width, multi_scan, multi_run;
     uint8_t *d;
     uint32_t v, addr1, addr;
+    unsigned long page0, page1;
     vga_draw_line_func *vga_draw_line;
 
     full_update |= update_basic_params(s);
Index: qemu/hw/sun4m.c
===================================================================
--- qemu.orig/hw/sun4m.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/sun4m.c	2007-09-29 12:30:12.000000000 +0000
@@ -158,7 +158,7 @@
 extern int nographic;
 
 static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
-		       int boot_device, uint32_t RAM_size,
+		       int boot_device, unsigned long RAM_size,
 		       uint32_t kernel_size,
 		       int width, int height, int depth,
                        int machine_id)
@@ -174,7 +174,7 @@
     m48t59_write(nvram, 0x2D, smp_cpus & 0xff);
     m48t59_write(nvram, 0x2E, 0);
     m48t59_write(nvram, 0x2F, nographic & 0xff);
-    nvram_set_lword(nvram,  0x30, RAM_size);
+    nvram_set_lword(nvram,  0x30, RAM_size & 0xffffffff);
     m48t59_write(nvram, 0x34, boot_device & 0xff);
     nvram_set_lword(nvram,  0x38, KERNEL_LOAD_ADDR);
     nvram_set_lword(nvram,  0x3C, kernel_size);
@@ -187,6 +187,7 @@
     nvram_set_word(nvram,   0x54, width);
     nvram_set_word(nvram,   0x56, height);
     nvram_set_word(nvram,   0x58, depth);
+    nvram_set_lword(nvram,  0x5c, RAM_size >> 32);
 
     // OpenBIOS nvram variables
     // Variable partition
@@ -306,7 +307,7 @@
     env->halted = 1;
 }
 
-static void *sun4m_hw_init(const struct hwdef *hwdef, int RAM_size,
+static void *sun4m_hw_init(const struct hwdef *hwdef, unsigned long RAM_size,
                            DisplayState *ds, const char *cpu_model)
 
 {
@@ -411,7 +412,8 @@
     return nvram;
 }
 
-static void sun4m_load_kernel(long vram_size, int RAM_size, int boot_device,
+static void sun4m_load_kernel(long vram_size, unsigned long RAM_size,
+                              int boot_device,
                               const char *kernel_filename,
                               const char *kernel_cmdline,
                               const char *initrd_filename,
@@ -546,17 +548,19 @@
     },
 };
 
-static void sun4m_common_init(int RAM_size, int boot_device, DisplayState *ds,
-                              const char *kernel_filename, const char *kernel_cmdline,
-                              const char *initrd_filename, const char *cpu_model,
-                              unsigned int machine, int max_ram)
+static void sun4m_common_init(unsigned long RAM_size, int boot_device,
+                              DisplayState *ds,
+                              const char *kernel_filename,
+                              const char *kernel_cmdline,
+                              const char *initrd_filename,
+                              const char *cpu_model,
+                              unsigned int machine, unsigned long max_ram)
 {
     void *nvram;
 
-    if ((unsigned int)RAM_size > (unsigned int)max_ram) {
-        fprintf(stderr, "qemu: Too much memory for this machine: %d, maximum %d\n",
-                (unsigned int)RAM_size / (1024 * 1024),
-                (unsigned int)max_ram / (1024 * 1024));
+    if (RAM_size > max_ram) {
+        fprintf(stderr, "qemu: Too much memory for this machine: %ld, maximum %ld\n",
+                RAM_size / (1024 * 1024), max_ram / (1024 * 1024));
         exit(1);
     }
     nvram = sun4m_hw_init(&hwdefs[machine], RAM_size, ds, cpu_model);
@@ -567,10 +571,10 @@
 }
 
 /* SPARCstation 5 hardware initialisation */
-static void ss5_init(int 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, const char *cpu_model)
+static void ss5_init(unsigned long 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, const char *cpu_model)
 {
     if (cpu_model == NULL)
         cpu_model = "Fujitsu MB86904";
@@ -580,16 +584,16 @@
 }
 
 /* SPARCstation 10 hardware initialisation */
-static void ss10_init(int 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, const char *cpu_model)
+static void ss10_init(unsigned long 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, const char *cpu_model)
 {
     if (cpu_model == NULL)
         cpu_model = "TI SuperSparc II";
     sun4m_common_init(RAM_size, boot_device, ds, kernel_filename,
                       kernel_cmdline, initrd_filename, cpu_model,
-                      1, 0xffffffff); // XXX actually first 62GB ok
+                      1, 0xe000000000ULL);
 }
 
 QEMUMachine ss5_machine = {
Index: qemu/target-sparc/op_helper.c
===================================================================
--- qemu.orig/target-sparc/op_helper.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/target-sparc/op_helper.c	2007-09-29 12:30:12.000000000 +0000
@@ -251,8 +251,7 @@
             break;
         }
         break;
-    case 0x2e: /* MMU passthrough, 0xexxxxxxxx */
-    case 0x2f: /* MMU passthrough, 0xfxxxxxxxx */
+    case 0x21 ... 0x2f: /* MMU passthrough, 0x1xxxxxxxx .. 0xfxxxxxxxx .. */
         switch(size) {
         case 1:
             ret = ldub_phys((target_phys_addr_t)T0
@@ -275,7 +274,6 @@
             break;
         }
         break;
-    case 0x21 ... 0x2d: /* MMU passthrough, unassigned */
     default:
         do_unassigned_access(T0, 0, 0, 1);
         ret = 0;
Index: qemu/hw/an5206.c
===================================================================
--- qemu.orig/hw/an5206.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/an5206.c	2007-09-29 12:30:12.000000000 +0000
@@ -27,7 +27,8 @@
 
 /* Board init.  */
 
-static void an5206_init(int ram_size, int vga_ram_size, int boot_device,
+static void an5206_init(unsigned long 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, const char *cpu_model)
Index: qemu/hw/integratorcp.c
===================================================================
--- qemu.orig/hw/integratorcp.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/integratorcp.c	2007-09-29 12:30:12.000000000 +0000
@@ -462,7 +462,8 @@
 
 /* Board init.  */
 
-static void integratorcp_init(int ram_size, int vga_ram_size, int boot_device,
+static void integratorcp_init(unsigned long 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, const char *cpu_model)
Index: qemu/hw/mcf5208.c
===================================================================
--- qemu.orig/hw/mcf5208.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/mcf5208.c	2007-09-29 12:30:12.000000000 +0000
@@ -197,7 +197,8 @@
     }
 }
 
-static void mcf5208evb_init(int ram_size, int vga_ram_size, int boot_device,
+static void mcf5208evb_init(unsigned long 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, const char *cpu_model)
Index: qemu/hw/mips_malta.c
===================================================================
--- qemu.orig/hw/mips_malta.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/mips_malta.c	2007-09-29 12:30:12.000000000 +0000
@@ -740,7 +740,7 @@
 }
 
 static
-void mips_malta_init (int ram_size, int vga_ram_size, int boot_device,
+void mips_malta_init (unsigned long 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, const char *cpu_model)
Index: qemu/hw/mips_pica61.c
===================================================================
--- qemu.orig/hw/mips_pica61.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/mips_pica61.c	2007-09-29 12:30:12.000000000 +0000
@@ -55,7 +55,8 @@
 }
 
 static
-void mips_pica61_init (int ram_size, int vga_ram_size, int boot_device,
+void mips_pica61_init (unsigned long 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, const char *cpu_model)
Index: qemu/hw/mips_r4k.c
===================================================================
--- qemu.orig/hw/mips_r4k.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/mips_r4k.c	2007-09-29 12:30:12.000000000 +0000
@@ -136,7 +136,7 @@
 }
 
 static
-void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device,
+void mips_r4k_init (unsigned long 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, const char *cpu_model)
Index: qemu/hw/palm.c
===================================================================
--- qemu.orig/hw/palm.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/palm.c	2007-09-29 12:30:12.000000000 +0000
@@ -61,7 +61,8 @@
 {
 }
 
-static void palmte_init(int ram_size, int vga_ram_size, int boot_device,
+static void palmte_init(unsigned long 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, const char *cpu_model)
Index: qemu/hw/ppc405_boards.c
===================================================================
--- qemu.orig/hw/ppc405_boards.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/ppc405_boards.c	2007-09-29 12:30:12.000000000 +0000
@@ -171,7 +171,8 @@
     }
 }
 
-static void ref405ep_init (int ram_size, int vga_ram_size, int boot_device,
+static void ref405ep_init (unsigned long ram_size, int vga_ram_size,
+                           int boot_device,
                            DisplayState *ds, const char **fd_filename,
                            int snapshot,
                            const char *kernel_filename,
@@ -494,7 +495,8 @@
     }
 }
 
-static void taihu_405ep_init(int ram_size, int vga_ram_size, int boot_device,
+static void taihu_405ep_init(unsigned long ram_size, int vga_ram_size,
+                             int boot_device,
                              DisplayState *ds, const char **fd_filename,
                              int snapshot,
                              const char *kernel_filename,
Index: qemu/hw/ppc_chrp.c
===================================================================
--- qemu.orig/hw/ppc_chrp.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/ppc_chrp.c	2007-09-29 12:30:12.000000000 +0000
@@ -300,7 +300,8 @@
 }
 
 /* PowerPC CHRP hardware initialisation */
-static void ppc_chrp_init (int ram_size, int vga_ram_size, int boot_device,
+static void ppc_chrp_init (unsigned long ram_size, int vga_ram_size,
+                           int boot_device,
                            DisplayState *ds, const char **fd_filename,
                            int snapshot,
                            const char *kernel_filename,
@@ -567,7 +568,8 @@
     register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL);
 }
 
-static void ppc_core99_init (int ram_size, int vga_ram_size, int boot_device,
+static void ppc_core99_init (unsigned long ram_size, int vga_ram_size,
+                             int boot_device,
                              DisplayState *ds, const char **fd_filename,
                              int snapshot,
                              const char *kernel_filename,
@@ -581,7 +583,8 @@
                   initrd_filename, cpu_model, 0);
 }
 
-static void ppc_heathrow_init (int ram_size, int vga_ram_size, int boot_device,
+static void ppc_heathrow_init (unsigned long ram_size, int vga_ram_size,
+                               int boot_device,
                                DisplayState *ds, const char **fd_filename,
                                int snapshot,
                                const char *kernel_filename,
Index: qemu/hw/ppc_prep.c
===================================================================
--- qemu.orig/hw/ppc_prep.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/ppc_prep.c	2007-09-29 12:30:12.000000000 +0000
@@ -514,7 +514,8 @@
 #define NVRAM_SIZE        0x2000
 
 /* PowerPC PREP hardware initialisation */
-static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device,
+static void ppc_prep_init (unsigned long 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: qemu/hw/realview.c
===================================================================
--- qemu.orig/hw/realview.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/realview.c	2007-09-29 12:30:12.000000000 +0000
@@ -12,7 +12,8 @@
 
 /* Board init.  */
 
-static void realview_init(int ram_size, int vga_ram_size, int boot_device,
+static void realview_init(unsigned long 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, const char *cpu_model)
Index: qemu/hw/shix.c
===================================================================
--- qemu.orig/hw/shix.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/shix.c	2007-09-29 12:30:12.000000000 +0000
@@ -62,7 +62,7 @@
     /* XXXXX */
 }
 
-void shix_init(int ram_size, int vga_ram_size, int boot_device,
+void shix_init(unsigned long 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, const char *cpu_model)
Index: qemu/hw/spitz.c
===================================================================
--- qemu.orig/hw/spitz.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/spitz.c	2007-09-29 12:30:12.000000000 +0000
@@ -1167,7 +1167,7 @@
 /* Board init.  */
 enum spitz_model_e { spitz, akita, borzoi, terrier };
 
-static void spitz_common_init(int ram_size, int vga_ram_size,
+static void spitz_common_init(unsigned long  ram_size, int vga_ram_size,
                 DisplayState *ds, const char *kernel_filename,
                 const char *kernel_cmdline, const char *initrd_filename,
                 const char *cpu_model, enum spitz_model_e model, int arm_id)
@@ -1224,7 +1224,8 @@
     sl_bootparam_write(SL_PXA_PARAM_BASE - PXA2XX_SDRAM_BASE);
 }
 
-static void spitz_init(int ram_size, int vga_ram_size, int boot_device,
+static void spitz_init(unsigned long 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, const char *cpu_model)
@@ -1233,7 +1234,8 @@
                 kernel_cmdline, initrd_filename, cpu_model, spitz, 0x2c9);
 }
 
-static void borzoi_init(int ram_size, int vga_ram_size, int boot_device,
+static void borzoi_init(unsigned long 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, const char *cpu_model)
@@ -1242,7 +1244,8 @@
                 kernel_cmdline, initrd_filename, cpu_model, borzoi, 0x33f);
 }
 
-static void akita_init(int ram_size, int vga_ram_size, int boot_device,
+static void akita_init(unsigned long 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, const char *cpu_model)
@@ -1251,7 +1254,8 @@
                 kernel_cmdline, initrd_filename, cpu_model, akita, 0x2e8);
 }
 
-static void terrier_init(int ram_size, int vga_ram_size, int boot_device,
+static void terrier_init(unsigned long 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, const char *cpu_model)
Index: qemu/hw/sun4u.c
===================================================================
--- qemu.orig/hw/sun4u.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/sun4u.c	2007-09-29 12:30:12.000000000 +0000
@@ -331,10 +331,11 @@
 static fdctrl_t *floppy_controller;
 
 /* Sun4u hardware initialisation */
-static void sun4u_init(int 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, const char *cpu_model)
+static void sun4u_init(unsigned long 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, const char *cpu_model)
 {
     CPUState *env;
     char buf[1024];
Index: qemu/hw/versatilepb.c
===================================================================
--- qemu.orig/hw/versatilepb.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/versatilepb.c	2007-09-29 12:30:12.000000000 +0000
@@ -151,7 +151,8 @@
    peripherans and expansion busses.  For now we emulate a subset of the
    PB peripherals and just change the board ID.  */
 
-static void versatile_init(int ram_size, int vga_ram_size, int boot_device,
+static void versatile_init(unsigned long 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, const char *cpu_model,
@@ -266,7 +267,7 @@
                     initrd_filename, board_id, 0x0);
 }
 
-static void vpb_init(int ram_size, int vga_ram_size, int boot_device,
+static void vpb_init(unsigned long 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, const char *cpu_model)
@@ -277,7 +278,7 @@
                    initrd_filename, cpu_model, 0x183);
 }
 
-static void vab_init(int ram_size, int vga_ram_size, int boot_device,
+static void vab_init(unsigned long 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, const char *cpu_model)
Index: qemu/osdep.c
===================================================================
--- qemu.orig/osdep.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/osdep.c	2007-09-29 12:30:12.000000000 +0000
@@ -87,7 +87,7 @@
 void *kqemu_vmalloc(size_t size)
 {
     static int phys_ram_fd = -1;
-    static int phys_ram_size = 0;
+    static unsigned long phys_ram_size = 0;
     const char *tmpdir;
     char phys_ram_file[1024];
     void *ptr;
@@ -110,7 +110,7 @@
             int64_t free_space;
             int ram_mb;
 
-            extern int ram_size;
+            extern unsigned long ram_size;
             free_space = (int64_t)stfs.f_bavail * stfs.f_bsize;
             if ((ram_size + 8192 * 1024) >= free_space) {
                 ram_mb = (ram_size / (1024 * 1024));
Index: qemu/hw/piix_pci.c
===================================================================
--- qemu.orig/hw/piix_pci.c	2007-09-29 12:29:47.000000000 +0000
+++ qemu/hw/piix_pci.c	2007-09-29 12:30:12.000000000 +0000
@@ -52,7 +52,7 @@
     return (irq_num + slot_addend) & 3;
 }
 
-static uint32_t isa_page_descs[384 / 4];
+static unsigned long isa_page_descs[384 / 4];
 static uint8_t smm_enabled;
 
 static void update_pam(PCIDevice *d, uint32_t start, uint32_t end, int r)

Reply via email to