OSDN Git Service

machine: introduce convenience MachineState::ram
authorIgor Mammedov <imammedo@redhat.com>
Wed, 19 Feb 2020 16:08:38 +0000 (11:08 -0500)
committerPatchew Importer <importer@patchew.org>
Wed, 19 Feb 2020 16:49:53 +0000 (16:49 +0000)
commit82b911aaff3ba33a3c028a533c5e169c274a7c3d
tree884387b1f8c4657ab5a1e8e366d7a159f11ca282
parent900c0ba373aada4c13d47d95330aa72ec4067ba5
machine: introduce convenience MachineState::ram

the new field will be used by boards to get access to main
RAM memory region and will help to save boiler plate in
boards which often introduce a field or variable just for
this purpose.

Memory region will be equivalent to what currently used
memory_region_allocate_system_memory() is returning apart
from that it will come from hostmem backend.
Followup patches will incrementally switch boards to using
RAM from MachineState::ram.

Patch takes care of non-NUMA case and follow up patch will
initialize MachineState::ram for NUMA case.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200219160953.13771-5-imammedo@redhat.com>
hw/core/machine.c
hw/core/numa.c
include/hw/boards.h