]> xenbits.xensource.com Git - seabios.git/commitdiff
Use VARVERIFY32INIT on global variables that point to "tmp" memory.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 9 Mar 2013 00:39:49 +0000 (19:39 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 9 Mar 2013 00:55:26 +0000 (19:55 -0500)
Enable the recently added build check on global variables that are (or
contain) pointers to memory allocated by malloc_tmp().  This helps
detect cases where temporary memory is accessed after POST.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/boot.c
src/pci.c
src/pmm.c
src/romfile.c

index 3370c2d685a56e1610b0e56a665a56a0d4c58c4d..c3086020fe2a82592c637dc6279ea5406809d3a1 100644 (file)
@@ -21,7 +21,7 @@
  * Boot priority ordering
  ****************************************************************/
 
-static char **Bootorder;
+static char **Bootorder VARVERIFY32INIT;
 static int BootorderCount;
 
 static void
@@ -293,7 +293,7 @@ struct bootentry_s {
     const char *description;
     struct bootentry_s *next;
 };
-static struct bootentry_s *BootList;
+static struct bootentry_s *BootList VARVERIFY32INIT;
 
 #define IPL_TYPE_FLOPPY      0x01
 #define IPL_TYPE_HARDDISK    0x02
index 4f6a6fab7a7b4ac6b60189598c78c4a0f4c4dbaa..a92fb9b671bc4677569726c76ae2be03a3a8d73a 100644 (file)
--- a/src/pci.c
+++ b/src/pci.c
@@ -85,7 +85,7 @@ pci_next(int bdf, int bus)
     }
 }
 
-struct pci_device *PCIDevices;
+struct pci_device *PCIDevices VARVERIFY32INIT;
 int MaxPCIBus VARFSEG;
 
 // Check if PCI is available at all
index f02cf62699bd43ab875b58b14983f20343de9291..c4156ba6e73374f9f5edddd4b31513630e42c6ba 100644 (file)
--- a/src/pmm.c
+++ b/src/pmm.c
@@ -29,9 +29,11 @@ struct zone_s {
     struct allocinfo_s *info;
 };
 
-struct zone_s ZoneLow, ZoneHigh, ZoneFSeg, ZoneTmpLow, ZoneTmpHigh;
+struct zone_s ZoneLow VARVERIFY32INIT, ZoneHigh VARVERIFY32INIT;
+struct zone_s ZoneFSeg VARVERIFY32INIT;
+struct zone_s ZoneTmpLow VARVERIFY32INIT, ZoneTmpHigh VARVERIFY32INIT;
 
-static struct zone_s *Zones[] = {
+static struct zone_s *Zones[] VARVERIFY32INIT = {
     &ZoneTmpLow, &ZoneLow, &ZoneFSeg, &ZoneTmpHigh, &ZoneHigh
 };
 
index 93ee3d6defbc969375615ee1efd5554b6206b5a5..ea71d1f0d3fdccddcf9a1c261bcec8d6ff3cc874 100644 (file)
@@ -7,7 +7,7 @@
 #include "config.h" // CONFIG_*
 #include "util.h" // dprintf
 
-static struct romfile_s *RomfileRoot;
+static struct romfile_s *RomfileRoot VARVERIFY32INIT;
 
 void
 romfile_add(struct romfile_s *file)