~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/pci/ctxfi/ctvmem.h

Version: ~ [ linux-5.10-rc5 ] ~ [ linux-5.9.10 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.79 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.159 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.208 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.245 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.245 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**
  2  * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
  3  *
  4  * This source file is released under GPL v2 license (no other versions).
  5  * See the COPYING file included in the main directory of this source
  6  * distribution for the license terms and conditions.
  7  *
  8  * @File    ctvmem.h
  9  *
 10  * @Brief
 11  * This file contains the definition of virtual memory management object
 12  * for card device.
 13  *
 14  * @Author Liu Chun
 15  * @Date Mar 28 2008
 16  */
 17 
 18 #ifndef CTVMEM_H
 19 #define CTVMEM_H
 20 
 21 #define CT_PTP_NUM      4       /* num of device page table pages */
 22 
 23 #include <linux/mutex.h>
 24 #include <linux/list.h>
 25 #include <linux/pci.h>
 26 #include <sound/memalloc.h>
 27 
 28 /* The chip can handle the page table of 4k pages
 29  * (emu20k1 can handle even 8k pages, but we don't use it right now)
 30  */
 31 #define CT_PAGE_SIZE    4096
 32 #define CT_PAGE_SHIFT   12
 33 #define CT_PAGE_MASK    (~(PAGE_SIZE - 1))
 34 #define CT_PAGE_ALIGN(addr)     ALIGN(addr, CT_PAGE_SIZE)
 35 
 36 struct ct_vm_block {
 37         unsigned int addr;      /* starting logical addr of this block */
 38         unsigned int size;      /* size of this device virtual mem block */
 39         struct list_head list;
 40 };
 41 
 42 struct snd_pcm_substream;
 43 
 44 /* Virtual memory management object for card device */
 45 struct ct_vm {
 46         struct snd_dma_buffer ptp[CT_PTP_NUM];  /* Device page table pages */
 47         unsigned int size;              /* Available addr space in bytes */
 48         struct list_head unused;        /* List of unused blocks */
 49         struct list_head used;          /* List of used blocks */
 50         struct mutex lock;
 51 
 52         /* Map host addr (kmalloced/vmalloced) to device logical addr. */
 53         struct ct_vm_block *(*map)(struct ct_vm *, struct snd_pcm_substream *,
 54                                    int size);
 55         /* Unmap device logical addr area. */
 56         void (*unmap)(struct ct_vm *, struct ct_vm_block *block);
 57         dma_addr_t (*get_ptp_phys)(struct ct_vm *vm, int index);
 58 };
 59 
 60 int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci);
 61 void ct_vm_destroy(struct ct_vm *vm);
 62 
 63 #endif /* CTVMEM_H */
 64 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp