<commit_before>/** @file
  This file declares PciCfg2 PPI.

  This ppi Provides platform or chipset-specific access to 
  the PCI configuration space for a specific PCI segment.

  Copyright (c) 2006 - 2009, Intel Corporation
  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.

  @par Revision Reference:
  This PPI is introduced in PI Version 1.0.

**/

#ifndef __PEI_PCI_CFG2_H__
#define __PEI_PCI_CFG2_H__

#define EFI_PEI_PCI_CFG2_PPI_GUID \
  { 0x57a449a, 0x1fdc, 0x4c06, { 0xbf, 0xc9, 0xf5, 0x3f, 0x6a, 0x99, 0xbb, 0x92 } }


typedef struct _EFI_PEI_PCI_CFG2_PPI   EFI_PEI_PCI_CFG2_PPI;

#define EFI_PEI_PCI_CFG_ADDRESS(bus,dev,func,reg) \
  (((bus) << 24) | \
  ((dev) << 16) | \
  ((func) << 8) | \
  ((reg) < 256 ? (reg) : ((UINT64)(reg) << 32)));

///
/// EFI_PEI_PCI_CFG_PPI_WIDTH
///
typedef enum {
  ///
  ///  8-bit access
  ///
  EfiPeiPciCfgWidthUint8  = 0,
  ///
  /// 16-bit access
  ///
  EfiPeiPciCfgWidthUint16 = 1,
  ///
  /// 32-bit access
  ///
  EfiPeiPciCfgWidthUint32 = 2,<commit_msg>Enhance function macro EFI_PEI_PCI_CFG_ADDRESS defined in MdePkg/Include/Ppi/PciCfg2.h to generate the correct Address for PI PciCfg PPI when bus number is larger than 127 and reg is less than 256. And Enhance function macro EFI_PEI_PCI_CFG_ADDRESS to handle that reg is larger than and equal to 256.<commit_after>/** @file
  This file declares PciCfg2 PPI.

  This ppi Provides platform or chipset-specific access to 
  the PCI configuration space for a specific PCI segment.

  Copyright (c) 2006 - 2009, Intel Corporation
  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.

  @par Revision Reference:
  This PPI is introduced in PI Version 1.0.

**/

#ifndef __PEI_PCI_CFG2_H__
#define __PEI_PCI_CFG2_H__

#include <Library/BaseLib.h>

#define EFI_PEI_PCI_CFG2_PPI_GUID \
  { 0x57a449a, 0x1fdc, 0x4c06, { 0xbf, 0xc9, 0xf5, 0x3f, 0x6a, 0x99, 0xbb, 0x92 } }

typedef struct _EFI_PEI_PCI_CFG2_PPI   EFI_PEI_PCI_CFG2_PPI;

#define EFI_PEI_PCI_CFG_ADDRESS(bus,dev,func,reg) \
  (UINT64) ( \
  (((UINTN) bus) << 24) | \
  (((UINTN) dev) << 16) | \
  (((UINTN) func) << 8) | \
  (((UINTN) (reg)) < 256 ? ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) (reg), 32))));

///
/// EFI_PEI_PCI_CFG_PPI_WIDTH
///
typedef enum {
  ///
  ///  8-bit access
  ///
  EfiPeiPciCfgWidthUint8  = 0,
  ///
  /// 16-bit access
  ///
  EfiPeiPciCfgWidthUint16 = 1,
  ///
  /// 32-bit access
  ///
  EfiPeiPciCfgWidthUint32 = 2,
{'fraction_non_alphanumeric': 0.10501567398119123, 'fraction_numerical': 0.04827586206896552, 'mean_word_length': 3.4442896935933147, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4795055', 'n_tokens_mistral': 1310, 'n_tokens_neox': 1172, 'n_words': 358}