aboutsummaryrefslogtreecommitdiff
path: root/hw/smbios
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-10-28 06:22:23 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-10 12:15:08 -0500
commit86378b29fa22a9854a084241bf51515e149133e4 (patch)
tree06faf85e7ccbaff47062b038dc26bf7ee6a2cab1 /hw/smbios
parentbfdf22bc769a56d8e1fe7c72a28ef05c0a6d8596 (diff)
i386: do not use ram_size global
Use the loader parameters instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/smbios')
-rw-r--r--hw/smbios/smbios.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 6a3d39793b..f22c4f5b73 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -678,13 +678,13 @@ static void smbios_build_type_16_table(unsigned dimm_cnt)
t->location = 0x01; /* Other */
t->use = 0x03; /* System memory */
t->error_correction = 0x06; /* Multi-bit ECC (for Microsoft, per SeaBIOS) */
- size_kb = QEMU_ALIGN_UP(ram_size, KiB) / KiB;
+ size_kb = QEMU_ALIGN_UP(current_machine->ram_size, KiB) / KiB;
if (size_kb < MAX_T16_STD_SZ) {
t->maximum_capacity = cpu_to_le32(size_kb);
t->extended_maximum_capacity = cpu_to_le64(0);
} else {
t->maximum_capacity = cpu_to_le32(MAX_T16_STD_SZ);
- t->extended_maximum_capacity = cpu_to_le64(ram_size);
+ t->extended_maximum_capacity = cpu_to_le64(current_machine->ram_size);
}
t->memory_error_information_handle = cpu_to_le16(0xFFFE); /* Not provided */
t->number_of_memory_devices = cpu_to_le16(dimm_cnt);
@@ -911,9 +911,9 @@ void smbios_get_tables(MachineState *ms,
#define MAX_DIMM_SZ (16 * GiB)
#define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ \
- : ((ram_size - 1) % MAX_DIMM_SZ) + 1)
+ : ((current_machine->ram_size - 1) % MAX_DIMM_SZ) + 1)
- dimm_cnt = QEMU_ALIGN_UP(ram_size, MAX_DIMM_SZ) / MAX_DIMM_SZ;
+ dimm_cnt = QEMU_ALIGN_UP(current_machine->ram_size, MAX_DIMM_SZ) / MAX_DIMM_SZ;
smbios_build_type_16_table(dimm_cnt);