diff options
Diffstat (limited to 'sound/core/seq/seq_memory.h')
-rw-r--r-- | sound/core/seq/seq_memory.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/sound/core/seq/seq_memory.h b/sound/core/seq/seq_memory.h index 6c4dde5d3d6f..39c60d9e1efc 100644 --- a/sound/core/seq/seq_memory.h +++ b/sound/core/seq/seq_memory.h @@ -24,23 +24,21 @@ #include <sound/seq_kernel.h> #include <linux/poll.h> -typedef struct pool pool_t; - /* container for sequencer event (internal use) */ -typedef struct snd_seq_event_cell_t { - snd_seq_event_t event; - pool_t *pool; /* used pool */ - struct snd_seq_event_cell_t *next; /* next cell */ -} snd_seq_event_cell_t; +struct snd_seq_event_cell { + struct snd_seq_event event; + struct snd_seq_pool *pool; /* used pool */ + struct snd_seq_event_cell *next; /* next cell */ +}; /* design note: the pool is a contigious block of memory, if we dynamicly want to add additional cells to the pool be better store this in another pool as we need to know the base address of the pool when releasing memory. */ -struct pool { - snd_seq_event_cell_t *ptr; /* pointer to first event chunk */ - snd_seq_event_cell_t *free; /* pointer to the head of the free list */ +struct snd_seq_pool { + struct snd_seq_event_cell *ptr; /* pointer to first event chunk */ + struct snd_seq_event_cell *free; /* pointer to the head of the free list */ int total_elements; /* pool size actually allocated */ atomic_t counter; /* cells free */ @@ -63,33 +61,34 @@ struct pool { spinlock_t lock; }; -extern void snd_seq_cell_free(snd_seq_event_cell_t* cell); +void snd_seq_cell_free(struct snd_seq_event_cell *cell); -int snd_seq_event_dup(pool_t *pool, snd_seq_event_t *event, snd_seq_event_cell_t **cellp, int nonblock, struct file *file); +int snd_seq_event_dup(struct snd_seq_pool *pool, struct snd_seq_event *event, + struct snd_seq_event_cell **cellp, int nonblock, struct file *file); /* return number of unused (free) cells */ -static inline int snd_seq_unused_cells(pool_t *pool) +static inline int snd_seq_unused_cells(struct snd_seq_pool *pool) { return pool ? pool->total_elements - atomic_read(&pool->counter) : 0; } /* return total number of allocated cells */ -static inline int snd_seq_total_cells(pool_t *pool) +static inline int snd_seq_total_cells(struct snd_seq_pool *pool) { return pool ? pool->total_elements : 0; } /* init pool - allocate events */ -int snd_seq_pool_init(pool_t *pool); +int snd_seq_pool_init(struct snd_seq_pool *pool); /* done pool - free events */ -int snd_seq_pool_done(pool_t *pool); +int snd_seq_pool_done(struct snd_seq_pool *pool); /* create pool */ -pool_t *snd_seq_pool_new(int poolsize); +struct snd_seq_pool *snd_seq_pool_new(int poolsize); /* remove pool */ -int snd_seq_pool_delete(pool_t **pool); +int snd_seq_pool_delete(struct snd_seq_pool **pool); /* init memory */ int snd_sequencer_memory_init(void); @@ -98,7 +97,7 @@ int snd_sequencer_memory_init(void); void snd_sequencer_memory_done(void); /* polling */ -int snd_seq_pool_poll_wait(pool_t *pool, struct file *file, poll_table *wait); +int snd_seq_pool_poll_wait(struct snd_seq_pool *pool, struct file *file, poll_table *wait); #endif |