22 #include <linux/time.h>
23 #include <linux/slab.h>
63 snd_printd(
"oops: malloc failed for snd_seq_prioq_new()\n");
82 snd_printd(
"oops: snd_seq_prioq_delete() called with NULL prioq\n");
120 static inline int compare_timestamp_rel(
struct snd_seq_event *a,
167 if (f->
tail && !prior) {
168 if (compare_timestamp(&cell->
event, &f->
tail->event)) {
170 f->
tail->next = cell;
174 spin_unlock_irqrestore(&f->
lock, flags);
185 while (cur !=
NULL) {
187 int rel = compare_timestamp_rel(&cell->
event, &cur->
event);
191 else if (rel == 0 && prior)
199 spin_unlock_irqrestore(&f->
lock, flags);
215 spin_unlock_irqrestore(&f->
lock, flags);
226 snd_printd(
"oops: snd_seq_prioq_cell_in() called with NULL prioq\n");
243 spin_unlock_irqrestore(&f->
lock, flags);
251 snd_printd(
"oops: snd_seq_prioq_cell_in() called with NULL prioq\n");
262 snd_printd(
"oops: snd_seq_prioq_cell_in() called with NULL prioq\n");
272 if (cell->
event.source.client == client ||
273 cell->
event.dest.client == client)
279 if (cell->
event.time.tick)
283 if (cell->
event.time.time.tv_sec ||
284 cell->
event.time.time.tv_nsec)
304 if (prioq_match(cell, client, timestamp)) {
306 if (cell == f->
head) {
316 if (freefirst ==
NULL) {
319 freeprev->
next = cell;
327 cell->
event.source.client,
328 cell->
event.dest.client,
335 spin_unlock_irqrestore(&f->
lock, flags);
339 freenext = freefirst->
next;
341 freefirst = freenext;
351 if (ev->
dest.client != info->
dest.client ||
356 if (! snd_seq_ev_is_channel_type(ev))
415 if (cell->
event.source.client == client &&
416 prioq_remove_match(info, &cell->
event)) {
419 if (cell == f->
head) {
431 if (freefirst ==
NULL) {
434 freeprev->
next = cell;
443 spin_unlock_irqrestore(&f->
lock, flags);
447 freenext = freefirst->
next;
449 freefirst = freenext;