From: "Rebecca Cran" <rebecca@nuviainc.com>
To: devel@edk2.groups.io
Cc: Rebecca Cran <rebecca@nuviainc.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Leif Lindholm <leif@nuviainc.com>,
Graeme Gregory <graeme@nuviainc.com>,
Radoslaw Biernacki <rad@semihalf.com>
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 [thread overview]
Message-ID: <20210223142635.8807-5-rebecca@nuviainc.com> (raw)
In-Reply-To: <20210223142635.8807-1-rebecca@nuviainc.com>
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 <rebecca@nuviainc.com>
---
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
prev parent reply other threads:[~2021-02-23 14:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 14:26 [edk2-platforms PATCH v4 0/4] Platform/Qemu/SbsaQemu: Add SMBIOS tables Rebecca Cran
2021-02-23 14:26 ` [edk2-platforms PATCH v4 1/4] SbsaQemu: Add FdtHelperLib Rebecca Cran
2021-02-23 16:32 ` Leif Lindholm
2021-02-23 17:45 ` Rebecca Cran
2021-02-23 14:26 ` [edk2-platforms PATCH v4 2/4] SbsaQemu: Update SbsaQemuAcpiDxe to use FdtHelperLib Rebecca Cran
2021-02-23 14:26 ` [edk2-platforms PATCH v4 3/4] Platform/Qemu/SbsaQemu: Add SMBIOS tables Rebecca Cran
2021-02-23 14:26 ` Rebecca Cran [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210223142635.8807-5-rebecca@nuviainc.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox