public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] MdeModulePkg/PciBusDxe: Fix IA32 build failure
Date: Thu, 16 Feb 2017 06:20:06 +0000	[thread overview]
Message-ID: <895558F6EA4E3B41AC93A00D163B72741629B45D@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20170216061727.341364-1-ruiyu.ni@intel.com>

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>



> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Thursday, February 16, 2017 2:17 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [PATCH] MdeModulePkg/PciBusDxe: Fix IA32 build failure
> 
> Compiler calculates the PciBar[BarIndex] using
> sizeof (PciBar[0]) * BarIndex, when BarIndex is type of UINT64,
> the above calculation generates assembly code using _allmul.
> 
> Change BarIndex to UINTN to avoid the build failure.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c         | 20 ++++++++++---------
> -
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> index ecda088..d9a83be 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> @@ -1340,8 +1340,8 @@ UpdatePciInfo (
>    )
>  {
>    EFI_STATUS                        Status;
> -  UINT64                            BarIndex;
> -  UINT64                            BarEndIndex;
> +  UINTN                             BarIndex;
> +  UINTN                             BarEndIndex;
>    BOOLEAN                           SetFlag;
>    VOID                              *Configuration;
>    EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;
> @@ -1395,16 +1395,16 @@ UpdatePciInfo (
>        break;
>      }
> 
> -    BarIndex    = Ptr->AddrTranslationOffset;
> -    BarEndIndex = BarIndex;
> -
> -    //
> -    // Update all the bars in the device
> -    // Compare against 0xFF is to keep backward compatibility.
> -    //
> -    if ((BarIndex == MAX_UINT64) || (BarIndex == 0xFF)) {
> +    if ((Ptr->AddrTranslationOffset == MAX_UINT64) || (Ptr-
> >AddrTranslationOffset == MAX_UINT8)) {
> +      //
> +      // Update all the bars in the device
> +      // Compare against MAX_UINT8 is to keep backward compatibility.
> +      //
>        BarIndex    = 0;
>        BarEndIndex = PCI_MAX_BAR - 1;
> +    } else {
> +      BarIndex    = (UINTN) Ptr->AddrTranslationOffset;
> +      BarEndIndex = BarIndex;
>      }
> 
>      if (BarIndex >= PCI_MAX_BAR) {
> --
> 2.9.0.windows.1



      reply	other threads:[~2017-02-16  6:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16  6:17 [PATCH] MdeModulePkg/PciBusDxe: Fix IA32 build failure Ruiyu Ni
2017-02-16  6:20 ` Wu, Jiaxin [this message]

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=895558F6EA4E3B41AC93A00D163B72741629B45D@SHSMSX103.ccr.corp.intel.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