parameters: (bdf, pci_bar)
return_statement: return int(desc[pci_bar].split()[0], 16)
docstring: The file, /sys/bus/pci/devices/{bdf}/resource,
          contains info about the BAR mappings in the
          following format:
  
          0x00000000eab00000 0x00000000eab7ffff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x00000000eaa00000 0x00000000eaafffff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x00000000ea000000 0x00000000ea0fffff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x00000000eab80000 0x00000000eab83fff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
  
          Return the physical address of the requested bar.
docstring_summary: The file, /sys/bus/pci/devices/{bdf}/resource,
          contains info about the BAR mappings in the
          following format:
docstring_tokens: The file / sys / bus / pci / devices / { bdf } / resource contains info about the BAR mappings in the following format :
function: def get_bdf_base_addr(bdf, pci_bar):
      """
          The file, /sys/bus/pci/devices/{bdf}/resource,
          contains info about the BAR mappings in the
          following format:
  
          0x00000000eab00000 0x00000000eab7ffff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x00000000eaa00000 0x00000000eaafffff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x00000000ea000000 0x00000000ea0fffff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x0000000000000000 0x0000000000000000 0x0000000000000000
          0x00000000eab80000 0x00000000eab83fff 0x000000000014220c
          0x0000000000000000 0x0000000000000000 0x0000000000000000
  
          Return the physical address of the requested bar.
      """
      if (pci_bar < 0) or (pci_bar > 5):
          raise Exception("invalid pci_bar {}".format(pci_bar))
  
      devpath = os.path.join(DEVICES_PATH, bdf, "resource")
      with open(devpath, 'r') as fdesc:
          desc = fdesc.read()
          fdesc.close()
  
      desc = desc.split('\n')
      return int(desc[pci_bar].split()[0], 16)
function_tokens: def get_bdf_base_addr ( bdf , pci_bar ) : if ( pci_bar < 0 ) or ( pci_bar > 5 ) : raise Exception ( "invalid pci_bar {}" . format ( pci_bar ) ) devpath = os . path . join ( DEVICES_PATH , bdf , "resource" ) with open ( devpath , 'r' ) as fdesc : desc = fdesc . read ( ) fdesc . close ( ) desc = desc . split ( '\n' ) return int ( desc [ pci_bar ] . split ( ) [ 0 ] , 16 )