public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Pedro Falcato <pedro.falcato@gmail.com>
Cc: devel@edk2.groups.io, ardb+tianocore@kernel.org,
	quic_llindhol@quicinc.com, neil.jones@blaize.com,
	pierre.gondois@arm.com, Matteo.Carlini@arm.com,
	Akanksha.Jain2@arm.com, Ben.Adderson@arm.com,
	Sibel.Allinson@arm.com, nd@arm.com
Subject: Re: [PATCH v1 07/12] ArmPkg: Fix return value for ArmGicV2AcknowledgeInterrupt
Date: Tue, 23 May 2023 16:17:46 +0100	[thread overview]
Message-ID: <9d15b8b5-3f6a-419c-9773-add00077e81f@arm.com> (raw)
In-Reply-To: <CAKbZUD3hKo6ywdoWocETNPLwud21z2UUfMZttdWMT1pQbtXw7g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1647 bytes --]

Hi Pedro,

Thank you for the feedback.

Please see my response inline marked [SAMI].

Regards,

Sami Mujawar

On 23/05/2023 02:32 pm, Pedro Falcato wrote:
> On Tue, May 23, 2023 at 2:04 PM Sami Mujawar<sami.mujawar@arm.com>  wrote:
>> The IAR register of the Gic CPU interface is 32 bit, while
>> the value returned by ArmGicV2AcknowledgeInterrupt() is
>> UINTN. Therefore, typecast the return value to UINTN before
>> returning.
> Since IAR is 32-bit, doesn't it make sense to return UINT32 here? Is
> this for compatibility with GICv3 or...?

[SAMI] IAR in GICv3 is 32-bit as well. I think this is done to keep 
compatibility with HARDWARE_INTERRUPT_SOURCE which is UINTN.

>> Signed-off-by: Sami Mujawar<sami.mujawar@arm.com>
>> ---
>>   ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c
>> index f403bec367b5254c248e620e56471904e520f9f2..80115b243afabd5e4faad88089af738b19ce4cd1 100644
>> --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c
>> +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c
>> @@ -16,7 +16,7 @@ ArmGicV2AcknowledgeInterrupt (
>>     )
>>   {
>>     // Read the Interrupt Acknowledge Register
>> -  return MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);
>> +  return (UINTN)MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);
>>   }
> You don't need to cast from UINT32 to UINTN IMO. UINTN is, as far as I
> know, always going to be at least 32-bits, so casting makes little
> sense here, in my view, as UINTN >= UINT32.
[SAMI] Ack. I will drop this patch.
>

[-- Attachment #2: Type: text/html, Size: 2897 bytes --]

  reply	other threads:[~2023-05-23 15:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 13:04 [PATCH v1 00/12] ArmPkg: Arm GIC Library and Driver improvements Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 01/12] ArmPkg: Fix data type used for GicDistributorBase Sami Mujawar
2023-05-23 13:29   ` Ard Biesheuvel
2023-05-23 13:04 ` [PATCH v1 02/12] ArmPkg: Fix data type used for GicInterruptInterfaceBase Sami Mujawar
2023-05-23 13:35   ` Pedro Falcato
2023-05-23 15:16     ` Sami Mujawar
2023-05-23 13:36   ` Ard Biesheuvel
2023-05-23 13:04 ` [PATCH v1 03/12] ArmPkg: Fix ArmGicSendSgiTo() parameters Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 04/12] ArmPkg: Fix Non-Boolean comparison in ArmGicEnableDistributor Sami Mujawar
2023-05-23 13:32   ` Ard Biesheuvel
2023-05-23 15:16     ` Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 05/12] ArmPkg: Fix return type for ArmGicGetInterfaceIdentification Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 06/12] ArmPkg: Make variables used for GicInterrupt UINTN Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 07/12] ArmPkg: Fix return value for ArmGicV2AcknowledgeInterrupt Sami Mujawar
2023-05-23 13:32   ` Pedro Falcato
2023-05-23 15:17     ` Sami Mujawar [this message]
2023-05-23 13:04 ` [PATCH v1 08/12] ArmPkg: Typecast IntID to UINT32 in ArmGicV2EndOfInterrupt Sami Mujawar
2023-05-23 13:26   ` [edk2-devel] " Ard Biesheuvel
2023-05-23 15:16     ` Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 09/12] ArmPkg: Remove unused function declarations Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 10/12] ArmPkg: Prevent SgiId from setting RES0 bits of GICD_SGIR Sami Mujawar
2023-05-23 13:37   ` Ard Biesheuvel
2023-05-23 13:04 ` [PATCH v1 11/12] ArmPkg: Adjust variable type and cast for RegShift & RegOffset Sami Mujawar
2023-05-23 13:04 ` [PATCH v1 12/12] ArmPkg: Fix ArmGicAcknowledgeInterrupt () for GICv3 Sami Mujawar
2023-05-23 13:38   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d15b8b5-3f6a-419c-9773-add00077e81f@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox