From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by mx.groups.io with SMTP id smtpd.web12.46.1614102232397526800 for ; Tue, 23 Feb 2021 09:43:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=td2/Lll9; spf=pass (domain: nuviainc.com, ip: 209.85.210.44, mailfrom: rebecca@nuviainc.com) Received: by mail-ot1-f44.google.com with SMTP id b16so16446951otq.1 for ; Tue, 23 Feb 2021 09:43:52 -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=td2/Lll9GEFqFxtMoDay/RtesC8OQPdlELxL0kzfaoWC/DflOfrK8TDO/z/+4XAezZ I5DzVgJDwHg76CVQK6mUGnkkCwLP8Wbw5cCwEvWdYAFBdbr8WiFT40j7A7alup8FpDOR cVArAltMw+ynnKyhjxntwrjU7fC3hykIPEqGIWkDwUbGjezfU1dBD3EtuA71MQrtR330 y2arlJ9IoQzvoLdjzPYXJSFIopJvZn/17VxO8oC+vlaVW4pgMw0S3ufX2gDDLoFiLp/u 3pL8CObUnSC/JU7X/rNNi59oG5QOzNHAlnLDM/3sGSUiZ1PDI4H5skfcYBBh8AcZBwxM l6Fg== 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=apqxBj8J68kpVfWPMfze5ycdaoaSPxoUoNxEY6gX6rBRhuoh1FXqXMu4krkmtrq9sL wSYghEMQoEIUV12cPg2JlFNczliV6RopxPZHkt3UX1lmDGxUa+JB2XiJXqa3WMJ6Gr14 CLBJygFqywFFdTNa1B8XE+iChsBef3KPo0+VI+vJ95O7JebvJjVz8puczHvekliXUzgT 28MFKvdDKS6IohG4gHdbxyS3RhYHaVeInLcYyTTP8S1azUvojxsq2dBjDuBkCVn7eaHl 92vJkmDMiN9IdjKmKPvVQzag1lxESNBgCTUMVdLnWFYliHZ5Ladr0mSaSF3cm/lJymJv d6+Q== X-Gm-Message-State: AOAM530if9dP6N9XX3GjuFy7DFTqj5NZm0WLV42T7kHS+doVvRBb0CaS xWRr6lc6Lmyg9Ri56nQ5l32NvzbZZe3f7MTrD1QoDi/n9GBE9j/FtJGjemO1vtwrIvhqfWNw6FB qDeW+bRW1A7CxsTf+A4mSwxBgCny0inmp4zIlG8nIyCB8TxZh0VhWTQEqWo4c5+Sa/88K3Q== X-Google-Smtp-Source: ABdhPJz2LmICx2OtVDh2PQNVTzPaV2LRaGZ7jOxWPSLk42+HpGyiPFp64q1BQPFdE4z49yDw5Nt0Lw== X-Received: by 2002:a9d:784b:: with SMTP id c11mr8554218otm.88.1614102231533; Tue, 23 Feb 2021 09:43:51 -0800 (PST) Return-Path: Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id s9sm4419918otb.11.2021.02.23.09.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 09:43:51 -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 v5 4/4] Silicon/Qemu: Don't re-use NumCores as loop index in AddMadtTable Date: Tue, 23 Feb 2021 10:43:42 -0700 Message-Id: <20210223174342.8572-5-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210223174342.8572-1-rebecca@nuviainc.com> References: <20210223174342.8572-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