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

TOMOYO Linux Cross Reference
Linux/sound/core/seq/seq_queue.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  *   ALSA sequencer Queue handling
  4  *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  5  */
  6 #ifndef __SND_SEQ_QUEUE_H
  7 #define __SND_SEQ_QUEUE_H
  8 
  9 #include "seq_memory.h"
 10 #include "seq_prioq.h"
 11 #include "seq_timer.h"
 12 #include "seq_lock.h"
 13 #include <linux/interrupt.h>
 14 #include <linux/list.h>
 15 #include <linux/bitops.h>
 16 
 17 #define SEQ_QUEUE_NO_OWNER (-1)
 18 
 19 struct snd_seq_queue {
 20         int queue;              /* queue number */
 21 
 22         char name[64];          /* name of this queue */
 23 
 24         struct snd_seq_prioq    *tickq;         /* midi tick event queue */
 25         struct snd_seq_prioq    *timeq;         /* real-time event queue */     
 26         
 27         struct snd_seq_timer *timer;    /* time keeper for this queue */
 28         int     owner;          /* client that 'owns' the timer */
 29         bool    locked;         /* timer is only accesibble by owner if set */
 30         bool    klocked;        /* kernel lock (after START) */
 31         bool    check_again;    /* concurrent access happened during check */
 32         bool    check_blocked;  /* queue being checked */
 33 
 34         unsigned int flags;             /* status flags */
 35         unsigned int info_flags;        /* info for sync */
 36 
 37         spinlock_t owner_lock;
 38         spinlock_t check_lock;
 39 
 40         /* clients which uses this queue (bitmap) */
 41         DECLARE_BITMAP(clients_bitmap, SNDRV_SEQ_MAX_CLIENTS);
 42         unsigned int clients;   /* users of this queue */
 43         struct mutex timer_mutex;
 44 
 45         snd_use_lock_t use_lock;
 46 };
 47 
 48 
 49 /* get the number of current queues */
 50 int snd_seq_queue_get_cur_queues(void);
 51 
 52 /* delete queues */ 
 53 void snd_seq_queues_delete(void);
 54 
 55 
 56 /* create new queue (constructor) */
 57 struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags);
 58 
 59 /* delete queue (destructor) */
 60 int snd_seq_queue_delete(int client, int queueid);
 61 
 62 /* final stage */
 63 void snd_seq_queue_client_leave(int client);
 64 
 65 /* enqueue a event received from one the clients */
 66 int snd_seq_enqueue_event(struct snd_seq_event_cell *cell, int atomic, int hop);
 67 
 68 /* Remove events */
 69 void snd_seq_queue_client_leave_cells(int client);
 70 void snd_seq_queue_remove_cells(int client, struct snd_seq_remove_events *info);
 71 
 72 /* return pointer to queue structure for specified id */
 73 struct snd_seq_queue *queueptr(int queueid);
 74 /* unlock */
 75 #define queuefree(q) snd_use_lock_free(&(q)->use_lock)
 76 
 77 /* return the (first) queue matching with the specified name */
 78 struct snd_seq_queue *snd_seq_queue_find_name(char *name);
 79 
 80 /* check single queue and dispatch events */
 81 void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop);
 82 
 83 /* access to queue's parameters */
 84 int snd_seq_queue_check_access(int queueid, int client);
 85 int snd_seq_queue_timer_set_tempo(int queueid, int client, struct snd_seq_queue_tempo *info);
 86 int snd_seq_queue_set_owner(int queueid, int client, int locked);
 87 int snd_seq_queue_set_locked(int queueid, int client, int locked);
 88 int snd_seq_queue_timer_open(int queueid);
 89 int snd_seq_queue_timer_close(int queueid);
 90 int snd_seq_queue_use(int queueid, int client, int use);
 91 int snd_seq_queue_is_used(int queueid, int client);
 92 
 93 int snd_seq_control_queue(struct snd_seq_event *ev, int atomic, int hop);
 94 
 95 #endif
 96 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php