2005-04-17 02:20:36 +04:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003 Christoph Hellwig (hch@lst.de)
|
|
|
|
* Copyright (C) 1999, 2000, 04 Ralf Baechle (ralf@linux-mips.org)
|
|
|
|
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
|
|
|
|
*/
|
|
|
|
#include <asm/pci/bridge.h>
|
|
|
|
|
2018-06-15 14:08:44 +03:00
|
|
|
dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
|
|
|
|
{
|
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
|
struct bridge_controller *bc = BRIDGE_CONTROLLER(pdev->bus);
|
|
|
|
|
|
|
|
return bc->baddr + paddr;
|
|
|
|
}
|
|
|
|
|
|
|
|
phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr)
|
|
|
|
{
|
|
|
|
return dma_addr & ~(0xffUL << 56);
|
|
|
|
}
|
|
|
|
|
2013-06-13 16:34:50 +04:00
|
|
|
#ifdef CONFIG_NUMA
|
2005-09-15 12:52:34 +04:00
|
|
|
int pcibus_to_node(struct pci_bus *bus)
|
|
|
|
{
|
|
|
|
struct bridge_controller *bc = BRIDGE_CONTROLLER(bus);
|
|
|
|
|
|
|
|
return bc->nasid;
|
|
|
|
}
|
2008-08-06 02:44:49 +04:00
|
|
|
EXPORT_SYMBOL(pcibus_to_node);
|
2013-06-13 16:34:50 +04:00
|
|
|
#endif /* CONFIG_NUMA */
|