aboutsummaryrefslogtreecommitdiffstats
path: root/src/fw/csm.c
diff options
context:
space:
mode:
authorJosé Martínez <xose@google.com>2023-06-13 11:01:34 -0400
committerKevin O'Connor <kevin@koconnor.net>2023-06-13 11:01:34 -0400
commit4db444b9a78abf9f6dc981f0e79db749765dc6e8 (patch)
tree12345770c63bb1b86fe295a315fe3f04e5a86a5a /src/fw/csm.c
parentbe7e899350caa7b74d8271a34264c3b4aef25ab0 (diff)
downloadseabios-4db444b9a78abf9f6dc981f0e79db749765dc6e8.tar.gz
Fix high memory zone initialization in CSM mode
malloc_high() cannot allocate any memory in CSM mode due to an empty ZoneHigh. SeaBIOS cannot find any disk to boot from because device initialization fails. The bug was introduced in 1.16.1 (commit dc88f9b) when the meaning of BUILD_MAX_HIGHTABLE changed but CSM code was not updated. This patch reverts to the previous behavior by using BUILD_MIN_HIGHTABLE in CSM methods. Signed-off-by: José Martínez <xose@google.com>
Diffstat (limited to 'src/fw/csm.c')
-rw-r--r--src/fw/csm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fw/csm.c b/src/fw/csm.c
index bc14a925..579debdc 100644
--- a/src/fw/csm.c
+++ b/src/fw/csm.c
@@ -150,9 +150,9 @@ handle_csm_0002(struct bregs *regs)
for (i=0; i < csm_compat_table.E820Length / sizeof(struct e820entry); i++)
e820_add(p[i].start, p[i].size, p[i].type);
- if (csm_init_table->HiPmmMemorySizeInBytes > BUILD_MAX_HIGHTABLE) {
+ if (csm_init_table->HiPmmMemorySizeInBytes > BUILD_MIN_HIGHTABLE) {
u32 hi_pmm_end = csm_init_table->HiPmmMemory + csm_init_table->HiPmmMemorySizeInBytes;
- e820_add(hi_pmm_end - BUILD_MAX_HIGHTABLE, BUILD_MAX_HIGHTABLE, E820_RESERVED);
+ e820_add(hi_pmm_end - BUILD_MIN_HIGHTABLE, BUILD_MIN_HIGHTABLE, E820_RESERVED);
}
// For PCIBIOS 1ab10e