From 8f8e4fa3f32e993b7f6feee259d8bd3281c0f067 Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Tue, 28 Mar 2023 11:30:59 -0600 Subject: OvmfPkg: Replace static struct initialization with ZeroMem call Replace the static struct initialization with a call to ZeroMem to avoid generating a call to memset in certain build configurations. Signed-off-by: Rebecca Cran Reviewed-by: Gerd Hoffmann Reviewed-by: Oliver Smith-Denny Reviewed-by: Jiewen Yao Reviewed-by: Michael D Kinney --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OvmfPkg/Library') diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c index f85a63a..aced853 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -595,10 +595,12 @@ PlatformAddressWidthFromCpuid ( { UINT32 RegEax, RegEbx, RegEcx, RegEdx, Max; UINT8 PhysBits; - CHAR8 Signature[13] = { 0 }; + CHAR8 Signature[13]; BOOLEAN Valid = FALSE; BOOLEAN Page1GSupport = FALSE; + ZeroMem (Signature, sizeof (Signature)); + AsmCpuid (0x80000000, &RegEax, &RegEbx, &RegEcx, &RegEdx); *(UINT32 *)(Signature + 0) = RegEbx; *(UINT32 *)(Signature + 4) = RegEdx; -- cgit v1.1