mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
a202bd1ad8
This patch moves the mmap handling code into the common memalloc handler. It allows us to reduce the memory-type specific code in PCM code gracefully. Link: https://lore.kernel.org/r/20210609162551.7842-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
20 lines
666 B
C
20 lines
666 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
#ifndef __MEMALLOC_LOCAL_H
|
|
#define __MEMALLOC_LOCAL_H
|
|
|
|
struct snd_malloc_ops {
|
|
int (*alloc)(struct snd_dma_buffer *dmab, size_t size);
|
|
void (*free)(struct snd_dma_buffer *dmab);
|
|
dma_addr_t (*get_addr)(struct snd_dma_buffer *dmab, size_t offset);
|
|
struct page *(*get_page)(struct snd_dma_buffer *dmab, size_t offset);
|
|
unsigned int (*get_chunk_size)(struct snd_dma_buffer *dmab,
|
|
unsigned int ofs, unsigned int size);
|
|
int (*mmap)(struct snd_dma_buffer *dmab, struct vm_area_struct *area);
|
|
};
|
|
|
|
#ifdef CONFIG_SND_DMA_SGBUF
|
|
extern const struct snd_malloc_ops snd_dma_sg_ops;
|
|
#endif
|
|
|
|
#endif /* __MEMALLOC_LOCAL_H */
|