From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by mx.groups.io with SMTP id smtpd.web11.10438.1614090406744729921 for ; Tue, 23 Feb 2021 06:26:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=xA7WTma4; spf=pass (domain: nuviainc.com, ip: 209.85.166.180, mailfrom: rebecca@nuviainc.com) Received: by mail-il1-f180.google.com with SMTP id g9so14232077ilc.3 for ; Tue, 23 Feb 2021 06:26:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xgpAzF51HtzegaZVjlFEIJ94WO1B6Jja1NMhJ+lQ2dA=; b=xA7WTma40fn47U8XRPhg/swa5kXr20PPtoIDZ7T1FJpUo3HoDiYODT6k6f/1ueJHUt 1j1YefU00FB1b8z96IJ5k7kmXRX6wmUSlu7qd8xcCLaDHBQZ/OAKZuRu0B2zm4yxi6sm EaZY2/kIBnfIyFL/DqPGQBco2qw52hBaLFh/NBN1pfVsR7pFB3fSlEp0F60M775j6B4w CxbIeSpzhwI6NaYB/XhVGpHMJsvz5BCGlDeMpeDffSMXREF0CCdS4qWfzJvpGe6pDeYK VvKgf2+nz//KMSCMOjHzVleDhbab0Jch4SG5zjlSfSYl0Wo4TJa4Jcs49+wGa6338gq4 hN6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xgpAzF51HtzegaZVjlFEIJ94WO1B6Jja1NMhJ+lQ2dA=; b=X1eLb7Ey3lRCBN677TUE4bu63phLZjPJPLOdtPnb84Hq4qy1GCN/MQW3m5nOulJQrI 4sLyQZiQMsU2TsZ1hAcAh0dYDi5rAcFAngD9zrDaR0YlfjwOV0ZnYoegolBddgPAkzu0 TN5ds+32hK4vFovXq0+0Vz7Gm6xTevg7or5FAZim/hou03HPOC0nVLhZ2e3ARz1sSfBx 28X1S91K/NJAfuSSRtiyPgyXCmtNfpZaM4iJu17B4tJPhf6EqRUgM37ZBr60JPd1j3H7 KhmCdBrHPYeWip6IY1ByFDJ60rgHvGDHHmUa1Hk6Hp/LC6gECkET/2xoS9MXp8a5proi VO/A== X-Gm-Message-State: AOAM531BFzTtG3jBKnaQCvp+DlgmbpUAMA7nImAVF0kW+3q3aA2v7X8N cOWdGSuZ/SfLh/Za2sqvNQkN0JlbyFmjksn6VcKM2V8z3pj0XUZu5zeuruG+ypeKI2kEICE4VYY 2LVT1hDDPV0z8BelLzI9PrAwp7CL0OiMsaOOQwSTAeJI6WDFlJHNDoAJZ/RekEw0zEkdATA== X-Google-Smtp-Source: ABdhPJzNpKYnULUbAXmf6agfHfBDiaNtKlZK+lQSEQmULyftuZaBvwSnbR4i8BAeg1Ot1xLDMbjbHQ== X-Received: by 2002:a05:6e02:1bcb:: with SMTP id x11mr18789277ilv.226.1614090405865; Tue, 23 Feb 2021 06:26:45 -0800 (PST) Return-Path: Received: from cube.int.bluestop.org (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id b9sm15391541ilo.41.2021.02.23.06.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 06:26:45 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki Subject: [edk2-platforms PATCH v4 4/4] Silicon/Qemu: Don't re-use NumCores as loop index in AddMadtTable Date: Tue, 23 Feb 2021 07:26:35 -0700 Message-Id: <20210223142635.8807-5-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210223142635.8807-1-rebecca@nuviainc.com> References: <20210223142635.8807-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Avoid re-using the NumCores variable as a loop index, in AddMadtTable: add a new CoreIndex variable for that purpose. Signed-off-by: Rebecca Cran --- Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index 037c7cff4c18..84120f1c1b51 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -88,6 +88,7 @@ AddMadtTable ( EFI_PHYSICAL_ADDRESS PageAddress; UINT8 *New; UINT32 NumCores; + UINT32 CoreIndex; // Initialize MADT ACPI Header EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header = { @@ -152,13 +153,13 @@ AddMadtTable ( New += sizeof (EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER); // Add new GICC structures for the Cores - for (NumCores = 0; NumCores < PcdGet32 (PcdCoreCount); NumCores++) { + for (CoreIndex = 0; CoreIndex < PcdGet32 (PcdCoreCount); CoreIndex++) { EFI_ACPI_6_0_GIC_STRUCTURE *GiccPtr; CopyMem (New, &Gicc, sizeof (EFI_ACPI_6_0_GIC_STRUCTURE)); GiccPtr = (EFI_ACPI_6_0_GIC_STRUCTURE *) New; - GiccPtr->AcpiProcessorUid = NumCores; - GiccPtr->MPIDR = GetMpidr (NumCores); + GiccPtr->AcpiProcessorUid = CoreIndex; + GiccPtr->MPIDR = GetMpidr (CoreIndex); New += sizeof (EFI_ACPI_6_0_GIC_STRUCTURE); } -- 2.26.2