diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch b/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch index b0c2ea5be9..1a6cf5119b 100644 --- a/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch +++ b/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch | |||
@@ -18,27 +18,29 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | |||
18 | Update it when upgrade qemu to 2.2.0 | 18 | Update it when upgrade qemu to 2.2.0 |
19 | 19 | ||
20 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | 20 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
21 | Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> | ||
21 | --- | 22 | --- |
22 | hw/arm/versatilepb.c | 6 ++++++ | 23 | hw/arm/versatilepb.c | 7 +++++++ |
23 | 1 file changed, 6 insertions(+) | 24 | 1 file changed, 7 insertions(+) |
24 | 25 | ||
25 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c | 26 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c |
26 | index b48d84c..ad2cd5a 100644 | 27 | index 6c69f4e..9278d90 100644 |
27 | --- a/hw/arm/versatilepb.c | 28 | --- a/hw/arm/versatilepb.c |
28 | +++ b/hw/arm/versatilepb.c | 29 | +++ b/hw/arm/versatilepb.c |
29 | @@ -198,6 +198,12 @@ static void versatile_init(MachineState *machine, int board_id) | 30 | @@ -204,6 +204,13 @@ static void versatile_init(MachineState *machine, int board_id) |
30 | fprintf(stderr, "Unable to find CPU definition\n"); | ||
31 | exit(1); | 31 | exit(1); |
32 | } | 32 | } |
33 | + if (ram_size > (256 << 20)) { | 33 | |
34 | + if (machine->ram_size > (256 << 20)) { | ||
34 | + fprintf(stderr, | 35 | + fprintf(stderr, |
35 | + "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n", | 36 | + "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n", |
36 | + ((unsigned int)ram_size / (1 << 20))); | 37 | + ((unsigned int)ram_size / (1 << 20))); |
37 | + exit(1); | 38 | + exit(1); |
38 | + } | 39 | + } |
39 | memory_region_init_ram(ram, NULL, "versatile.ram", machine->ram_size, | 40 | + |
40 | &error_abort); | 41 | cpuobj = object_new(object_class_get_name(cpu_oc)); |
41 | vmstate_register_ram_global(ram); | 42 | |
43 | /* By default ARM1176 CPUs have EL3 enabled. This board does not | ||
42 | -- | 44 | -- |
43 | 1.7.10.4 | 45 | 2.1.0 |
44 | 46 | ||