From: syeon.hwang Date: Mon, 29 Oct 2012 05:46:14 +0000 (+0900) Subject: RAM: Apply W/A to preserve larger continuous heap for RAM. X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1407^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cef8876822aafa91bf204dc079cb87aeca7b5330;p=sdk%2Femulator%2Fqemu.git RAM: Apply W/A to preserve larger continuous heap for RAM. --- diff --git a/tizen/src/hw/maru_board.c b/tizen/src/hw/maru_board.c index 9a5d62e5fa..ea7c671eac 100644 --- a/tizen/src/hw/maru_board.c +++ b/tizen/src/hw/maru_board.c @@ -63,6 +63,7 @@ # include #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 } diff --git a/tizen/src/maru_common.h b/tizen/src/maru_common.h index 373e474ea5..0018d85844 100644 --- a/tizen/src/maru_common.h +++ b/tizen/src/maru_common.h @@ -43,4 +43,7 @@ #include #include +// 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 a8b495c0da..356790cabb 100644 --- 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);