diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-02-05 19:51:12 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-02-05 19:51:12 -0500 |
commit | ef3d882557dd3cd0d1fe90329653c23f9741bf29 (patch) | |
tree | 92e0000196db51011b5b5252b326492bd70dd5e5 | |
parent | b62d1aeaf8c2ae2535187db99eb3cbe186f67c29 (diff) | |
download | seabios-ef3d882557dd3cd0d1fe90329653c23f9741bf29.tar.gz |
Make sure to clear global variables before use.
On reset, the global variables may not be zero - so zero them explicitly.
-rw-r--r-- | src/ata.c | 2 | ||||
-rw-r--r-- | src/coreboot.c | 6 | ||||
-rw-r--r-- | src/post.c | 2 |
3 files changed, 10 insertions, 0 deletions
@@ -861,6 +861,8 @@ ata_detect() static void ata_init() { + memset(&ATA, 0, sizeof(ATA)); + // hdidmap and cdidmap init. u8 device; for (device=0; device < CONFIG_MAX_ATA_DEVICES; device++) { diff --git a/src/coreboot.c b/src/coreboot.c index 051cd805..99bf5700 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -192,6 +192,12 @@ void coreboot_fill_map() { dprintf(3, "Attempting to find coreboot table\n"); + + // Init variables set in coreboot table memory scan. + PirOffset = 0; + RsdpAddr = 0; + + // Find coreboot table. struct cb_header *cbh = find_cb_header(0, 0x1000); if (!cbh) goto fail; @@ -156,6 +156,8 @@ init_boot_vectors() return; dprintf(3, "init boot device ordering\n"); + memset(&IPL, 0, sizeof(IPL)); + // Floppy drive struct ipl_entry_s *ip = &IPL.table[0]; ip->type = IPL_TYPE_FLOPPY; |