]>
Commit | Line | Data |
---|---|---|
9a717b55 AL |
1 | update SMBIOS table to report memory above 4G (Alex Williamson) |
2 | ||
3 | Signed-off-by: Alex Williamson <alex.williamson@hp.com> | |
4 | Signed-off-by: Avi Kivity <avi@redhat.com> | |
5 | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> | |
6 | ||
7 | Index: bochs/bios/rombios32.c | |
8 | =================================================================== | |
9 | --- bochs.orig/bios/rombios32.c | |
10 | +++ bochs/bios/rombios32.c | |
11 | @@ -2081,7 +2081,8 @@ void smbios_init(void) | |
12 | { | |
13 | unsigned cpu_num, nr_structs = 0, max_struct_size = 0; | |
14 | char *start, *p, *q; | |
15 | - int memsize = ram_size / (1024 * 1024); | |
16 | + int memsize = (ram_end == ram_size) ? ram_size / (1024 * 1024) : | |
17 | + (ram_end - (1ull << 32) + ram_size) / (1024 * 1024); | |
18 | ||
19 | #ifdef BX_USE_EBDA_TABLES | |
20 | ebda_cur_addr = align(ebda_cur_addr, 16); | |
21 | @@ -2108,8 +2109,8 @@ void smbios_init(void) | |
22 | add_struct(smbios_type_4_init(p, cpu_num)); | |
23 | add_struct(smbios_type_16_init(p, memsize)); | |
24 | add_struct(smbios_type_17_init(p, memsize)); | |
25 | - add_struct(smbios_type_19_init(p, memsize)); | |
26 | - add_struct(smbios_type_20_init(p, memsize)); | |
27 | + add_struct(smbios_type_19_init(p, ram_end / (1024 * 1024))); | |
28 | + add_struct(smbios_type_20_init(p, ram_end / (1024 * 1024))); | |
29 | add_struct(smbios_type_32_init(p)); | |
30 | add_struct(smbios_type_127_init(p)); | |
31 | ||
32 | ||
33 |