scatterlist.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _ASM_POWERPC_SCATTERLIST_H
  2. #define _ASM_POWERPC_SCATTERLIST_H
  3. /*
  4. * Copyright (C) 2001 PPC64 Team, IBM Corp
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifdef __KERNEL__
  12. #include <linux/types.h>
  13. #include <asm/dma.h>
  14. struct scatterlist {
  15. struct page *page;
  16. unsigned int offset;
  17. unsigned int length;
  18. /* For TCE support */
  19. dma_addr_t dma_address;
  20. u32 dma_length;
  21. };
  22. /*
  23. * These macros should be used after a dma_map_sg call has been done
  24. * to get bus addresses of each of the SG entries and their lengths.
  25. * You should only work with the number of sg entries pci_map_sg
  26. * returns, or alternatively stop on the first sg_dma_len(sg) which
  27. * is 0.
  28. */
  29. #define sg_dma_address(sg) ((sg)->dma_address)
  30. #ifdef __powerpc64__
  31. #define sg_dma_len(sg) ((sg)->dma_length)
  32. #else
  33. #define sg_dma_len(sg) ((sg)->length)
  34. #endif
  35. #ifdef __powerpc64__
  36. #define ISA_DMA_THRESHOLD (~0UL)
  37. #endif
  38. #endif /* __KERNEL__ */
  39. #endif /* _ASM_POWERPC_SCATTERLIST_H */