From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.web11.10542.1608300983726341717 for ; Fri, 18 Dec 2020 06:16:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=R0zo8EUi; spf=pass (domain: nuviainc.com, ip: 209.85.128.48, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f48.google.com with SMTP id x22so2471217wmc.5 for ; Fri, 18 Dec 2020 06:16:23 -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=5H9jqAQW6yo2bDjmWX3B1ZFd0Xj/sFH0VqJRYQwM9NY=; b=R0zo8EUi3hcWSxM5u4fmZC7n1iroPN2OQAyuNNKjAeXxBJlDPTynyUK8sO3RreNtX1 BCs84cWBohd3fpABsBak+uFCo7rkmVzW+KT/my0fJBISTbnQKL455Vls8JdESpiKZZ5u qADMGuWewVmMKhwNETlBB5+sSXCu5MBp6RZbASO+tw06dfhJblr0sQKWrwzbJ/4zgkLt IpXti+hKcBq0vCKdJ04feUBPPk2bbbaBFdD3144eEdVon40VEcna4sbS98vr/FSd7qDs iRZ1ci3ySMUeTI4obnKCErwnLNuLxhmpOdusIeR7d62DxplSpzD122CKdvyD6Q7LLZyE 5sww== 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=5H9jqAQW6yo2bDjmWX3B1ZFd0Xj/sFH0VqJRYQwM9NY=; b=qWqDnjVq3jTz43j1dQOmN5thlkctAZ7IZrGhRrg5o1MuIkXyVYUT2vnabFQF4i/W1M nOqxZH3YeYvaf9qRq7JTvmmXii0bNDGLRy9sYSbqvJup7oA99m37j+q4vDaEBiQoR3wH cOFqlMpXfp56p/Ky1mWjlIKk4hGl7BqqXdTkyJsdzS6NLCDKH3Bq7c8rrtTL4YeYJImf Zy2olt1nQ3kYg/Vj86DzB795KVr/Wn76+N36ofxQjgBOv4gPSeUJ75fI232SErx/lccA 2GcH4sV1/A6H0kWa7R+SKQO0f6ohTPJAPBA8h4C7fbu9fbKqUoM+l54EYXSIFyWD4Qm2 TgJQ== X-Gm-Message-State: AOAM532FTECeoeKEXCbQSAYLdd7N1R0wYLirf6/oFStnen3nFWFtOvZb W7/GUc3arla/U8DwlCONrxNJW3zk3xwS+1xpZyys6wKt1dX9WrRc78gXkJeZWv59RNa7f1IieHd kOUJgWtkfJvT/z4yeYNHUydpHwVXVRwNi/LQqTLe4IFytlp4WY2EPnZJBHMh+BafcLQ== X-Google-Smtp-Source: ABdhPJwjmPRgpmUEWgIW6Aju9VWXXPg9Pcb2kVfRsCaYyL+H+GPTRkhUyrWayzf3hEktD3C5pw/ggg== X-Received: by 2002:a05:600c:214a:: with SMTP id v10mr4447227wml.138.1608300982041; Fri, 18 Dec 2020 06:16:22 -0800 (PST) Return-Path: Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:21 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [PATCH 4/9] ArmPkg: remove duplicated ARM/AArch64 ArmGicArchSecLib sources Date: Fri, 18 Dec 2020 14:16:12 +0000 Message-Id: <20201218141617.26947-5-leif@nuviainc.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The ID register access was the only difference between them, so after switching to the ArmHasGicSystemRegisters () helper, there is no longer any need to have separate ARM/AArch64 source files for ArmGicArchSecLib, so unify them and drop the subdirectories. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm --- ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf | 7 +-- ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c | 45 -------------------- ArmPkg/Library/ArmGicArchSecLib/{AArch64 => }/ArmGicArchLib.c | 0 3 files changed, 2 insertions(+), 50 deletions(-) diff --git a/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf index 1a1179a98012..ccebabe451cc 100644 --- a/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf +++ b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf @@ -13,11 +13,8 @@ [Defines] VERSION_STRING = 1.0 LIBRARY_CLASS = ArmGicArchLib|SEC -[Sources.ARM] - Arm/ArmGicArchLib.c - -[Sources.AARCH64] - AArch64/ArmGicArchLib.c +[Sources] + ArmGicArchLib.c [Packages] MdePkg/MdePkg.dec diff --git a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c b/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c deleted file mode 100644 index 2373ca409a17..000000000000 --- a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c +++ /dev/null @@ -1,45 +0,0 @@ -/** @file -* -* Copyright (c) 2014, ARM Limited. All rights reserved. -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#include -#include - -ARM_GIC_ARCH_REVISION -EFIAPI -ArmGicGetSupportedArchRevision ( - VOID - ) -{ - UINT32 IccSre; - - // Ideally we would like to use the GICC IIDR Architecture version here, but - // this does not seem to be very reliable as the implementation could easily - // get it wrong. It is more reliable to check if the GICv3 System Register - // feature is implemented on the CPU. This is also convenient as our GICv3 - // driver requires SRE. If only Memory mapped access is available we try to - // drive the GIC as a v2. - if (ArmHasGicSystemRegisters ()) { - // Make sure System Register access is enabled (SRE). This depends on the - // higher privilege level giving us permission, otherwise we will either - // cause an exception here, or the write doesn't stick in which case we need - // to fall back to the GICv2 MMIO interface. - // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is started - // at the same exception level. - // It is the OS responsibility to set this bit. - IccSre = ArmGicV3GetControlSystemRegisterEnable (); - if (!(IccSre & ICC_SRE_EL2_SRE)) { - ArmGicV3SetControlSystemRegisterEnable (IccSre| ICC_SRE_EL2_SRE); - IccSre = ArmGicV3GetControlSystemRegisterEnable (); - } - if (IccSre & ICC_SRE_EL2_SRE) { - return ARM_GIC_ARCH_REVISION_3; - } - } - - return ARM_GIC_ARCH_REVISION_2; -} diff --git a/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchLib.c similarity index 100% rename from ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c rename to ArmPkg/Library/ArmGicArchSecLib/ArmGicArchLib.c -- 2.20.1