From: Ross Philipson Date: Mon, 23 Feb 2009 19:04:58 +0000 (-0500) Subject: Initialize globals so as not to just rely on the compiler/linker X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=59fbee3f8e601e5a4e4d9e4d4455ceda1f5714d1;p=xenclient%2Fxen.git Initialize globals so as not to just rely on the compiler/linker proper initialization. Changes to be committed: modified: tools/firmware/hvmloader/util.c modified: xen/arch/x86/tboot.c --- diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c index 10fcb12..99a8e02 100644 --- a/tools/firmware/hvmloader/util.c +++ b/tools/firmware/hvmloader/util.c @@ -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 ) diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index 608d34d..1de2e4f 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -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)