This source file includes following definitions.
- snd_seq_unused_cells
- snd_seq_total_cells
1
2
3
4
5
6 #ifndef __SND_SEQ_MEMORYMGR_H
7 #define __SND_SEQ_MEMORYMGR_H
8
9 #include <sound/seq_kernel.h>
10 #include <linux/poll.h>
11
12 struct snd_info_buffer;
13
14
15 struct snd_seq_event_cell {
16 struct snd_seq_event event;
17 struct snd_seq_pool *pool;
18 struct snd_seq_event_cell *next;
19 };
20
21
22
23
24
25
26 struct snd_seq_pool {
27 struct snd_seq_event_cell *ptr;
28 struct snd_seq_event_cell *free;
29
30 int total_elements;
31 atomic_t counter;
32
33 int size;
34 int room;
35
36 int closing;
37
38
39 int max_used;
40 int event_alloc_nopool;
41 int event_alloc_failures;
42 int event_alloc_success;
43
44
45 wait_queue_head_t output_sleep;
46
47
48 spinlock_t lock;
49 };
50
51 void snd_seq_cell_free(struct snd_seq_event_cell *cell);
52
53 int snd_seq_event_dup(struct snd_seq_pool *pool, struct snd_seq_event *event,
54 struct snd_seq_event_cell **cellp, int nonblock,
55 struct file *file, struct mutex *mutexp);
56
57
58 static inline int snd_seq_unused_cells(struct snd_seq_pool *pool)
59 {
60 return pool ? pool->total_elements - atomic_read(&pool->counter) : 0;
61 }
62
63
64 static inline int snd_seq_total_cells(struct snd_seq_pool *pool)
65 {
66 return pool ? pool->total_elements : 0;
67 }
68
69
70 int snd_seq_pool_init(struct snd_seq_pool *pool);
71
72
73 void snd_seq_pool_mark_closing(struct snd_seq_pool *pool);
74 int snd_seq_pool_done(struct snd_seq_pool *pool);
75
76
77 struct snd_seq_pool *snd_seq_pool_new(int poolsize);
78
79
80 int snd_seq_pool_delete(struct snd_seq_pool **pool);
81
82
83 int snd_seq_pool_poll_wait(struct snd_seq_pool *pool, struct file *file, poll_table *wait);
84
85 void snd_seq_info_pool(struct snd_info_buffer *buffer,
86 struct snd_seq_pool *pool, char *space);
87
88 #endif