pci_dma.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:17k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * This file is subject to the terms and conditions of the GNU General Public
  3.  * License.  See the file "COPYING" in the main directory of this archive
  4.  * for more details.
  5.  *
  6.  * Copyright (C) 2000,2002 Silicon Graphics, Inc. All rights reserved.
  7.  *
  8.  * Routines for PCI DMA mapping.  See Documentation/DMA-mapping.txt for
  9.  * a description of how these routines should be used.
  10.  */
  11. #include <linux/types.h>
  12. #include <linux/mm.h>
  13. #include <linux/string.h>
  14. #include <linux/pci.h>
  15. #include <linux/slab.h>
  16. #include <linux/devfs_fs_kernel.h>
  17. #include <linux/module.h>
  18. #include <asm/delay.h>
  19. #include <asm/io.h>
  20. #include <asm/sn/sgi.h>
  21. #include <asm/sn/io.h>
  22. #include <asm/sn/invent.h>
  23. #include <asm/sn/hcl.h>
  24. #include <asm/sn/pci/pcibr.h>
  25. #include <asm/sn/pci/pcibr_private.h>
  26. #include <asm/sn/driver.h>
  27. #include <asm/sn/types.h>
  28. #include <asm/sn/alenlist.h>
  29. #include <asm/sn/pci/pci_bus_cvlink.h>
  30. #include <asm/sn/nag.h>
  31. /* DMA, PIO, and memory allocation flags */
  32. #ifdef CONFIG_IA64_SGI_SN1
  33. #define DMA_DATA_FLAGS ( PCIIO_BYTE_STREAM | PCIIO_DMA_DATA )
  34. #define DMA_CONTROL_FLAGS ( PCIIO_BYTE_STREAM | PCIBR_BARRIER | 
  35.   PCIIO_DMA_CMD )
  36. #elif defined(CONFIG_IA64_SGI_SN2)
  37. #define DMA_DATA_FLAGS ( PCIIO_DMA_DATA )
  38. #define DMA_CONTROL_FLAGS ( PCIBR_BARRIER | PCIIO_DMA_CMD )
  39. #else
  40. #error need to define DMA mapping flags for this platform
  41. #endif
  42. /*
  43.  * For ATE allocations
  44.  */
  45. pciio_dmamap_t get_free_pciio_dmamap(devfs_handle_t);
  46. void free_pciio_dmamap(pcibr_dmamap_t);
  47. static struct sn_dma_maps_s *find_sn_dma_map(dma_addr_t, unsigned char);
  48. /*
  49.  * Toplogy stuff
  50.  */
  51. extern devfs_handle_t busnum_to_pcibr_vhdl[];
  52. extern nasid_t busnum_to_nid[];
  53. extern void * busnum_to_atedmamaps[];
  54. /**
  55.  * get_free_pciio_dmamap - find and allocate an ATE
  56.  * @pci_bus: PCI bus to get an entry for
  57.  *
  58.  * Finds and allocates an ATE on the PCI bus specified
  59.  * by @pci_bus.
  60.  */
  61. pciio_dmamap_t
  62. get_free_pciio_dmamap(devfs_handle_t pci_bus)
  63. {
  64. int i;
  65. struct sn_dma_maps_s *sn_dma_map = NULL;
  66. /*
  67.  * Darn, we need to get the maps allocated for this bus.
  68.  */
  69. for (i = 0; i < MAX_PCI_XWIDGET; i++) {
  70. if (busnum_to_pcibr_vhdl[i] == pci_bus) {
  71. sn_dma_map = busnum_to_atedmamaps[i];
  72. }
  73. }
  74. /*
  75.  * Now get a free dmamap entry from this list.
  76.  */
  77. for (i = 0; i < MAX_ATE_MAPS; i++, sn_dma_map++) {
  78. if (!sn_dma_map->dma_addr) {
  79. sn_dma_map->dma_addr = -1;
  80. return( (pciio_dmamap_t) sn_dma_map );
  81. }
  82. }
  83. return NULL;
  84. }
  85. /**
  86.  * free_pciio_dmamap - free an ATE
  87.  * @dma_map: ATE to free
  88.  *
  89.  * Frees the ATE specified by @dma_map.
  90.  */
  91. void
  92. free_pciio_dmamap(pcibr_dmamap_t dma_map)
  93. {
  94. struct sn_dma_maps_s *sn_dma_map;
  95. sn_dma_map = (struct sn_dma_maps_s *) dma_map;
  96. sn_dma_map->dma_addr = 0;
  97. }
  98. /**
  99.  * find_sn_dma_map - find an ATE associated with @dma_addr and @busnum
  100.  * @dma_addr: DMA address to look for
  101.  * @busnum: PCI bus to look on
  102.  *
  103.  * Finds the ATE associated with @dma_addr and @busnum.
  104.  */
  105. static struct sn_dma_maps_s *
  106. find_sn_dma_map(dma_addr_t dma_addr, unsigned char busnum)
  107. {
  108. struct sn_dma_maps_s *sn_dma_map = NULL;
  109. int i;
  110. sn_dma_map = busnum_to_atedmamaps[busnum];
  111. for (i = 0; i < MAX_ATE_MAPS; i++, sn_dma_map++) {
  112. if (sn_dma_map->dma_addr == dma_addr) {
  113. return sn_dma_map;
  114. }
  115. }
  116. printk(KERN_WARNING "find_sn_dma_map: Unable find the corresponding "
  117.        "dma mapn");
  118. return NULL;
  119. }
  120. /**
  121.  * sn_dma_sync - try to flush DMA buffers into the coherence domain
  122.  * @hwdev: device to flush
  123.  *
  124.  * This routine flushes all DMA buffers for the device into the II of
  125.  * the destination hub.
  126.  *
  127.  * NOTE!: this does not mean that the data is in the "coherence domain",
  128.  * but it is very close.  In other words, this routine *does not work*
  129.  * as advertised due to hardware bugs.  That said, it should be good enough for
  130.  * most situations.
  131.  */
  132. void
  133. sn_dma_sync(struct pci_dev *hwdev)
  134. {
  135. struct sn_device_sysdata *device_sysdata;
  136. volatile unsigned long dummy;
  137. /*
  138.  * It is expected that on an IA64 platform, a DMA sync ensures that 
  139.  * all the DMA from a particular device is complete and coherent.  We
  140.  * try to do this by
  141.  * 1. flushing the write wuffers from Bridge
  142.  * 2. flushing the Xbow port.
  143.  * Unfortunately, this only gets the DMA transactions 'very close' to
  144.  * the coherence domain, but not quite in it.
  145.  */
  146. device_sysdata = (struct sn_device_sysdata *)hwdev->sysdata;
  147. dummy = (volatile unsigned long ) *device_sysdata->dma_buf_sync;
  148. /*
  149.  * For the Xbow port flush, we maybe denied the request because 
  150.  * someone else may be flushing the port .. try again.
  151.  */
  152. while((volatile unsigned long ) *device_sysdata->xbow_buf_sync) {
  153. udelay(2);
  154. }
  155. }
  156. /**
  157.  * sn_pci_alloc_consistent - allocate memory for coherent DMA
  158.  * @hwdev: device to allocate for
  159.  * @size: size of the region
  160.  * @dma_handle: DMA (bus) address
  161.  *
  162.  * pci_alloc_consistent() returns a pointer to a memory region suitable for
  163.  * coherent DMA traffic to/from a PCI device.  On SN platforms, this means
  164.  * that @dma_handle will have the PCIBR_BARRIER and PCIIO_DMA_CMD flags
  165.  * set.
  166.  *
  167.  * This interface is usually used for "command" streams (e.g. the command
  168.  * queue for a SCSI controller).  See Documentation/DMA-mapping.txt for
  169.  * more information.  Note that this routine should always put a 32 bit
  170.  * DMA address into @dma_handle.  This is because most other platforms
  171.  * that are capable of 64 bit PCI DMA transactions can't do 64 bit _coherent_
  172.  * DMAs, and unfortunately this interface has to cater to the LCD.  Oh well.
  173.  *
  174.  * Also known as platform_pci_alloc_consistent() by the IA64 machvec code.
  175.  */
  176. void *
  177. sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
  178. {
  179.         void *cpuaddr;
  180. devfs_handle_t vhdl;
  181. struct sn_device_sysdata *device_sysdata;
  182. unsigned long phys_addr;
  183. pciio_dmamap_t dma_map = 0;
  184. struct sn_dma_maps_s *sn_dma_map;
  185. *dma_handle = 0;
  186. /* We can't easily support < 32 bit devices */
  187. if (IS_PCI32L(hwdev))
  188. return NULL;
  189. /*
  190.  * Get hwgraph vertex for the device
  191.  */
  192. device_sysdata = (struct sn_device_sysdata *) hwdev->sysdata;
  193. vhdl = device_sysdata->vhdl;
  194. /*
  195.  * Allocate the memory.  FIXME: if we're allocating for
  196.  * two devices on the same bus, we should at least try to
  197.  * allocate memory in the same 2 GB window to avoid using
  198.  * ATEs for the translation.  See the comment above about the
  199.  * 32 bit requirement for this function.
  200.  */
  201. if(!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size))))
  202. return NULL;
  203. memset(cpuaddr, 0, size); /* have to zero it out */
  204. /* physical addr. of the memory we just got */
  205. phys_addr = __pa(cpuaddr);
  206. *dma_handle = pciio_dmatrans_addr(vhdl, NULL, phys_addr, size,
  207.   DMA_CONTROL_FLAGS);
  208. /*
  209.  * It is a 32 bit card and we cannot do direct mapping,
  210.  * so we use an ATE.
  211.  */
  212. if (!(*dma_handle)) {
  213. dma_map = pciio_dmamap_alloc(vhdl, NULL, size,
  214.      DMA_CONTROL_FLAGS | PCIIO_FIXED);
  215. if (!dma_map) {
  216. printk(KERN_ERR "sn_pci_alloc_consistent: Unable to "
  217.        "allocate anymore 32 bit page map entries.n");
  218. BUG();
  219. }
  220. *dma_handle = (dma_addr_t) pciio_dmamap_addr(dma_map,phys_addr,
  221.      size);
  222. sn_dma_map = (struct sn_dma_maps_s *)dma_map;
  223. sn_dma_map->dma_addr = *dma_handle;
  224. printk(KERN_INFO "%s: PMU mapping: %pn", __FUNCTION__,
  225.        (void *)*dma_handle);
  226. }
  227. else
  228. printk(KERN_INFO "%s: direct mapping: %pn", __FUNCTION__,
  229.        (void *)*dma_handle);
  230.         return cpuaddr;
  231. }
  232. /**
  233.  * sn_pci_free_consistent - free memory associated with coherent DMAable region
  234.  * @hwdev: device to free for
  235.  * @size: size to free
  236.  * @vaddr: kernel virtual address to free
  237.  * @dma_handle: DMA address associated with this region
  238.  *
  239.  * Frees the memory allocated by pci_alloc_consistent().  Also known
  240.  * as platform_pci_free_consistent() by the IA64 machvec code.
  241.  */
  242. void
  243. sn_pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)
  244. {
  245. struct sn_dma_maps_s *sn_dma_map = NULL;
  246. /*
  247.  * Get the sn_dma_map entry.
  248.  */
  249. if (IS_PCI32_MAPPED(dma_handle))
  250. sn_dma_map = find_sn_dma_map(dma_handle, hwdev->bus->number);
  251. /*
  252.  * and free it if necessary...
  253.  */
  254. if (sn_dma_map) {
  255. pciio_dmamap_done((pciio_dmamap_t)sn_dma_map);
  256. pciio_dmamap_free((pciio_dmamap_t)sn_dma_map);
  257. sn_dma_map->dma_addr = (dma_addr_t)NULL;
  258. }
  259. free_pages((unsigned long) vaddr, get_order(size));
  260. }
  261. /**
  262.  * sn_pci_map_sg - map a scatter-gather list for DMA
  263.  * @hwdev: device to map for
  264.  * @sg: scatterlist to map
  265.  * @nents: number of entries
  266.  * @direction: direction of the DMA transaction
  267.  *
  268.  * Maps each entry of @sg for DMA.  Also known as platform_pci_map_sg by the
  269.  * IA64 machvec code.
  270.  */
  271. int
  272. sn_pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
  273. {
  274. int i;
  275. devfs_handle_t vhdl;
  276. dma_addr_t dma_addr;
  277. unsigned long phys_addr;
  278. struct sn_device_sysdata *device_sysdata;
  279. pciio_dmamap_t dma_map;
  280. /* can't go anywhere w/o a direction in life */
  281. if (direction == PCI_DMA_NONE)
  282. BUG();
  283. /*
  284.  * Get the hwgraph vertex for the device
  285.  */
  286. device_sysdata = (struct sn_device_sysdata *) hwdev->sysdata;
  287. vhdl = device_sysdata->vhdl;
  288. /*
  289.  * Setup a DMA address for each entry in the
  290.  * scatterlist.
  291.  */
  292. for (i = 0; i < nents; i++, sg++) {
  293. /* this catches incorrectly written drivers that
  294.                    attempt to map scatterlists that they have
  295.                    previously mapped.  we print a warning and
  296.                    continue, but the driver should be fixed */
  297. switch (((u64)sg->address) >> 60) {
  298. case 0xa:
  299. case 0xb:
  300. #ifdef DEBUG
  301. /* This needs to be cleaned up at some point. */
  302. NAG("A PCI driver (for device at%8s) has attempted to "
  303.     "map a scatterlist that was previously mapped at "
  304.     "%p - this is currently being worked around.n",
  305.     hwdev->slot_name, (void *)sg->address);
  306. #endif
  307. phys_addr = (u64)sg->address & TO_PHYS_MASK;
  308. break;
  309. default: /* not previously mapped, get the phys. addr */
  310. phys_addr = __pa(sg->address);
  311. break;
  312. }
  313. sg->page = NULL;
  314. dma_addr = 0;
  315. /*
  316.  * Handle the most common case: 64 bit cards.  This
  317.  * call should always succeed.
  318.  */
  319. if (IS_PCIA64(hwdev)) {
  320. dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr,
  321.        sg->length,
  322.        DMA_DATA_FLAGS | PCIIO_DMA_A64 );
  323. sg->address = (char *)dma_addr;
  324. continue;
  325. }
  326. /*
  327.  * Handle 32-63 bit cards via direct mapping
  328.  */
  329. if (IS_PCI32G(hwdev)) {
  330. dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr,
  331.        sg->length,
  332.        DMA_DATA_FLAGS);
  333. /*
  334.  * See if we got a direct map entry
  335.  */
  336. if (dma_addr) {
  337. sg->address = (char *)dma_addr;
  338. continue;
  339. }
  340. }
  341. /*
  342.  * It is a 32 bit card and we cannot do direct mapping,
  343.  * so we use an ATE.
  344.  */
  345. dma_map = 0;
  346. dma_map = pciio_dmamap_alloc(vhdl, NULL, sg->length,
  347.      DMA_DATA_FLAGS);
  348. if (!dma_map) {
  349. printk(KERN_ERR "sn_pci_map_sg: Unable to allocate "
  350.        "anymore 32 bit page map entries.n");
  351. BUG();
  352. }
  353. dma_addr = pciio_dmamap_addr(dma_map, phys_addr, sg->length);
  354. sg->address = (char *)dma_addr;
  355. sg->page = (char *)dma_map;
  356. }
  357. return nents;
  358. }
  359. /**
  360.  * sn_pci_unmap_sg - unmap a scatter-gather list
  361.  * @hwdev: device to unmap
  362.  * @sg: scatterlist to unmap
  363.  * @nents: number of scatterlist entries
  364.  * @direction: DMA direction
  365.  *
  366.  * Unmap a set of streaming mode DMA translations.  Again, cpu read rules
  367.  * concerning calls here are the same as for pci_unmap_single() below.  Also
  368.  * known as sn_pci_unmap_sg() by the IA64 machvec code.
  369.  */
  370. void
  371. sn_pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
  372. {
  373. int i;
  374. struct sn_dma_maps_s *sn_dma_map;
  375. /* can't go anywhere w/o a direction in life */
  376. if (direction == PCI_DMA_NONE)
  377. BUG();
  378. for (i = 0; i < nents; i++, sg++)
  379. if (sg->page) {
  380. /*
  381.  * We maintain the DMA Map pointer in sg->page if 
  382.  * it is ever allocated.
  383.  */
  384. sg->address = 0;
  385. sn_dma_map = (struct sn_dma_maps_s *)sg->page;
  386. pciio_dmamap_done((pciio_dmamap_t)sn_dma_map);
  387. pciio_dmamap_free((pciio_dmamap_t)sn_dma_map);
  388. sn_dma_map->dma_addr = 0;
  389. sg->page = 0;
  390. }
  391. }
  392. /**
  393.  * sn_pci_map_single - map a single region for DMA
  394.  * @hwdev: device to map for
  395.  * @ptr: kernel virtual address of the region to map
  396.  * @size: size of the region
  397.  * @direction: DMA direction
  398.  *
  399.  * Map the region pointed to by @ptr for DMA and return the
  400.  * DMA address.   Also known as platform_pci_map_single() by
  401.  * the IA64 machvec code.
  402.  *
  403.  * We map this to the one step pciio_dmamap_trans interface rather than
  404.  * the two step pciio_dmamap_alloc/pciio_dmamap_addr because we have
  405.  * no way of saving the dmamap handle from the alloc to later free
  406.  * (which is pretty much unacceptable).
  407.  *
  408.  * TODO: simplify our interface;
  409.  *       get rid of dev_desc and vhdl (seems redundant given a pci_dev);
  410.  *       figure out how to save dmamap handle so can use two step.
  411.  */
  412. dma_addr_t
  413. sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
  414. {
  415. devfs_handle_t vhdl;
  416. dma_addr_t dma_addr;
  417. unsigned long phys_addr;
  418. struct sn_device_sysdata *device_sysdata;
  419. pciio_dmamap_t dma_map = NULL;
  420. struct sn_dma_maps_s *sn_dma_map;
  421. if (direction == PCI_DMA_NONE)
  422. BUG();
  423. /* SN cannot support DMA addresses smaller than 32 bits. */
  424. if (IS_PCI32L(hwdev)) return 0;
  425. /*
  426.  * find vertex for the device
  427.  */
  428. device_sysdata = (struct sn_device_sysdata *)hwdev->sysdata;
  429. vhdl = device_sysdata->vhdl;
  430. /*
  431.  * Call our dmamap interface
  432.  */
  433. dma_addr = 0;
  434. phys_addr = __pa(ptr);
  435. if (IS_PCIA64(hwdev)) {
  436. /*
  437.  * This device supports 64 bit DMA addresses.
  438.  */
  439. dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr, size,
  440.        DMA_DATA_FLAGS | PCIIO_DMA_A64);
  441. return dma_addr;
  442. }
  443. /*
  444.  * Devices that supports 32 bit to 63 bit DMA addresses get
  445.  * 32 bit DMA addresses.
  446.  *
  447.  * First try to get a 32 bit direct map register.
  448.  */
  449. if (IS_PCI32G(hwdev)) {
  450. dma_addr = pciio_dmatrans_addr(vhdl, NULL, phys_addr, size,
  451.        DMA_DATA_FLAGS);
  452. if (dma_addr)
  453. return dma_addr;
  454. }
  455. /*
  456.  * It's a 32 bit card and we cannot do direct mapping so
  457.  * let's use the PMU instead.
  458.  */
  459. dma_map = NULL;
  460. dma_map = pciio_dmamap_alloc(vhdl, NULL, size, DMA_DATA_FLAGS);
  461. if (!dma_map) {
  462. printk(KERN_ERR "pci_map_single: Unable to allocate anymore "
  463.        "32 bits page map entries.n");
  464. BUG();
  465. }
  466. dma_addr = (dma_addr_t) pciio_dmamap_addr(dma_map, phys_addr, size);
  467. sn_dma_map = (struct sn_dma_maps_s *)dma_map;
  468. sn_dma_map->dma_addr = dma_addr;
  469. return ((dma_addr_t)dma_addr);
  470. }
  471. /**
  472.  * sn_pci_unmap_single - unmap a region used for DMA
  473.  * @hwdev: device to unmap
  474.  * @dma_addr: DMA address to unmap
  475.  * @size: size of region
  476.  * @direction: DMA direction
  477.  *
  478.  * Unmaps the region pointed to by @dma_addr.  Also known as
  479.  * platform_pci_unmap_single() by the IA64 machvec code.
  480.  */
  481. void
  482. sn_pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction)
  483. {
  484. struct sn_dma_maps_s *sn_dma_map = NULL;
  485.         if (direction == PCI_DMA_NONE)
  486. BUG();
  487. /*
  488.  * Get the sn_dma_map entry.
  489.  */
  490. if (IS_PCI32_MAPPED(dma_addr))
  491. sn_dma_map = find_sn_dma_map(dma_addr, hwdev->bus->number);
  492. /*
  493.  * and free it if necessary...
  494.  */
  495. if (sn_dma_map) {
  496. pciio_dmamap_done((pciio_dmamap_t)sn_dma_map);
  497. pciio_dmamap_free((pciio_dmamap_t)sn_dma_map);
  498. sn_dma_map->dma_addr = (dma_addr_t)NULL;
  499. }
  500. }
  501. /**
  502.  * sn_pci_dma_sync_single - make sure all DMAs have completed
  503.  * @hwdev: device to sync
  504.  * @dma_handle: DMA address to sync
  505.  * @size: size of region
  506.  * @direction: DMA direction
  507.  *
  508.  * This routine is supposed to sync the DMA region specified
  509.  * by @dma_handle into the 'coherence domain'.  See sn_dma_sync()
  510.  * above for more information.   Also known as
  511.  * platform_pci_dma_sync_single() by the IA64 machvec code.
  512.  */
  513. void
  514. sn_pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction)
  515. {
  516. if (direction == PCI_DMA_NONE)
  517.                 BUG();
  518. sn_dma_sync(hwdev);
  519. }
  520. /**
  521.  * sn_pci_dma_sync_sg - make sure all DMAs have completed
  522.  * @hwdev: device to sync
  523.  * @sg: scatterlist to sync
  524.  * @nents: number of entries in the scatterlist
  525.  * @direction: DMA direction
  526.  *
  527.  * This routine is supposed to sync the DMA regions specified
  528.  * by @sg into the 'coherence domain'.  See sn_dma_sync()
  529.  * above for more information.   Also known as
  530.  * platform_pci_dma_sync_sg() by the IA64 machvec code.
  531.  */
  532. void
  533. sn_pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
  534. {
  535.         if (direction == PCI_DMA_NONE)
  536.                 BUG();
  537. sn_dma_sync(hwdev);
  538. }
  539. /**
  540.  * sn_dma_address - get the DMA address for the first entry of a scatterlist
  541.  * @sg: sg to look at
  542.  *
  543.  * Gets the DMA address for the scatterlist @sg.  Also known as
  544.  * platform_dma_address() by the IA64 machvec code.
  545.  */
  546. unsigned long
  547. sn_dma_address(struct scatterlist *sg)
  548. {
  549. return ((unsigned long)sg->address);
  550. }
  551. /**
  552.  * sn_dma_supported - test a DMA mask
  553.  * @hwdev: device to test
  554.  * @mask: DMA mask to test
  555.  *
  556.  * Return whether the given PCI device DMA address mask can be supported
  557.  * properly.  For example, if your device can only drive the low 24-bits
  558.  * during PCI bus mastering, then you would pass 0x00ffffff as the mask to
  559.  * this function.  Of course, SN only supports devices that have 32 or more
  560.  * address bits.
  561.  */
  562. int
  563. sn_pci_dma_supported(struct pci_dev *hwdev, u64 mask)
  564. {
  565. if (mask < 0xffffffff)
  566. return 0;
  567. return 1;
  568. }
  569. EXPORT_SYMBOL(sn_pci_unmap_single);
  570. EXPORT_SYMBOL(sn_pci_map_single);
  571. EXPORT_SYMBOL(sn_pci_dma_sync_single);
  572. EXPORT_SYMBOL(sn_pci_map_sg);
  573. EXPORT_SYMBOL(sn_pci_unmap_sg);
  574. EXPORT_SYMBOL(sn_pci_alloc_consistent);
  575. EXPORT_SYMBOL(sn_pci_free_consistent);
  576. EXPORT_SYMBOL(sn_dma_address);
  577. EXPORT_SYMBOL(sn_pci_dma_supported);