Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
trident_memory.c File Reference
#include <asm/io.h>
#include <linux/pci.h>
#include <linux/time.h>
#include <linux/mutex.h>
#include <sound/core.h>
#include "trident.h"

Go to the source code of this file.

Macros

#define __set_tlb_bus(trident, page, ptr, addr)
 
#define __tlb_to_ptr(trident, page)   (void*)((trident)->tlb.shadow_entries[page])
 
#define __tlb_to_addr(trident, page)   (dma_addr_t)le32_to_cpu((trident->tlb.entries[page]) & ~(SNDRV_TRIDENT_PAGE_SIZE - 1))
 
#define UNIT_PAGES   (PAGE_SIZE / SNDRV_TRIDENT_PAGE_SIZE)
 
#define ALIGN_PAGE_SIZE   (SNDRV_TRIDENT_PAGE_SIZE * UNIT_PAGES)
 
#define MAX_ALIGN_PAGES   (SNDRV_TRIDENT_MAX_PAGES / UNIT_PAGES)
 
#define get_aligned_page(offset)   ((offset) / ALIGN_PAGE_SIZE)
 
#define aligned_page_offset(page)   ((page) * ALIGN_PAGE_SIZE)
 
#define page_to_ptr(trident, page)   __tlb_to_ptr(trident, (page) * UNIT_PAGES)
 
#define page_to_addr(trident, page)   __tlb_to_addr(trident, (page) * UNIT_PAGES)
 
#define firstpg(blk)   (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->first_page)
 
#define lastpg(blk)   (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->last_page)
 

Functions

struct snd_util_memblksnd_trident_alloc_pages (struct snd_trident *trident, struct snd_pcm_substream *substream)
 
int snd_trident_free_pages (struct snd_trident *trident, struct snd_util_memblk *blk)
 

Macro Definition Documentation

#define __set_tlb_bus (   trident,
  page,
  ptr,
  addr 
)
Value:
do { (trident)->tlb.entries[page] = cpu_to_le32((addr) & ~(SNDRV_TRIDENT_PAGE_SIZE-1)); \
(trident)->tlb.shadow_entries[page] = (ptr); } while (0)

Definition at line 37 of file trident_memory.c.

#define __tlb_to_addr (   trident,
  page 
)    (dma_addr_t)le32_to_cpu((trident->tlb.entries[page]) & ~(SNDRV_TRIDENT_PAGE_SIZE - 1))

Definition at line 42 of file trident_memory.c.

#define __tlb_to_ptr (   trident,
  page 
)    (void*)((trident)->tlb.shadow_entries[page])

Definition at line 40 of file trident_memory.c.

#define ALIGN_PAGE_SIZE   (SNDRV_TRIDENT_PAGE_SIZE * UNIT_PAGES)

Definition at line 89 of file trident_memory.c.

#define aligned_page_offset (   page)    ((page) * ALIGN_PAGE_SIZE)

Definition at line 97 of file trident_memory.c.

#define firstpg (   blk)    (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->first_page)

Definition at line 133 of file trident_memory.c.

#define get_aligned_page (   offset)    ((offset) / ALIGN_PAGE_SIZE)

Definition at line 96 of file trident_memory.c.

#define lastpg (   blk)    (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->last_page)

Definition at line 134 of file trident_memory.c.

#define MAX_ALIGN_PAGES   (SNDRV_TRIDENT_MAX_PAGES / UNIT_PAGES)

Definition at line 90 of file trident_memory.c.

#define page_to_addr (   trident,
  page 
)    __tlb_to_addr(trident, (page) * UNIT_PAGES)

Definition at line 99 of file trident_memory.c.

#define page_to_ptr (   trident,
  page 
)    __tlb_to_ptr(trident, (page) * UNIT_PAGES)

Definition at line 98 of file trident_memory.c.

#define UNIT_PAGES   (PAGE_SIZE / SNDRV_TRIDENT_PAGE_SIZE)

Definition at line 88 of file trident_memory.c.

Function Documentation

struct snd_util_memblk* snd_trident_alloc_pages ( struct snd_trident trident,
struct snd_pcm_substream substream 
)
read

Definition at line 282 of file trident_memory.c.

int snd_trident_free_pages ( struct snd_trident trident,
struct snd_util_memblk blk 
)

Definition at line 297 of file trident_memory.c.