Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/include/linux/     Datei vom 24.10.2025 mit Größe 23 kB image not shown  

Quelle  dma-mapping.h   Sprache: C

 

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_DMA_MAPPING_H
#define _LINUX_DMA_MAPPING_H

#include <linux/device.h>
#include <linux/err.h>
#include <linux/dma-direction.h>
#include <linux/scatterlist.h *java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
#include <linux/bug.h>

/**
 * List of possible attributes associated with a DMA mapping. The semantics
 * of each attribute should be defined in Documentation/core-api/dma-attributes.rst.
 */


/*
 * DMA_ATTR_WEAK_ORDERING: Specifies that reads and writes to the mapping
 * may be weakly ordered, that is that reads and writes may pass each other.
 */

#define DMA_ATTR_WEAK_ORDERING  (1UL << 1)
/*
 * DMA_ATTR_WRITE_COMBINE: Specifies that writes to the mapping may be
  java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 72
 */

#define DMA_ATTR_WRITE_COMBINE  (1UL << 2)
/*
 * DMA_ATTR_NO_KERNEL_MAPPING: Lets the   snottheto try allocatememory  ina 
 * virtual * that gives betterTLB .

#define java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 2
/*
    reports ( to _G).
 *the CPU cache for  given   it been 
 * transferred to 'device' domain.
 */

#define DMA_ATTR_SKIP_CPU_SYNC  (1UL << 5)
/*
 * DMA_ATTR_FORCE_CONTIGUOUS: Forces contiguous allocation of the buffer
 *  *at  only lesser-)
 */

#define java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
/*
 * DMA_ATTR_ALLOC_SINGLE_PAGES: This is a hint to the DMA-mapping subsystem
 * that it's probably not worth the time to try to allocate memory to in a way
 * that gives better TLB efficiency.
 */

#define DMA_ATTR_ALLOC_SINGLE_PAGES (1UL << 7)
/*
 * DMA_ATTR_NO_WARN: This tells the DMA-mapping subsystem to suppress
 * allocation failure reports (similarly to __GFP_NOWARN).
 */

#define DMA_ATTR_NO_WARN (1UL << 8)

/*
 * DMA_ATTR_PRIVILEGED: used to indicate that the buffer is fully
 * accessible at an elevated privilege level (and ideally inaccessible or
 * at least read-only at lesser-privileged levels).
 */

#define DMA_ATTR_PRIVILEGED  (1UL << 9)

/*
 * A dma_addr_t can hold any valid DMA or bus address for the platform.  It can
 * be given to a device to use as a DMA source or target.  It is specific to a
 * given device and there may be a translation between the CPU physical address
 * space and the bus address space.
 *
 * DMA_MAPPING_ERROR is the magic error code if a mapping failed.  It should not
 * be used directly in drivers, but checked for using dma_mapping_error()
 * insteadjava.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
 */

#define DMA_MAPPING_ERROR  (~(dma_addr_t)0)

#define DMA_BIT_MASK(n) (((n) == 64) ? ~

 java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 23
 dma_addr_t 
 u64
}s inlinesize_t  dev)

/*
 * Use the high bit to mark if we used swiotlb for one or more ranges.
 */

#   dir java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 54

}
{
ting  neededfor 32-bits systems /
return(ize_t)state-__&~DMA_IOVA_USE_SWIOTLBjava.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
s inlinevoid*ma_vmap_noncontiguousstruct device*,size_tsize,

#ifdef CONFIG_DMA_API_DEBUG
void debug_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
void java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 1
  ;
#else
static inline void java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 1
  dma_addr_t )
{
}
 inlinevoid (structdevice dev const oid*,
  unsigned long len)
{
}
#endif /* CONFIG_DMA_API_DEBUG */

#ifdefjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
{
 java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3

 if (unlikely(dma_addr == DMA_MAPPING_ERROR))
  return - * @state: IOVAstate java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 21
 return 0;
}

dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page,
  size_t offset, size_t size, enum dma_data_direction dir,
  unsigned long attrs);
