From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AC6521A1E72 for ; Fri, 21 Oct 2016 01:34:33 -0700 (PDT) Received: by mail-it0-x22b.google.com with SMTP id k64so46784723itb.0 for ; Fri, 21 Oct 2016 01:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8jdoSreds1UmFsPd60H6Ns3VcvySnBQ9sCZCRWcOFjs=; b=kxWgglvV2/ZCHWQAGojhsnVIptt0iCGaXoYbLlzu7i9tZqo7H5xjwU66wDupjiJLvF V2Sc9gzaAuhwRQf7/5XS6d2xiFg4+N4kkWY0gdmViStuzqmpK/beBzYLOMWlFtIjtpiC ttCRG7ZxpOMHU38kDq5CVxGImf3XThadJILao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8jdoSreds1UmFsPd60H6Ns3VcvySnBQ9sCZCRWcOFjs=; b=kaaxK+2Zg7pkRUVgnr8XHAo9y3Px5Mf74S1BJ07ONPyojiaIQXKF3y/qNWlTpzpVSp 5XoU59eKTMh1Lxgix8Ci0R5a1DvtSb8ZJ2ZczMpqzAkfLEHk6gfc01Xnj8jnJ0T+i2sR QNG2g0a90XPX6J4I2NXPFzh4LsOV+TdlF4PhDxoHRv0jy+aYfO/kciUpwCjVMAYL92yP 1QhZfnPLUpMmbPFvFCJH7EJ9GH3Fg68FNWpNQu3ugOCChn0G5hjv3DX/U/WGROq+jav2 JPXGygEjosu9cMg4Pd1EMRslZjBsd84cQlDdeDLMUa0KMtNxSezCNz1WdbnempmzgSFc izdg== X-Gm-Message-State: AA6/9RkIyWhbH4M5NvdeaUsu5bXbF78qnddDYt92j14Cs7SFbJDdr4PB3TJfhQfgXjsV986DDChriqeLD2YJhhYj X-Received: by 10.36.158.194 with SMTP id p185mr11919420itd.37.1477038872907; Fri, 21 Oct 2016 01:34:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Fri, 21 Oct 2016 01:34:32 -0700 (PDT) In-Reply-To: <1477029054-31980-1-git-send-email-dennis.chen@arm.com> References: <1477029054-31980-1-git-send-email-dennis.chen@arm.com> From: Ard Biesheuvel Date: Fri, 21 Oct 2016 09:34:32 +0100 Message-ID: To: Dennis Chen Cc: edk2-devel-01 , nd@arm.com, Leif Lindholm Subject: Re: [RESEND PATCH] ARMPkg: Unify the GIC base address variables as 64-bit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 08:34:34 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Dennis, On 21 October 2016 at 06:50, Dennis Chen wrote: > Since ACPI spec defines the GIC base addresses (CPU interface, > Distributor and Redistributor*GICv3 only*) as 64-bit, so we should > define these corresponding base address variables as 64-bit instead of > 32-bit. This patch redefines them according to the ACPI spec. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Signed-off-by: Dennis Chen Even if this is GICv3 only, you are breaking the build for 32-bit because of some changes that also affect GICv2 /home/ard/build/edk2/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c:20:1: error: conflicting types for =E2=80=98ArmGicV2AcknowledgeInterrupt=E2=80=99 ArmGicV2AcknowledgeInterrupt ( ^ In file included from /home/ard/build/edk2/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c:15:0: /home/ard/build/edk2/ArmPkg/Include/Library/ArmGicLib.h:252:1: note: previous declaration of =E2=80=98ArmGicV2AcknowledgeInterrupt=E2=80=99 was = here ArmGicV2AcknowledgeInterrupt ( ^ /home/ard/build/edk2/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c:30:1: error: conflicting types for =E2=80=98ArmGicV2EndOfInterrupt=E2=80=99 ArmGicV2EndOfInterrupt ( ^ In file included from /home/ard/build/edk2/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c:15:0: /home/ard/build/edk2/ArmPkg/Include/Library/ArmGicLib.h:258:1: note: previous declaration of =E2=80=98ArmGicV2EndOfInterrupt=E2=80=99 was here ArmGicV2EndOfInterrupt ( ^ When you propose changes like this one, please make sure if works on 64-bit as well as 32-bit Thanks, Ard. > --- > ArmPkg/Drivers/ArmGic/ArmGicLib.c | 64 ++++++++++---------= - > ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c | 2 +- > ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 4 +- > ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c | 4 +- > ArmPkg/Include/Library/ArmGicLib.h | 78 ++++++++++++-------= ------ > 5 files changed, 76 insertions(+), 76 deletions(-) > > diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/Ar= mGicLib.c > index e658e9b..733488c 100644 > --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c > +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c > @@ -41,18 +41,18 @@ SourceIsSpi ( > * @retval Base address of the associated GIC Redistributor > */ > STATIC > -UINTN > +UINT64 > GicGetCpuRedistributorBase ( > - IN UINTN GicRedistributorBase, > - IN ARM_GIC_ARCH_REVISION Revision > + IN UINT64 GicRedistributorBase, > + IN ARM_GIC_ARCH_REVISION Revision > ) > { > - UINTN Index; > - UINTN MpId; > - UINTN CpuAffinity; > - UINTN Affinity; > - UINTN GicRedistributorGranularity; > - UINTN GicCpuRedistributorBase; > + UINTN Index; > + UINTN MpId; > + UINTN CpuAffinity; > + UINTN Affinity; > + UINTN GicRedistributorGranularity; > + UINT64 GicCpuRedistributorBase; > > MpId =3D ArmReadMpidr (); > // Define CPU affinity as Affinity0[0:8], Affinity1[9:15], Affinity2[1= 6:23], Affinity3[24:32] > @@ -87,7 +87,7 @@ GicGetCpuRedistributorBase ( > UINTN > EFIAPI > ArmGicGetInterfaceIdentification ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ) > { > // Read the GIC Identification Register > @@ -97,7 +97,7 @@ ArmGicGetInterfaceIdentification ( > UINTN > EFIAPI > ArmGicGetMaxNumInterrupts ( > - IN INTN GicDistributorBase > + IN UINT64 GicDistributorBase > ) > { > return 32 * ((MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & 0x1F= ) + 1); > @@ -106,10 +106,10 @@ ArmGicGetMaxNumInterrupts ( > VOID > EFIAPI > ArmGicSendSgiTo ( > - IN INTN GicDistributorBase, > - IN INTN TargetListFilter, > - IN INTN CPUTargetList, > - IN INTN SgiId > + IN UINT64 GicDistributorBase, > + IN UINTN TargetListFilter, > + IN UINTN CPUTargetList, > + IN UINTN SgiId > ) > { > MmioWrite32 (GicDistributorBase + ARM_GIC_ICDSGIR, ((TargetListFilter = & 0x3) << 24) | ((CPUTargetList & 0xFF) << 16) | SgiId); > @@ -131,8 +131,8 @@ ArmGicSendSgiTo ( > UINTN > EFIAPI > ArmGicAcknowledgeInterrupt ( > - IN UINTN GicInterruptInterfaceBase, > - OUT UINTN *InterruptId > + IN UINT64 GicInterruptInterfaceBase, > + OUT UINTN *InterruptId > ) > { > UINTN Value; > @@ -162,8 +162,8 @@ ArmGicAcknowledgeInterrupt ( > VOID > EFIAPI > ArmGicEndOfInterrupt ( > - IN UINTN GicInterruptInterfaceBase, > - IN UINTN Source > + IN UINT64 GicInterruptInterfaceBase, > + IN UINTN Source > ) > { > ARM_GIC_ARCH_REVISION Revision; > @@ -181,9 +181,9 @@ ArmGicEndOfInterrupt ( > VOID > EFIAPI > ArmGicEnableInterrupt ( > - IN UINTN GicDistributorBase, > - IN UINTN GicRedistributorBase, > - IN UINTN Source > + IN UINT64 GicDistributorBase, > + IN UINT64 GicRedistributorBase, > + IN UINTN Source > ) > { > UINT32 RegOffset; > @@ -216,9 +216,9 @@ ArmGicEnableInterrupt ( > VOID > EFIAPI > ArmGicDisableInterrupt ( > - IN UINTN GicDistributorBase, > - IN UINTN GicRedistributorBase, > - IN UINTN Source > + IN UINT64 GicDistributorBase, > + IN UINT64 GicRedistributorBase, > + IN UINTN Source > ) > { > UINT32 RegOffset; > @@ -250,15 +250,15 @@ ArmGicDisableInterrupt ( > BOOLEAN > EFIAPI > ArmGicIsInterruptEnabled ( > - IN UINTN GicDistributorBase, > - IN UINTN GicRedistributorBase, > - IN UINTN Source > + IN UINT64 GicDistributorBase, > + IN UINT64 GicRedistributorBase, > + IN UINTN Source > ) > { > UINT32 RegOffset; > UINTN RegShift; > ARM_GIC_ARCH_REVISION Revision; > - UINTN GicCpuRedistributorBase; > + UINT64 GicCpuRedistributorBase; > UINT32 Interrupts; > > // Calculate enable register offset and bit position > @@ -286,7 +286,7 @@ ArmGicIsInterruptEnabled ( > VOID > EFIAPI > ArmGicDisableDistributor ( > - IN INTN GicDistributorBase > + IN UINT64 GicDistributorBase > ) > { > // Disable Gic Distributor > @@ -296,7 +296,7 @@ ArmGicDisableDistributor ( > VOID > EFIAPI > ArmGicEnableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ) > { > ARM_GIC_ARCH_REVISION Revision; > @@ -314,7 +314,7 @@ ArmGicEnableInterruptInterface ( > VOID > EFIAPI > ArmGicDisableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ) > { > ARM_GIC_ARCH_REVISION Revision; > diff --git a/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c b/ArmPkg/Drivers/Arm= Gic/ArmGicNonSecLib.c > index f90391b..bc01db9 100644 > --- a/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c > +++ b/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c > @@ -19,7 +19,7 @@ > VOID > EFIAPI > ArmGicEnableDistributor ( > - IN INTN GicDistributorBase > + IN UINT64 GicDistributorBase > ) > { > ARM_GIC_ARCH_REVISION Revision; > diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c b/ArmPkg/Drivers/A= rmGic/GicV2/ArmGicV2Dxe.c > index b9ecd55..c7c5af1 100644 > --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c > +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c > @@ -30,8 +30,8 @@ Abstract: > > extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV2Protocol; > > -STATIC UINT32 mGicInterruptInterfaceBase; > -STATIC UINT32 mGicDistributorBase; > +STATIC UINT64 mGicInterruptInterfaceBase; > +STATIC UINT64 mGicDistributorBase; > > /** > Enable interrupt source Source. > diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c b/ArmPkg/Dri= vers/ArmGic/GicV2/ArmGicV2NonSecLib.c > index 92b764f..a7adbaf 100644 > --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c > +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c > @@ -20,7 +20,7 @@ > VOID > EFIAPI > ArmGicV2EnableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ) > { > /* > @@ -33,7 +33,7 @@ ArmGicV2EnableInterruptInterface ( > VOID > EFIAPI > ArmGicV2DisableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ) > { > // Disable Gic Interface > diff --git a/ArmPkg/Include/Library/ArmGicLib.h b/ArmPkg/Include/Library/= ArmGicLib.h > index 4364f3f..bf6405c 100644 > --- a/ArmPkg/Include/Library/ArmGicLib.h > +++ b/ArmPkg/Include/Library/ArmGicLib.h > @@ -101,7 +101,7 @@ > UINTN > EFIAPI > ArmGicGetInterfaceIdentification ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ); > > // > @@ -110,56 +110,56 @@ ArmGicGetInterfaceIdentification ( > VOID > EFIAPI > ArmGicSetupNonSecure ( > - IN UINTN MpId, > - IN INTN GicDistributorBase, > - IN INTN GicInterruptInterfaceBase > + IN UINTN MpId, > + IN UINT64 GicDistributorBase, > + IN UINT64 GicInterruptInterfaceBase > ); > > VOID > EFIAPI > ArmGicSetSecureInterrupts ( > - IN UINTN GicDistributorBase, > - IN UINTN* GicSecureInterruptMask, > - IN UINTN GicSecureInterruptMaskSize > + IN UINT64 GicDistributorBase, > + IN UINTN* GicSecureInterruptMask, > + IN UINTN GicSecureInterruptMaskSize > ); > > VOID > EFIAPI > ArmGicEnableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ); > > VOID > EFIAPI > ArmGicDisableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ); > > VOID > EFIAPI > ArmGicEnableDistributor ( > - IN INTN GicDistributorBase > + IN UINT64 GicDistributorBase > ); > > VOID > EFIAPI > ArmGicDisableDistributor ( > - IN INTN GicDistributorBase > + IN UINT64 GicDistributorBase > ); > > UINTN > EFIAPI > ArmGicGetMaxNumInterrupts ( > - IN INTN GicDistributorBase > + IN UINT64 GicDistributorBase > ); > > VOID > EFIAPI > ArmGicSendSgiTo ( > - IN INTN GicDistributorBase, > - IN INTN TargetListFilter, > - IN INTN CPUTargetList, > - IN INTN SgiId > + IN UINT64 GicDistributorBase, > + IN UINTN TargetListFilter, > + IN UINTN CPUTargetList, > + IN UINTN SgiId > ); > > /* > @@ -178,46 +178,46 @@ ArmGicSendSgiTo ( > UINTN > EFIAPI > ArmGicAcknowledgeInterrupt ( > - IN UINTN GicInterruptInterfaceBase, > - OUT UINTN *InterruptId > + IN UINT64 GicInterruptInterfaceBase, > + OUT UINTN *InterruptId > ); > > VOID > EFIAPI > ArmGicEndOfInterrupt ( > - IN UINTN GicInterruptInterfaceBase, > - IN UINTN Source > + IN UINT64 GicInterruptInterfaceBase, > + IN UINTN Source > ); > > UINTN > EFIAPI > ArmGicSetPriorityMask ( > - IN INTN GicInterruptInterfaceBase, > - IN INTN PriorityMask > + IN UINT64 GicInterruptInterfaceBase, > + IN UINTN PriorityMask > ); > > VOID > EFIAPI > ArmGicEnableInterrupt ( > - IN UINTN GicDistributorBase, > - IN UINTN GicRedistributorBase, > - IN UINTN Source > + IN UINT64 GicDistributorBase, > + IN UINT64 GicRedistributorBase, > + IN UINTN Source > ); > > VOID > EFIAPI > ArmGicDisableInterrupt ( > - IN UINTN GicDistributorBase, > - IN UINTN GicRedistributorBase, > - IN UINTN Source > + IN UINT64 GicDistributorBase, > + IN UINT64 GicRedistributorBase, > + IN UINTN Source > ); > > BOOLEAN > EFIAPI > ArmGicIsInterruptEnabled ( > - IN UINTN GicDistributorBase, > - IN UINTN GicRedistributorBase, > - IN UINTN Source > + IN UINT64 GicDistributorBase, > + IN UINT64 GicRedistributorBase, > + IN UINTN Source > ); > > // > @@ -230,34 +230,34 @@ ArmGicIsInterruptEnabled ( > VOID > EFIAPI > ArmGicV2SetupNonSecure ( > - IN UINTN MpId, > - IN INTN GicDistributorBase, > - IN INTN GicInterruptInterfaceBase > + IN UINTN MpId, > + IN UINT64 GicDistributorBase, > + IN UINT64 GicInterruptInterfaceBase > ); > > VOID > EFIAPI > ArmGicV2EnableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ); > > VOID > EFIAPI > ArmGicV2DisableInterruptInterface ( > - IN INTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ); > > UINTN > EFIAPI > ArmGicV2AcknowledgeInterrupt ( > - IN UINTN GicInterruptInterfaceBase > + IN UINT64 GicInterruptInterfaceBase > ); > > VOID > EFIAPI > ArmGicV2EndOfInterrupt ( > - IN UINTN GicInterruptInterfaceBase, > - IN UINTN Source > + IN UINT64 GicInterruptInterfaceBase, > + IN UINTN Source > ); > > // > -- > 2.7.4 >