public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, cenjiahui@huawei.com
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Rebecca Cran <rebecca@bsdio.com>,
	Peter Grehan <grehan@freebsd.org>,
	Anthony Perard <anthony.perard@citrix.com>,
	Julien Grall <julien@xen.org>, Leif Lindholm <leif@nuviainc.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	xieyingtai@huawei.com, wu.wubin@huawei.com,
	Yubo Miao <miaoyubo@huawei.com>
Subject: Re: [edk2-devel] [PATCH v4 3/9] OvmfPkg/PciHostBridgeLib: Extract InitRootBridge/UninitRootBridge
Date: Thu, 14 Jan 2021 09:51:01 +0100	[thread overview]
Message-ID: <edb83334-a45b-85b9-a04e-546a5e21d742@redhat.com> (raw)
In-Reply-To: <20210112094549.10238-4-cenjiahui@huawei.com>

On 01/12/21 10:45, Jiahui Cen via groups.io wrote:

> diff --git a/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h b/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h
> index f932d412aa10..f02cec812a50 100644
> --- a/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h
> +++ b/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h
> @@ -14,6 +14,81 @@
>  #define __PCI_HOST_BRIDGE_UTILITY_LIB_H__
>  
>  
> +#include <Library/PciHostBridgeLib.h>
> +
> +
> +/**
> +  Utility function to initialize a PCI_ROOT_BRIDGE structure.
> +
> +  @param[in]  Supports         Supported attributes.
> +
> +  @param[in]  Attributes       Initial attributes.
> +
> +  @param[in]  AllocAttributes  Allocation attributes.
> +
> +  @param[in]  RootBusNumber    The bus number to store in RootBus.
> +
> +  @param[in]  MaxSubBusNumber  The inclusive maximum bus number that can be
> +                               assigned to any subordinate bus found behind any
> +                               PCI bridge hanging off this root bus.
> +
> +                               The caller is repsonsible for ensuring that
> +                               RootBusNumber <= MaxSubBusNumber. If
> +                               RootBusNumber equals MaxSubBusNumber, then the
> +                               root bus has no room for subordinate buses.
> +
> +  @param[in]  Io               IO aperture.
> +
> +  @param[in]  Mem              MMIO aperture.
> +
> +  @param[in]  MemAbove4G       MMIO aperture above 4G.
> +
> +  @param[in]  PMem             Prefetchable MMIO aperture.
> +
> +  @param[in]  PMemAbove4G      Prefetchable MMIO aperture above 4G.
> +
> +  @param[out] RootBus          The PCI_ROOT_BRIDGE structure (allocated by the
> +                               caller) that should be filled in by this
> +                               function.
> +
> +  @retval EFI_SUCCESS           Initialization successful. A device path
> +                                consisting of an ACPI device path node, with
> +                                UID = RootBusNumber, has been allocated and
> +                                linked into RootBus.
> +
> +  @retval EFI_OUT_OF_RESOURCES  Memory allocation failed.
> +**/
> +EFI_STATUS
> +PciHostBridgeUtilityInitRootBridge (
> +  IN  UINT64                   Supports,
> +  IN  UINT64                   Attributes,
> +  IN  UINT64                   AllocAttributes,
> +  IN  UINT8                    RootBusNumber,
> +  IN  UINT8                    MaxSubBusNumber,
> +  IN  PCI_ROOT_BRIDGE_APERTURE *Io,
> +  IN  PCI_ROOT_BRIDGE_APERTURE *Mem,
> +  IN  PCI_ROOT_BRIDGE_APERTURE *MemAbove4G,
> +  IN  PCI_ROOT_BRIDGE_APERTURE *PMem,
> +  IN  PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G,
> +  OUT PCI_ROOT_BRIDGE          *RootBus
> +  );
> +
> +
> +/**
> +  Utility function to uninitialize a PCI_ROOT_BRIDGE structure set up with
> +  PciHostBridgeUtilityInitRootBridge().
> +
> +  param[in] RootBus  The PCI_ROOT_BRIDGE structure, allocated by the caller and
> +                     initialized with PciHostBridgeUtilityInitRootBridge(),
> +                     that should be uninitialized. This function doesn't free
> +                     RootBus.
> +**/
> +VOID
> +PciHostBridgeUtilityUninitRootBridge (
> +  IN PCI_ROOT_BRIDGE *RootBus
> +  );
> +
> +
>  /**
>    Utility function to inform the platform that the resource conflict happens.
>  

(4) All library functions must be declared EFIAPI.

Thanks
Laszlo


  parent reply	other threads:[~2021-01-14  8:51 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12  9:45 [PATCH v4 0/9] Add extra pci roots support for Arm Jiahui Cen
2021-01-12  9:45 ` [PATCH v4 1/9] OvmfPkg: Introduce PciHostBridgeUtilityLib class Jiahui Cen
2021-01-13  0:41   ` [edk2-devel] " Laszlo Ersek
2021-01-14  8:57   ` Laszlo Ersek
2021-01-12  9:45 ` [PATCH v4 2/9] ArmVirtPkg: Refactor with PciHostBridgeUtilityLib Jiahui Cen
2021-01-13  0:44   ` [edk2-devel] " Laszlo Ersek
2021-01-12  9:45 ` [PATCH v4 3/9] OvmfPkg/PciHostBridgeLib: Extract InitRootBridge/UninitRootBridge Jiahui Cen
2021-01-13  1:28   ` [edk2-devel] " Laszlo Ersek
2021-01-13  6:00     ` Jiahui Cen
2021-01-13  9:06       ` Laszlo Ersek
2021-01-14  8:51   ` Laszlo Ersek [this message]
2021-01-12  9:45 ` [PATCH v4 4/9] OvmfPkg/PciHostBridgeUtilityLib: Extend parameter list of InitRootBridge Jiahui Cen
2021-01-13  1:51   ` [edk2-devel] " Laszlo Ersek
2021-01-13  6:01     ` Jiahui Cen
2021-01-12  9:45 ` [PATCH v4 5/9] ArmVirtPkg/FdtPciHostBridgeLib: Rebase to InitRootBridge() / UninitRootBridge() Jiahui Cen
2021-01-13  2:15   ` [edk2-devel] " Laszlo Ersek
2021-01-13  6:10     ` Jiahui Cen
2021-01-13  9:05       ` Laszlo Ersek
2021-01-12  9:45 ` [PATCH v4 6/9] OvmfPkg/PciHostBridgeLib: Extract GetRootBridges/FreeRootBridges Jiahui Cen
2021-01-14  9:12   ` [edk2-devel] " Laszlo Ersek
2021-01-12  9:45 ` [PATCH v4 7/9] OvmfPkg/PciHostBridgeUtilityLib: Extend parameter list of GetRootBridges Jiahui Cen
2021-01-14 10:46   ` [edk2-devel] " Laszlo Ersek
2021-01-14 12:44     ` Jiahui Cen
2021-01-14 16:03       ` Laszlo Ersek
2021-01-15  7:25     ` Jiahui Cen
2021-01-15  7:59       ` Laszlo Ersek
2021-01-15  8:30         ` Jiahui Cen
2021-01-12  9:45 ` [PATCH v4 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Refactor GetRootBridges() / FreeRootBridges() Jiahui Cen
2021-01-14 11:01   ` [edk2-devel] " Laszlo Ersek
2021-01-14 12:48     ` Jiahui Cen
2021-01-12  9:45 ` [PATCH v4 9/9] ArmVirtPkg/ArmVirtQemu: Add support for HotPlug Jiahui Cen
2021-01-14 11:04   ` [edk2-devel] " Laszlo Ersek
2021-01-14 11:53 ` [PATCH v4 0/9] Add extra pci roots support for Arm Laszlo Ersek
2021-01-14 12:51   ` Jiahui Cen
2021-01-18 17:26     ` [edk2-devel] " Laszlo Ersek

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=edb83334-a45b-85b9-a04e-546a5e21d742@redhat.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