From cef8876822aafa91bf204dc079cb87aeca7b5330 Mon Sep 17 00:00:00 2001 From: "syeon.hwang" Date: Mon, 29 Oct 2012 14:46:14 +0900 Subject: [PATCH] RAM: Apply W/A to preserve larger continuous heap for RAM. --- tizen/src/hw/maru_board.c | 11 +++++++++-- tizen/src/maru_common.h | 3 +++ vl.c | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/tizen/src/hw/maru_board.c b/tizen/src/hw/maru_board.c index 9a5d62e..ea7c671 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 373e474..0018d85 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 a8b495c..356790c 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); -- 2.7.4