Contents of /alx-src/tags/kernel26-2.6.12-alx-r9/include/sound/util_mem.h
Parent Directory | Revision Log
Revision 628 -
(show annotations)
(download)
Wed Mar 4 10:48:58 2009 UTC (15 years, 3 months ago) by niro
Original Path: alx-src/trunk/kernel26-alx/linux/include/sound/util_mem.h
File MIME type: text/plain
File size: 2352 byte(s)
Wed Mar 4 10:48:58 2009 UTC (15 years, 3 months ago) by niro
Original Path: alx-src/trunk/kernel26-alx/linux/include/sound/util_mem.h
File MIME type: text/plain
File size: 2352 byte(s)
import linux sources based on 2.6.12-alx-r9: -using linux-2.6.12.6 -using 2.6.12-ck6 patch set -using fbsplash-0.9.2-r3 -using vesafb-tng-0.9-rc7 -using squashfs-2.2 -added cddvd-cmdfilter-drop.patch as ck dropped it -added via-epia-dri (cle266) patch -added zd1211-svn-32 wlan driver (http://zd1211.ath.cx/download/) -added debian patches to zd1211 for wep256 etc
1 | #ifndef __SOUND_UTIL_MEM_H |
2 | #define __SOUND_UTIL_MEM_H |
3 | /* |
4 | * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> |
5 | * |
6 | * Generic memory management routines for soundcard memory allocation |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ |
22 | |
23 | typedef struct snd_util_memblk snd_util_memblk_t; |
24 | typedef struct snd_util_memhdr snd_util_memhdr_t; |
25 | typedef unsigned int snd_util_unit_t; |
26 | |
27 | /* |
28 | * memory block |
29 | */ |
30 | struct snd_util_memblk { |
31 | snd_util_unit_t size; /* size of this block */ |
32 | snd_util_unit_t offset; /* zero-offset of this block */ |
33 | struct list_head list; /* link */ |
34 | }; |
35 | |
36 | #define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(snd_util_memblk_t)) |
37 | |
38 | /* |
39 | * memory management information |
40 | */ |
41 | struct snd_util_memhdr { |
42 | snd_util_unit_t size; /* size of whole data */ |
43 | struct list_head block; /* block linked-list header */ |
44 | int nblocks; /* # of allocated blocks */ |
45 | snd_util_unit_t used; /* used memory size */ |
46 | int block_extra_size; /* extra data size of chunk */ |
47 | struct semaphore block_mutex; /* lock */ |
48 | }; |
49 | |
50 | /* |
51 | * prototypes |
52 | */ |
53 | snd_util_memhdr_t *snd_util_memhdr_new(int memsize); |
54 | void snd_util_memhdr_free(snd_util_memhdr_t *hdr); |
55 | snd_util_memblk_t *snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); |
56 | int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); |
57 | int snd_util_mem_avail(snd_util_memhdr_t *hdr); |
58 | |
59 | /* functions without mutex */ |
60 | snd_util_memblk_t *__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); |
61 | void __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); |
62 | snd_util_memblk_t *__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, struct list_head *prev); |
63 | |
64 | #endif /* __SOUND_UTIL_MEM_H */ |