2005-04-16 22:20:36 +00: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 11:08:44 +00: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 12:34:50 +00:00
|
|
|
#ifdef CONFIG_NUMA
|
2005-09-15 08:52:34 +00:00
|
|
|
int pcibus_to_node(struct pci_bus *bus)
|
|
|
|
{
|
|
|
|
struct bridge_controller *bc = BRIDGE_CONTROLLER(bus);
|
|
|
|
|
|
|
|
return bc->nasid;
|
|
|
|
}
|
2008-08-05 22:44:49 +00:00
|
|
|
EXPORT_SYMBOL(pcibus_to_node);
|
2013-06-13 12:34:50 +00:00
|
|
|
#endif /* CONFIG_NUMA */
|