From patchwork Fri May 29 12:33:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 49168 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1AD22218EC for ; Fri, 29 May 2015 12:34:18 +0000 (UTC) Received: by lani11 with SMTP id i11sf20105555lan.3 for ; Fri, 29 May 2015 05:34:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=BXQSeAt3A8Ao6+t2bpXDe6/atMRKMdovj4LAQ46czN0=; b=HSHS9eRw8Q/AAU1ro9ffpsZHEEus6aO3kMbP/zAI4kKBu5FOHCc4ZSO2NwhqLYpQqc 4v9NBj02n1XXaTrAfo5ikAmMWgcDqedi295fvLu200VmvhjJqp9SNjLnl9sag/kVsih2 L/y7tOCBQm7N8Y7par5wRv43UgeP5WaAIjHzQAKLRD937kqhE0WFABO/1ES33AQsPWyg 1F5xmZjux8Rd6MCUbcLOJhIbtoOsDanaWr6BHY/Dp8r2hCyqjo5CW741yoQzUz+7Fdl3 oTdUPOYrCNQgdXdmKykOug6hAcQQQx+UQOwM5zIHdczD7pXuOs5t9tFTJgMC5of7/dGI PIjA== X-Gm-Message-State: ALoCoQnDgrhoFiYBNnqddD6ABL/78cw3PPOxpnrONb/UdT9NKCAfJIw5kSBlMXaOv5df+BsnCf9P X-Received: by 10.152.37.101 with SMTP id x5mr7170772laj.5.1432902857059; Fri, 29 May 2015 05:34:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.98 with SMTP id ln2ls76190lac.91.gmail; Fri, 29 May 2015 05:34:16 -0700 (PDT) X-Received: by 10.153.4.43 with SMTP id cb11mr7883373lad.122.1432902856891; Fri, 29 May 2015 05:34:16 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id wm10si4563287lbb.149.2015.05.29.05.34.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 05:34:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labko7 with SMTP id ko7so50991392lab.2 for ; Fri, 29 May 2015 05:34:16 -0700 (PDT) X-Received: by 10.112.182.4 with SMTP id ea4mr2330671lbc.35.1432902856776; Fri, 29 May 2015 05:34:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp290778lbb; Fri, 29 May 2015 05:34:15 -0700 (PDT) X-Received: by 10.50.141.164 with SMTP id rp4mr3720514igb.2.1432902852644; Fri, 29 May 2015 05:34:12 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id o3si4697927icl.17.2015.05.29.05.34.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 05:34:12 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YyJU8-000772-9Z; Fri, 29 May 2015 12:34:00 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YyJU7-00076x-Gj for edk2-devel@lists.sourceforge.net; Fri, 29 May 2015 12:33:59 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.53 as permitted sender) client-ip=74.125.82.53; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wg0-f53.google.com; Received: from mail-wg0-f53.google.com ([74.125.82.53]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YyJU2-0003uV-Hv for edk2-devel@lists.sourceforge.net; Fri, 29 May 2015 12:33:59 +0000 Received: by wgme6 with SMTP id e6so61386824wgm.2 for ; Fri, 29 May 2015 05:33:48 -0700 (PDT) X-Received: by 10.181.11.137 with SMTP id ei9mr5931439wid.48.1432902828548; Fri, 29 May 2015 05:33:48 -0700 (PDT) Received: from localhost.localdomain ([109.112.79.182]) by mx.google.com with ESMTPSA id ex5sm2953226wib.2.2015.05.29.05.33.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 May 2015 05:33:47 -0700 (PDT) From: Ard Biesheuvel To: lersek@redhat.com, olivier.martin@arm.com, leif.lindholm@linaro.org, edk2-devel@lists.sourceforge.net Date: Fri, 29 May 2015 14:33:35 +0200 Message-Id: <1432902820-18721-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432902820-18721-1-git-send-email-ard.biesheuvel@linaro.org> References: <1432902820-18721-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1YyJU2-0003uV-Hv Subject: [edk2] [PATCH 2/7] ArmPkg: merge ArmGicV[23]Lib.h into ArmGicLib.h X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Before splitting off ArmGicArchLib and moving it out of ArmPkg/Drivers/ArmGic into ArmPkg/Library, make sure that the GIC specific declarations it depends on are not hidden away in local headers "GicV2/GicV2Lib.h" and "GicV3/GicV3Lib.h". So merge them with . This is entirely appropriate, since this is not a header that declares a public interface into ArmGicLib, but defines implementation internals. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/ArmGic/AArch64/ArmGicArchLib.c | 2 - ArmPkg/Drivers/ArmGic/Arm/ArmGicArchLib.c | 2 - ArmPkg/Drivers/ArmGic/ArmGicLib.c | 3 - ArmPkg/Drivers/ArmGic/ArmGicSecLib.c | 2 - ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 3 +- ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.h | 54 ------- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 3 +- ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Lib.h | 68 -------- ArmPkg/Include/Library/ArmGicLib.h | 94 ++++++++++++ 9 files changed, 98 insertions(+), 133 deletions(-) diff --git a/ArmPkg/Drivers/ArmGic/AArch64/ArmGicArchLib.c b/ArmPkg/Drivers/ArmGic/AArch64/ArmGicArchLib.c index 88fa4621e613..0e0fa3b9f33e 100644 --- a/ArmPkg/Drivers/ArmGic/AArch64/ArmGicArchLib.c +++ b/ArmPkg/Drivers/ArmGic/AArch64/ArmGicArchLib.c @@ -15,8 +15,6 @@ #include #include -#include "GicV3/ArmGicV3Lib.h" - ARM_GIC_ARCH_REVISION EFIAPI ArmGicGetSupportedArchRevision ( diff --git a/ArmPkg/Drivers/ArmGic/Arm/ArmGicArchLib.c b/ArmPkg/Drivers/ArmGic/Arm/ArmGicArchLib.c index 9ef56efeaa7b..f256de704631 100644 --- a/ArmPkg/Drivers/ArmGic/Arm/ArmGicArchLib.c +++ b/ArmPkg/Drivers/ArmGic/Arm/ArmGicArchLib.c @@ -15,8 +15,6 @@ #include #include -#include "GicV3/ArmGicV3Lib.h" - ARM_GIC_ARCH_REVISION EFIAPI ArmGicGetSupportedArchRevision ( diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c index 48708e3812b4..248e896c4b94 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -19,9 +19,6 @@ #include #include -#include "GicV2/ArmGicV2Lib.h" -#include "GicV3/ArmGicV3Lib.h" - /** * Return the base address of the GIC redistributor for the current CPU * diff --git a/ArmPkg/Drivers/ArmGic/ArmGicSecLib.c b/ArmPkg/Drivers/ArmGic/ArmGicSecLib.c index 1fdd4d73bd7d..d64806d2f16b 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicSecLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicSecLib.c @@ -17,8 +17,6 @@ #include #include -#include "GicV2/ArmGicV2Lib.h" - /* * This function configures the interrupts set by the mask to be secure. * diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c index 743c534e04d9..e649ac1bc6af 100644 --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c @@ -22,8 +22,9 @@ Abstract: --*/ +#include + #include "ArmGicDxe.h" -#include "GicV2/ArmGicV2Lib.h" #define ARM_GIC_DEFAULT_PRIORITY 0x80 diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.h b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.h deleted file mode 100644 index 6803467346a3..000000000000 --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.h +++ /dev/null @@ -1,54 +0,0 @@ -/** @file -* -* Copyright (c) 2013-2014, ARM Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the BSD License -* which accompanies this distribution. The full text of the license may be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -* -**/ - -#ifndef _ARM_GIC_V2_H_ -#define _ARM_GIC_V2_H_ - -// Interrupts from 1020 to 1023 are considered as special interrupts (eg: spurious interrupts) -#define ARM_GIC_IS_SPECIAL_INTERRUPTS(Interrupt) (((Interrupt) >= 1020) && ((Interrupt) <= 1023)) - -VOID -EFIAPI -ArmGicV2SetupNonSecure ( - IN UINTN MpId, - IN INTN GicDistributorBase, - IN INTN GicInterruptInterfaceBase - ); - -VOID -EFIAPI -ArmGicV2EnableInterruptInterface ( - IN INTN GicInterruptInterfaceBase - ); - -VOID -EFIAPI -ArmGicV2DisableInterruptInterface ( - IN INTN GicInterruptInterfaceBase - ); - -UINTN -EFIAPI -ArmGicV2AcknowledgeInterrupt ( - IN UINTN GicInterruptInterfaceBase - ); - -VOID -EFIAPI -ArmGicV2EndOfInterrupt ( - IN UINTN GicInterruptInterfaceBase, - IN UINTN Source - ); - -#endif diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c index 73cac8774056..4afa3d5a09c2 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c +++ b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c @@ -12,8 +12,9 @@ * **/ +#include + #include "ArmGicDxe.h" -#include "GicV3/ArmGicV3Lib.h" #define ARM_GIC_DEFAULT_PRIORITY 0x80 diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Lib.h b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Lib.h deleted file mode 100644 index 794e8788a60b..000000000000 --- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Lib.h +++ /dev/null @@ -1,68 +0,0 @@ -/** @file -* -* Copyright (c) 2014-2015, ARM Limited. All rights reserved. -* -* This program and the accompanying materials are licensed and made available -* under the terms and conditions of the BSD License which accompanies this -* distribution. The full text of the license may be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -* -**/ - -#ifndef _ARM_GIC_V3_H_ -#define _ARM_GIC_V3_H_ - -#define ICC_SRE_EL2_SRE (1 << 0) - -#define ARM_GICD_IROUTER_IRM BIT31 - -UINT32 -EFIAPI -ArmGicV3GetControlSystemRegisterEnable ( - VOID - ); - -VOID -EFIAPI -ArmGicV3SetControlSystemRegisterEnable ( - IN UINT32 ControlSystemRegisterEnable - ); - -VOID -EFIAPI -ArmGicV3EnableInterruptInterface ( - VOID - ); - -VOID -EFIAPI -ArmGicV3DisableInterruptInterface ( - VOID - ); - -UINTN -EFIAPI -ArmGicV3AcknowledgeInterrupt ( - VOID - ); - -VOID -EFIAPI -ArmGicV3EndOfInterrupt ( - IN UINTN Source - ); - -VOID -ArmGicV3SetBinaryPointer ( - IN UINTN BinaryPoint - ); - -VOID -ArmGicV3SetPriorityMask ( - IN UINTN Priority - ); - -#endif diff --git a/ArmPkg/Include/Library/ArmGicLib.h b/ArmPkg/Include/Library/ArmGicLib.h index e2a4818c4c0c..e3db9c0d250f 100644 --- a/ArmPkg/Include/Library/ArmGicLib.h +++ b/ArmPkg/Include/Library/ArmGicLib.h @@ -231,4 +231,98 @@ ArmGicIsInterruptEnabled ( IN UINTN Source ); +// +// GIC revision 2 specific declarations +// + +// Interrupts from 1020 to 1023 are considered as special interrupts (eg: spurious interrupts) +#define ARM_GIC_IS_SPECIAL_INTERRUPTS(Interrupt) (((Interrupt) >= 1020) && ((Interrupt) <= 1023)) + +VOID +EFIAPI +ArmGicV2SetupNonSecure ( + IN UINTN MpId, + IN INTN GicDistributorBase, + IN INTN GicInterruptInterfaceBase + ); + +VOID +EFIAPI +ArmGicV2EnableInterruptInterface ( + IN INTN GicInterruptInterfaceBase + ); + +VOID +EFIAPI +ArmGicV2DisableInterruptInterface ( + IN INTN GicInterruptInterfaceBase + ); + +UINTN +EFIAPI +ArmGicV2AcknowledgeInterrupt ( + IN UINTN GicInterruptInterfaceBase + ); + +VOID +EFIAPI +ArmGicV2EndOfInterrupt ( + IN UINTN GicInterruptInterfaceBase, + IN UINTN Source + ); + +// +// GIC revision 3 specific declarations +// + +#define ICC_SRE_EL2_SRE (1 << 0) + +#define ARM_GICD_IROUTER_IRM BIT31 + +UINT32 +EFIAPI +ArmGicV3GetControlSystemRegisterEnable ( + VOID + ); + +VOID +EFIAPI +ArmGicV3SetControlSystemRegisterEnable ( + IN UINT32 ControlSystemRegisterEnable + ); + +VOID +EFIAPI +ArmGicV3EnableInterruptInterface ( + VOID + ); + +VOID +EFIAPI +ArmGicV3DisableInterruptInterface ( + VOID + ); + +UINTN +EFIAPI +ArmGicV3AcknowledgeInterrupt ( + VOID + ); + +VOID +EFIAPI +ArmGicV3EndOfInterrupt ( + IN UINTN Source + ); + +VOID +ArmGicV3SetBinaryPointer ( + IN UINTN BinaryPoint + ); + +VOID +ArmGicV3SetPriorityMask ( + IN UINTN Priority + ); + #endif