]> xenbits.xen.org Git - xenclient/xen.git/commitdiff
Initialize globals so as not to just rely on the compiler/linker
authorRoss Philipson <ross.philipson@citrix.com>
Mon, 23 Feb 2009 19:04:58 +0000 (14:04 -0500)
committerRoss Philipson <ross.philipson@citrix.com>
Mon, 23 Feb 2009 19:04:58 +0000 (14:04 -0500)
proper initialization.

 Changes to be committed:
modified:   tools/firmware/hvmloader/util.c
modified:   xen/arch/x86/tboot.c

tools/firmware/hvmloader/util.c
xen/arch/x86/tboot.c

index 10fcb12e6cf5c56f9600424581aec6fbabfb1517..99a8e02277e57f736cb4a1b746c13843682d5046 100644 (file)
@@ -570,7 +570,7 @@ static int validate_hvm_info_table(uint8_t *table, uint32_t table_length, const
 
 static struct hvm_info_table *get_hvm_info_table(void)
 {
-    static struct hvm_info_table *table;
+    static struct hvm_info_table *table = NULL;
     struct hvm_info_table *t;
 
     if ( table != NULL )
index 608d34d39a41abe1547f244c22b2363c1728b9f6..1de2e4fbd04d7694f368f15a489f79b05333decf 100644 (file)
@@ -14,15 +14,17 @@ static char opt_tboot[20] = "";
 string_param("tboot", opt_tboot);
 
 /* Global pointer to shared data; NULL means no measured launch. */
-tboot_shared_t *g_tboot_shared;
+tboot_shared_t *g_tboot_shared = NULL;
 
 static const uuid_t tboot_shared_uuid = TBOOT_SHARED_UUID;
 
 extern char __init_begin[], __per_cpu_start[], __per_cpu_end[], __bss_start[];
 
 /* used by tboot_protect_mem_regions() and/or tboot_parse_dmar_table() */
-static uint64_t txt_heap_base, txt_heap_size;
-static uint64_t sinit_base, sinit_size;
+static uint64_t txt_heap_base = 0;
+static uint64_t txt_heap_size = 0;
+static uint64_t sinit_base = 0;
+static uint64_t sinit_size = 0;
 
 /*
  * TXT configuration registers (offsets from TXT_{PUB, PRIV}_CONFIG_REGS_BASE)