node-drivers/base-driver/drivers/vca/plx87xx/plx_main.c
static int plx_map_resources(struct plx_device *xdev, struct pci_dev *pdev)
{
	int rc = 0;

	xdev->mmio.pa = pci_resource_start(pdev, PLX_MMIO_BAR);
	xdev->mmio.len = pci_resource_len(pdev, PLX_MMIO_BAR);
	xdev->mmio.va = pci_ioremap_bar(pdev, PLX_MMIO_BAR);

	if (!xdev->mmio.va) {
		dev_err(&pdev->dev, "Cannot remap MMIO BAR\n");
		rc = -EIO;
		goto finish;
	}

	dev_info(&pdev->dev, "mmio pa 0x%llx len 0x%llx va %p\n",
		 xdev->mmio.pa, xdev->mmio.len, xdev->mmio.va);

	//mtrr_del(4,0x2000000000,0x2000000000);
	xdev->aper.pa = pci_resource_start(pdev, PLX_APER_BAR);
	xdev->aper.len = pci_resource_len(pdev, PLX_APER_BAR);
	xdev->aper.va = ioremap(xdev->aper.pa, xdev->aper.len);

	if (!xdev->aper.va) {
		dev_err(&pdev->dev, "Cannot remap Aperture BAR\n");
		rc = -EIO;
		goto unmap_mmio;
	}

	dev_info(&pdev->dev, "somnath with cached mode: aper pa 0x%llx len 0x%llx va %p\n",
		 xdev->aper.pa, xdev->aper.len, xdev->aper.va);
	goto finish;

unmap_mmio:
	iounmap(xdev->mmio.va);
finish:
	return rc;
}
/**
 * plx_map_resources - Mapping resources to device
 * @xdev: plx device structure
 * @pdev: PCI device structure
 * returns 0 on success, < 0 on failure.
 */
Mapping resources to device
@xdev: plx device structure
@pdev: PCI device structure
returns 0 on success, < 0 on failure.
Mapping resources to device @xdev : plx device structure @pdev : PCI device structure returns 0 on success < 0 on failure .
static int plx_map_resources(struct plx_device *xdev, struct pci_dev *pdev)
{
	int rc = 0;
	xdev->mmio.pa = pci_resource_start(pdev, PLX_MMIO_BAR);
	xdev->mmio.len = pci_resource_len(pdev, PLX_MMIO_BAR);
	xdev->mmio.va = pci_ioremap_bar(pdev, PLX_MMIO_BAR);
	if (!xdev->mmio.va) {
		dev_err(&pdev->dev, "Cannot remap MMIO BAR\n");
		rc = -EIO;
		goto finish;
	}
	dev_info(&pdev->dev, "mmio pa 0x%llx len 0x%llx va %p\n",
		 xdev->mmio.pa, xdev->mmio.len, xdev->mmio.va);
	xdev->aper.pa = pci_resource_start(pdev, PLX_APER_BAR);
	xdev->aper.len = pci_resource_len(pdev, PLX_APER_BAR);
	xdev->aper.va = ioremap(xdev->aper.pa, xdev->aper.len);
	if (!xdev->aper.va) {
		dev_err(&pdev->dev, "Cannot remap Aperture BAR\n");
		rc = -EIO;
		goto unmap_mmio;
	}
	dev_info(&pdev->dev, "somnath with cached mode: aper pa 0x%llx len 0x%llx va %p\n",
		 xdev->aper.pa, xdev->aper.len, xdev->aper.va);
	goto finish;
unmap_mmio:
	iounmap(xdev->mmio.va);
finish:
	return rc;
}
static int plx_map_resources ( struct plx_device * xdev , struct pci_dev * pdev ) { int rc = 0 ; xdev -> mmio . pa = pci_resource_start ( pdev , PLX_MMIO_BAR ) ; xdev -> mmio . len = pci_resource_len ( pdev , PLX_MMIO_BAR ) ; xdev -> mmio . va = pci_ioremap_bar ( pdev , PLX_MMIO_BAR ) ; if ( ! xdev -> mmio . va ) { dev_err ( & pdev -> dev , " \n " ) ; rc = - EIO ; goto finish ; } dev_info ( & pdev -> dev , " \n " , xdev -> mmio . pa , xdev -> mmio . len , xdev -> mmio . va ) ; xdev -> aper . pa = pci_resource_start ( pdev , PLX_APER_BAR ) ; xdev -> aper . len = pci_resource_len ( pdev , PLX_APER_BAR ) ; xdev -> aper . va = ioremap ( xdev -> aper . pa , xdev -> aper . len ) ; if ( ! xdev -> aper . va ) { dev_err ( & pdev -> dev , " \n " ) ; rc = - EIO ; goto unmap_mmio ; } dev_info ( & pdev -> dev , " \n " , xdev -> aper . pa , xdev -> aper . len , xdev -> aper . va ) ; goto finish ; unmap_mmio : iounmap ( xdev -> mmio . va ) ; finish : return rc ; }
plx_map_resources - Mapping resources to device
 @xdev: plx device structure
 @pdev: PCI device structure
 returns 0 on success, < 0 on failure.
plx_map_resources - Mapping resources to device @xdev : plx device structure @pdev : PCI device structure returns 0 on success < 0 on failure .
//mtrr_del(4,0x2000000000,0x2000000000);