mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 09:56:40 +07:00
1ef04370d8
There are more architectures that don't support ARCH_HAS_SG_CHAIN than those that support it. This removes removes ARCH_HAS_SG_CHAIN in asm-generic/scatterlist.h and lets arhictectures to define it. It's clearer than defining ARCH_HAS_SG_CHAIN asm-generic/scatterlist.h and undefing it in arhictectures that don't support it. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
35 lines
845 B
C
35 lines
845 B
C
#ifndef __ASM_GENERIC_SCATTERLIST_H
|
|
#define __ASM_GENERIC_SCATTERLIST_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct scatterlist {
|
|
#ifdef CONFIG_DEBUG_SG
|
|
unsigned long sg_magic;
|
|
#endif
|
|
unsigned long page_link;
|
|
unsigned int offset;
|
|
unsigned int length;
|
|
dma_addr_t dma_address;
|
|
#ifdef CONFIG_NEED_SG_DMA_LENGTH
|
|
unsigned int dma_length;
|
|
#endif
|
|
};
|
|
|
|
/*
|
|
* These macros should be used after a dma_map_sg call has been done
|
|
* to get bus addresses of each of the SG entries and their lengths.
|
|
* You should only work with the number of sg entries pci_map_sg
|
|
* returns, or alternatively stop on the first sg_dma_len(sg) which
|
|
* is 0.
|
|
*/
|
|
#define sg_dma_address(sg) ((sg)->dma_address)
|
|
|
|
#ifdef CONFIG_NEED_SG_DMA_LENGTH
|
|
#define sg_dma_len(sg) ((sg)->dma_length)
|
|
#else
|
|
#define sg_dma_len(sg) ((sg)->length)
|
|
#endif
|
|
|
|
#endif /* __ASM_GENERIC_SCATTERLIST_H */
|