From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web12.9022.1585914530550022429 for ; Fri, 03 Apr 2020 04:48:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=owozxGby; spf=pass (domain: nuviainc.com, ip: 209.85.128.65, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f65.google.com with SMTP id c195so1919978wme.1 for ; Fri, 03 Apr 2020 04:48:50 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=GuXMrs5CKQRCo5gtZY4rkdv5Q4c1pubmF3b8l1VgK5Q=; b=owozxGbysMNLhrKs4ziNH0P62bG5AvamsY3Xro/RxCoZzLrQxQffuHBSy2XDhmjDdm aR/Yxe7He9GpFhoIQNL5vcP80LgSffDgwzbaZkH6Cw40hTKnvkAeGa1b8bJmocv36gV8 l/z/vShdaY6nv65iPONXK6K+WtcyTPFkE8YdtBsCMrLApdNUdg0oEOZzy+je3hf+Cru0 6DpAgT0/smEEdZ4xlKs94gTFfagQUepF4Ngmslz5GxRHfS0EvHzKsnawrVYndXoNNx70 HhposQfgHRdfM1dphro0O4uOH1CaltlL340KzJI9jqlNGQHRlqw6eIQz1f/kpDTv9ZZa qgOA== 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:mime-version :content-transfer-encoding; bh=GuXMrs5CKQRCo5gtZY4rkdv5Q4c1pubmF3b8l1VgK5Q=; b=O9frJaCQsoelWnORNIMUbRrb2t5bG+y5xhtPDbYwEA9F4FmZO9C7SW6NjKgyrXwWnD xmDhpQUcKUMXn6gCCa/hcXMGzkQjWIPSmZqQKSrBMVyyh8tfZbS7MjR09A+wYM6E1JOA g3zHIFf/7ISMfqs2/3fsgLbVVgvGFx7LpI2Zpid5Gsq6eUvXfKB8pUdg4k0kt31dfyWq qnOcpz1BI36art7kk8mIRyBFtrVuybe+xfzqdqETsUFHH2+OhcINqTbtIcUWFxX47q2r JA+z5XN0hvk8P6daG/ZAsZeDgQRKzKSuo3m+2Pw0D69x2Waw1qpd5tZKi8zyEOJvrSQV TOGg== X-Gm-Message-State: AGi0PubkfijfWWhI11JfSg5y/gYyh0mRjTM5xkUjY9PpXHJQnwDiu4BR 3taOsYnLQTEiFGw7vlGkJV+ggTNVQ+S9Wt+zkbxceK30nOCFGwassZmQLxtINElt3sgon1BAp/o zMjNQBCgW7ttuOwDGTRxgmioRsLvBop2q1bs3rPYXElkMIHFZjph333SkBuLhU74= X-Google-Smtp-Source: APiQypIte1e0muMWkzPGcj9q6etmdioAJqE0JQwHwvD9lLviRdbDMZ+MC+bopmWqiKhdZqhFzvPuGw== X-Received: by 2002:a05:600c:48d:: with SMTP id d13mr5990616wme.86.1585914528591; Fri, 03 Apr 2020 04:48:48 -0700 (PDT) Return-Path: Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id j6sm12447651wrb.4.2020.04.03.04.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 04:48:48 -0700 (PDT) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [PATCH 1/1] ArmPkg: rename misleading local #define in CpuDxe Date: Fri, 3 Apr 2020 12:48:47 +0100 Message-Id: <20200403114847.15760-1-leif@nuviainc.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The local #define TT_ATTR_INDX_INVALID is used as a local error code in the AArch64 implementation, but is misleadingly named to match the definitions in ArmPkg/Include/Chipset/AArch64Mmu.h. Rename it INVALID_ENTRY to reduce confusion and improve readability. Signed-off-by: Leif Lindholm --- ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c index 29fa08f9e07c..fca2d4f7638a 100644 --- a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c +++ b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c @@ -13,7 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include "CpuDxe.h" -#define TT_ATTR_INDX_INVALID ((UINT32)~0) +#define INVALID_ENTRY ((UINT32)~0) #define MIN_T0SZ 16 #define BITS_PER_LEVEL 9 @@ -98,7 +98,7 @@ GetFirstPageAttribute ( { return FirstEntry & TT_ATTR_INDX_MASK; } else { - return TT_ATTR_INDX_INVALID; + return INVALID_ENTRY; } } @@ -139,8 +139,8 @@ GetNextEntryAttribute ( // If Entry is a Table Descriptor type entry then go through the sub-level table if ((EntryType == TT_TYPE_BLOCK_ENTRY) || ((TableLevel == 3) && (EntryType == TT_TYPE_BLOCK_ENTRY_LEVEL3))) { - if ((*PrevEntryAttribute == TT_ATTR_INDX_INVALID) || (EntryAttribute != *PrevEntryAttribute)) { - if (*PrevEntryAttribute != TT_ATTR_INDX_INVALID) { + if ((*PrevEntryAttribute == INVALID_ENTRY) || (EntryAttribute != *PrevEntryAttribute)) { + if (*PrevEntryAttribute != INVALID_ENTRY) { // Update GCD with the last region SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *StartGcdRegion, @@ -164,7 +164,7 @@ GetNextEntryAttribute ( (BaseAddress + (Index * TT_ADDRESS_AT_LEVEL(TableLevel))), PrevEntryAttribute, StartGcdRegion); } else { - if (*PrevEntryAttribute != TT_ATTR_INDX_INVALID) { + if (*PrevEntryAttribute != INVALID_ENTRY) { // Update GCD with the last region SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *StartGcdRegion, @@ -173,7 +173,7 @@ GetNextEntryAttribute ( // Start of the new region *StartGcdRegion = BaseAddress + (Index * TT_ADDRESS_AT_LEVEL(TableLevel)); - *PrevEntryAttribute = TT_ATTR_INDX_INVALID; + *PrevEntryAttribute = INVALID_ENTRY; } } } @@ -238,7 +238,7 @@ SyncCacheConfig ( &PageAttribute, &BaseAddressGcdRegion); // Update GCD with the last region if valid - if (PageAttribute != TT_ATTR_INDX_INVALID) { + if (PageAttribute != INVALID_ENTRY) { SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, BaseAddressGcdRegion, EndAddressGcdRegion - BaseAddressGcdRegion, -- 2.20.1