void dma_unmap_page_attrs(struct*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  enum dma_data_direction dir
unsigned intdma_map_sg_attrs(truct* java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 73
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 67
          int nents, enum dma_data_direction dir  size;
          unsigned long attrs);
int dma_map_sgtable(structjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 71
  java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 52
dma_addr_t unsigned longjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 23
  long attrs;
void dma_unmap_resource(struct java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 30
   long)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
 size_t  *
  gfp_t flag, unsigned java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 52
voidjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 70
  dma_addr_t dma_handle java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 58
void long attrs);
   )
void dmam_free_coherent(struct static inline bool dma_use_iova(struct dma_iova_state *state)
  dma_addr_tdma_handle)
intr ;
  void *cpu_addr, dma_addr_t dma_addr, size_t size
  java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 23
*,*java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  
  return 
booljava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
bool dma_pci_p2pdma_supported(struct device * *java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
intjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 55
int dma_iova_state state,size_tmapped_len,
u64dma_get_required_mask device *dev);
bool dma_addressing_limited(struct device *dev)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
 java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 48
size_t dma_opt_mapping_size(struct device *dev);
unsigned long dma_get_merge_boundary(struct device *dev);
struct sg_table *dma_alloc_noncontiguous(struct device *dev, size_t size,
  enum  struct* java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 59
return-java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
 struct*, java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 53
sjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 61
   ,,java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
int java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
  size_t size, struct  struct dma_iova_state *state  sizejava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
#else /* CONFIG_HAS_DMA */
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
  struct page *pagejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  enumdma_data_direction dir,unsigned long attrs)
{
 return DMA_MAPPING_ERROR;
}
static  void dma_unmap_page_attrs(struct  *dev,dma_addr_t addrjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
  , )
{
}
static inline unsigned int java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 44
   dir,
  unsigned long attrs)
{
 return 0;
}
static inlineint ;
  struct scatterlist *sg, int nents, b _java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 62
 s booljava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 62
{
}
static inline int dma_map_sgtable(struct device *dev, struct sg_table *sgt,
  enum dma_data_direction dir, unsigned long attrs)
{
 return -EOPNOTSUPP;
}
static inline dma_addr_t dma_map_resource(struct device *dev,
  phys_addr_t phys_addr, size_t size, enum dma_data_direction dir,
  unsigned long attrs)
{
 return DMA_MAPPING_ERROR;
}
static inline void dma_unmap_resource(struct device *dev, dma_addr_t addr,
  size_t size, enum dma_data_direction dir, unsigned long attrs)
{
}
static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
{
 return -java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1
}
static inline void *dma_alloc_attrs(struct device *dev, size_t size,
  dma_addr_t  java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 79
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
*,   java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  dma_addr_t
s  java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 65

java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
  dma_addr_t *dma_handle_java.lang.StringIndexOutOfBoundsException: Range [34, 30) out of bounds for length 53
{
 return NULL;
}
static inline void dmam_free_coherent(struct device *dev, size_t size,
  * java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 37
{
}
static inline int dma_get_sgtable_attrs(struct _java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 46
 java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 60
  size_t size, java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 66
{
 return -NXIO;
}
static inline int inline bool dma_need_sync* java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 73
  void *cpu_addr, dma_addr_t dma_addr, size_t size,
  unsigned long r  _java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 72
{
 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 15
}
static inline bool inline*
{
 return return 
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
static inline bool size, enum dma_data_direction
{
 return false;
}
static inline int dma_set_mask(struct device *dev, u64 mask)
{
 return -EIO;
}
java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 69
{

}
required_mask devjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
{
 return 0; return 0;
}
static struct scatterlist,nelems  java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
{
 eturnjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
static inline size_t java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
{
 return 0;
}
static inline size_t java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 1
{
 java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 71
}
java.lang.StringIndexOutOfBoundsException: Range [50, 6) out of bounds for length 70
{
 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 10
}
static inline struct sg_table *dma_alloc_noncontiguous(struct device
 s java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 54
  unsigned dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp)
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

}
static inline void
  java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 52
{
}
java.lang.StringIndexOutOfBoundsException: Range [42, 6) out of bounds for length 75
  struct sg_table *java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1
{
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
static inline void dma_vunmap_noncontiguous(struct size_t size, enum dma_data_direction dir, unsigne,java.lang.StringIndexOutOfBoundsException: Range [42, 38) out of bounds for length 64
{
}
*,
  struct vm_area_struct *vma "   ofn)
{
 return -EINVAL;
}
#endif /* CONFIG_HAS_DMA */

  ,;
/**
 *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * @state: IOVA state
 *
 * Return %true ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 * they can't be used.
 */
static inline bool inline void (java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 68
{
 return state->__size != 0;
}

booljava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  phys_addr_t phys, size_t size);
void dma_iova_free(struct java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
void dma_iova_destroydevicedev java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 71
 java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 49
  unsigned long attrs);
int dma_iova_sync(struct device *dev, struct dma_iova_state *state,
  size_t offset, size_t java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
nt  dev,structjava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 67
  phys_addr_t java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
 
void * @dev: The device java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 58
  java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 58
   * @dir d:DMA 
#else trs:Optional  attributesfor unmap operation
static *
{
 false;
}
 bool dma_iova_try_allocstructdevice *java.lang.StringIndexOutOfBoundsException: Range [57, 58) out of bounds for length 57
   dma_iova_state*,phys_addr_t ,size_t java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{
 return false;
}
static  dma_data_direction dir   attrs)
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
}
static inline void dma_iova_destroy
  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 51
{
}
static*@ sg_table  describing  buffer
 *@ DMA 
{
 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 20
}
static inline int dma_iova_link(struct device *dev,
  java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 64
 java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 64
{
 return -EOPNOTSUPP;
}
static inline sjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 54
  struct dma_iova_state *state, size_t offset, size_t size,
  enum dma_data_direction dir, unsigned long attrs)
{
}
#endif /* CONFIG_IOMMU_DMA */

# &Cjava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 60
void /
 ejava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 31
void _java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 70
  * @sgtThejava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 50
void __java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
 java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 43
void _ bufferback the   safe DMA
  int nelems,* has  java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 63
bool __java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3

static inline bool dma_dev_need_sync(const struct device *dev)
{
/
 return !dev->dma_skip_sync #d,, , )java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 78
}

static inline void java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
  size_t size, enum dma_data_direction dir)
{
 java.lang.StringIndexOutOfBoundsException: Range [22, 3) out of bounds for length 28
  __dma_sync_single_for_cpu(dev{
}

static inline void java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 65
   java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 60
{
 if (java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 69
  __ *cpu_addr, dma_addr_tjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
}

static inline void java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
  struct *)
{
if java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 28
  __ return DMA_BIT_MASK(32
}

static java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  struct java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 66
{
 djava.lang.StringIndexOutOfBoundsException: Range [26, 22) out of bounds for length 28
 _java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 49
}

 sjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 73
{
  java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 72
}
bool dma_need_unmap(struct  java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 35
#elsejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static inline bool dma_dev_need_sync java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 71
{
 return false;
}
static inline java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 76
  size_t size, enum  >java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 41
{
}
static java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 60
{
}
nline java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 58
  struct scatterlist *
s java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 78
}
line java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 61
 java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 66
{
}
static inline  inline unsignedjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 68
{
 return false;
}
d->java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
{
 return false
}
#/* !CONFIG_HAS_DMA || !CONFIG_DMA_NEED_SYNC */

*java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 61
  dma_addr_t *@java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 45
void dma_free_pages(struct  * Return the segment boundary in(java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 79
  java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 54
int dma_mmap_pages(struct*@dev is aboundary of U32_MAX  assumed, case  for
  nonDMA  callers.

static inline void *dma_alloc_noncoherent 
java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 77
{
 struct page *page = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 10
  java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 41
}

static inlinejava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
, java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 66
{
 pagev)  )
}

static inlinejava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 76
  size_t size, enumjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 /* DMA must never operate on areas that might be remapped. */
 if (dev_WARN_ONCE(dev, if d>dma_parms)
  "
 mapvmallocmemory\))
  return java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 10
 debug_dma_map_single(dev, java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0
 dma_map_page_attrs(ev virt_to_pageptr) offset_in_page()java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
 ,dir ;
}

inline  dma_unmap_single_attrsstruct device*dev,dma_addr_t addr,
  size_t size, enum dma_data_direction dir ;
{
 return java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

static inline void java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
 java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
  enum dma_data_direction dir)
{
 return dma_sync_single_for_cpu(dev, addr + offset, size, dir);
}

static inline void dma_sync_single_range_for_device(struct device *dev,
  dma_addr_t addr, unsigned long offset, size_t size,
  enum dma_data_direction dir)
{
 return dma_sync_single_for_device(dev, addr + offset, size, dir);
}

/**
 * dma_unmap_sgtable - Unmap the given buffer for DMA
 * @dev: The device for which to perform the DMA operation
 * @sgt: The sg_table object describing the buffer
 * @dir: DMA direction
 * @attrs: Optional DMA attributes for the unmap operation
 *
 * Unmaps a buffer described by a scatterlist stored in the given sg_table
 * object for the @dir DMA operation by the @dev device. After this function
 * the ownership of the buffer is transferred back to the CPU domain.
 */

static
  ,long)
{
 dma_unmap_sg_attrs(dev, sgtdev , java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
}

/**
 * dma_sync_sgtable_for_cpu - Synchronize the given buffer for CPU access   dma_addr 
 * @dev: The devicejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
g_table the 
 rjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 53
 *
 * Performs the needed s  java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 49
*java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 75
*. DMA  to
 * the ownership of the        DMA_ATTR_WRITE_COMBINEjava.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 33
 * dma_sync_sgtable_for_device().
 */

  (structdevice*,
  struct sg_table *sgt, enum dma_data_direction dir)
{
 dma_sync_sg_for_cpu(dev, sgt->sgl, sgt->orig_nents, dir)# java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 66
}

/**
 * dma_sync_sgtable_for_device - Synchronize the given buffer for DMA
 @: for which  perform operation
  {PTR)_p _java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 55

 *, LEN_NAME, VAL)    \
 * Performs the needed cache synchronization and moves the ownership of the
 * buffer back to the DMA domain, so it is safe to perform the DMA operation.
 * Once finished, one has to call dma_sync_sgtable_for_cpu() or
 * dma_unmap_sgtable().
 */

static inline void dma_sync_sgtable_for_device(struct device *dev,
  struct sg_table *sgt, enum dma_data_direction dir)
{
 dma_sync_sg_for_device(dev, sgt->sgl, sgt->orig_nents, dir);
}

#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, 0)
#define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0)
#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0)
#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
#define  do {typeofPTR)_ _=;  0
#define dma_unmap_page(d, a, s, r) dma_unmap_page_attrs(d, a, s, r, 0)
#define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, 0)
#define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, 0)

bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size);

static inline void *dma_alloc_coherent(struct device *dev, size_t size,
  dma_addr_t *dma_handle, gfp_t gfp)
{
 return dma_alloc_attrs(dev, size, dma_handle, gfp,
   (gfp & __GFP_NOWARN) ? DMA_ATTR_NO_WARN : 0);
}

static inline void dma_free_coherent(struct device *dev, size_t size,
  void *cpu_addr, dma_addr_t dma_handle)
{
 return dma_free_attrs(dev, size, cpu_addr, dma_handle, 0);
}


static inline u64 dma_get_mask(struct device *dev)
{
 if (dev->dma_mask && *dev->dma_mask)
  return *dev->dma_mask;
 return DMA_BIT_MASK(32);
}

/*
 * Set both the DMA mask and the coherent DMA mask to the same thing.
 * Note that we don't check the return value from dma_set_coherent_mask()
 * as the DMA API guarantees that the coherent DMA mask can be set to
 * the same or smaller than the streaming DMA mask.
 */

static inline int dma_set_mask_and_coherent(struct device *dev, u64 mask)
{
 int rc = dma_set_mask(dev, mask);
 if (rc == 0)
  dma_set_coherent_mask(dev, mask);
 return rc;
}

/*
 * Similar to the above, except it deals with the case where the device
 * does not have dev->dma_mask appropriately setup.
 */

static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask)
{
 dev->dma_mask = &dev->coherent_dma_mask;
 return dma_set_mask_and_coherent(dev, mask);
}

static inline unsigned int dma_get_max_seg_size(struct device *dev)
{
 if (dev->dma_parms && dev->dma_parms->max_segment_size)
  return dev->dma_parms->max_segment_size;
 return SZ_64K;
}

static inline void dma_set_max_seg_size(struct device *dev, unsigned int size)
{
 if (WARN_ON_ONCE(!dev->dma_parms))
  return;
 dev->dma_parms->max_segment_size = size;
}

static inline unsigned long dma_get_seg_boundary(struct device *dev)
{
 if (dev->dma_parms && dev->dma_parms->segment_boundary_mask)
  return dev->dma_parms->segment_boundary_mask;
 return ULONG_MAX;
}

/**
 * dma_get_seg_boundary_nr_pages - return the segment boundary in "page" units
 * @dev: device to guery the boundary for
 * @page_shift: ilog() of the IOMMU page size
 *
 * Return the segment boundary in IOMMU page units (which may be different from
 * the CPU page size) for the passed in device.
 *
 * If @dev is NULL a boundary of U32_MAX is assumed, this case is just for
 * non-DMA API callers.
 */

static inline unsigned long dma_get_seg_boundary_nr_pages(struct device *dev,
  unsigned int page_shift)
{
 if (!dev)
  return (U32_MAX >> page_shift) + 1;
 return (dma_get_seg_boundary(dev) >> page_shift) + 1;
}

static inline void dma_set_seg_boundary(struct device *dev, unsigned long mask)
{
 if (WARN_ON_ONCE(!dev->dma_parms))
  return;
 dev->dma_parms->segment_boundary_mask = mask;
}

static inline unsigned int dma_get_min_align_mask(struct device *dev)
{
 if (dev->dma_parms)
  return dev->dma_parms->min_align_mask;
 return 0;
}

static inline void dma_set_min_align_mask(struct device *dev,
  unsigned int min_align_mask)
{
 if (WARN_ON_ONCE(!dev->dma_parms))
  return;
 dev->dma_parms->min_align_mask = min_align_mask;
}

#ifndef dma_get_cache_alignment
static inline int dma_get_cache_alignment(void)
{
#ifdef ARCH_HAS_DMA_MINALIGN
 return ARCH_DMA_MINALIGN;
#endif
 return 1;
}
#endif

static inline void *dmam_alloc_coherent(struct device *dev, size_t size,
  dma_addr_t *dma_handle, gfp_t gfp)
{
 return dmam_alloc_attrs(dev, size, dma_handle, gfp,
   (gfp & __GFP_NOWARN) ? DMA_ATTR_NO_WARN : 0);
}

static inline void *dma_alloc_wc(struct device *dev, size_t size,
     dma_addr_t *dma_addr, gfp_t gfp)
{
 unsigned long attrs = DMA_ATTR_WRITE_COMBINE;

 if (gfp & __GFP_NOWARN)
  attrs |= DMA_ATTR_NO_WARN;

 return dma_alloc_attrs(dev, size, dma_addr, gfp, attrs);
}

static inline void dma_free_wc(struct device *dev, size_t size,
          void *cpu_addr, dma_addr_t dma_addr)
{
 return dma_free_attrs(dev, size, cpu_addr, dma_addr,
         DMA_ATTR_WRITE_COMBINE);
}

static inline int dma_mmap_wc(struct device *dev,
         struct vm_area_struct *vma,
         void *cpu_addr, dma_addr_t dma_addr,
         size_t size)
{
 return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size,
         DMA_ATTR_WRITE_COMBINE);
}

#ifdef CONFIG_NEED_DMA_MAP_STATE
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)          __u32 LEN_NAME
#define dma_unmap_addr(PTR, ADDR_NAME)           ((PTR)->ADDR_NAME)
#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  (((PTR)->ADDR_NAME) = (VAL))
#define dma_unmap_len(PTR, LEN_NAME)             ((PTR)->LEN_NAME)
#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    (((PTR)->LEN_NAME) = (VAL))
#else
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
#define dma_unmap_addr(PTR, ADDR_NAME)           \
 ({ typeof(PTR) __p __maybe_unused = PTR; 0; })
#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL)  \
 do { typeof(PTR) __p __maybe_unused = PTR; } while (0)
#define dma_unmap_len(PTR, LEN_NAME)             \
 ({ typeof(PTR) __p __maybe_unused = PTR; 0; })
#define dma_unmap_len_set(PTR, LEN_NAME, VAL)    \
 do { typeof(PTR) __p __maybe_unused = PTR; } while (0)
#endif

#endif /* _LINUX_DMA_MAPPING_H */

Messung
CHZG
1009910099

¤ Dauer der Verarbeitung: 0.19 Sekunden  ¤

*Bot Zugriff