RAM: Apply W/A to preserve larger continuous heap for RAM.
authorsyeon.hwang <syeon.hwang@samsung.com>
Mon, 29 Oct 2012 05:46:14 +0000 (14:46 +0900)
committersyeon.hwang <syeon.hwang@samsung.com>
Mon, 29 Oct 2012 05:46:14 +0000 (14:46 +0900)
tizen/src/hw/maru_board.c
tizen/src/maru_common.h
vl.c

index 9a5d62e..ea7c671 100644 (file)
@@ -63,6 +63,7 @@
 #  include <xen/hvm/hvm_info_table.h>
 #endif
 
+#include "maru_common.h"
 #include "guest_debug.h"
 
 #define MAX_IDE_BUS 2
@@ -149,6 +150,12 @@ static void maru_x86_machine_init(MemoryRegion *system_memory,
 
     /* allocate ram and load rom/bios */
     if (!xen_enabled()) {
+       // W/A for allocate larger continuous heap.
+        // see vl.c
+        if(preallocated_ptr != NULL) {
+            qemu_vfree(preallocated_ptr);
+        }
+       //
         pc_memory_init(system_memory,
                        kernel_filename, kernel_cmdline, initrd_filename,
                        below_4g_mem_size, above_4g_mem_size,
@@ -270,8 +277,8 @@ static void maru_x86_machine_init(MemoryRegion *system_memory,
 #ifndef CONFIG_DARWIN
     // maru specialized device init...
     if (pci_enabled) {
-       //tizen_ac97_init(pci_bus);
-               codec_init(pci_bus);        
+        //tizen_ac97_init(pci_bus);
+        codec_init(pci_bus);        
     }
 #endif
 }
index 373e474..0018d85 100644 (file)
@@ -43,4 +43,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+// W/A for preserve larger continuous heap for RAM.
+extern void *preallocated_ptr;
+
 #endif /* __MARU_COMMON_H__ */
diff --git a/vl.c b/vl.c
index a8b495c..356790c 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -179,6 +179,7 @@ int qemu_main(int argc, char **argv, char **envp);
 #include "ui/qemu-spice.h"
 
 #ifdef CONFIG_MARU
+#include "tizen/src/maru_common.h"
 #include "tizen/src/maru_display.h"
 #include "tizen/src/option.h"
 #include "tizen/src/emul_state.h"
@@ -2283,6 +2284,13 @@ static int find_device_opt (QemuOpts *opts, void *opaque)
 }
 
 int use_qemu_display = 0; //0:use tizen qemu sdl, 1:use original qemu sdl
+
+
+#ifdef CONFIG_MARU
+// W/A for preserve larger continuous heap for RAM.
+void *preallocated_ptr = 0;
+#endif
+
 int main(int argc, char **argv, char **envp)
 {
     const char *gdbstub_dev = NULL;
@@ -3430,6 +3438,10 @@ fprintf(stdout, "kernel command : %s\n", kernel_cmdline);
     if (ram_size == 0) {
         ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
     }
+#ifdef CONFIG_MARU
+    // W/A for preserve larger continuous heap for RAM.
+    preallocated_ptr = qemu_vmalloc(ram_size);
+#endif
 
 #ifdef CONFIG_HAX
     hax_pre_init(ram_size);