• Takashi Iwai's avatar
    ALSA: core: Abstract memory alloc helpers · 37af81c5
    Takashi Iwai authored
    This patch introduces the ops table to each memory allocation type
    (SNDRV_DMA_TYPE_XXX) and abstract the handling for the better code
    management.  Then we get separate the page allocation, release and
    other tasks for each type, especially for the SG buffer.
    
    Each buffer type has now callbacks in the struct snd_malloc_ops, and
    the common helper functions call those ops accordingly.  The former
    inline code that is specific to SG-buffer is moved into the local
    sgbuf.c, and we can simplify the PCM code without details of memory
    handling.
    
    Link: https://lore.kernel.org/r/20210609162551.7842-4-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    37af81c5
pcm_local.h 2.74 KB