Include dependency graph for mq.c:
Go to the source code of this file.
Defines | |
#define | mq_cond_t SEM |
#define | mq_mutex_t SEM |
#define | mq_mutex_init(mutex, attr) rt_typed_sem_init(mutex, 1, BIN_SEM | PRIO_Q) |
#define | mq_mutex_unlock rt_sem_signal |
#define | mq_mutex_lock(mutex) |
#define | mq_mutex_timedlock(mutex, abstime) |
#define | mq_mutex_trylock rt_sem_wait_if |
#define | mq_mutex_destroy rt_sem_delete |
#define | mq_cond_init(cond, attr) rt_sem_init(cond, 0) |
#define | mq_cond_wait(cond, mutex) |
#define | mq_cond_timedwait(cond, mutex, abstime) |
#define | mq_cond_signal rt_sem_signal |
#define | mq_cond_destroy rt_sem_delete |
#define | OK 0 |
#define | ERROR -1 |
#define | MAX_RT_TASKS 128 |
#define | mqueues system_data_ptr |
Functions | |
MODULE_LICENSE ("GPL") | |
static int | name_to_id (char *name) |
static mq_bool_t | is_empty (struct queue_control *q) |
static mq_bool_t | is_full (struct queue_control *q) |
static MSG_HDR * | getnode (Q_CTRL *queue) |
static int | freenode (void *node, Q_CTRL *queue) |
static void | insert_message (Q_CTRL *q, MSG_HDR *this_msg) |
static mq_bool_t | is_blocking (MSG_QUEUE *q) |
static mq_bool_t | can_access (MSG_QUEUE *q, Q_ACCESS access) |
static void | initialise_queue (Q_CTRL *q) |
static void | delete_queue (int q_index) |
static void | signal_suprt_fun_mq (void *fun_arg) |
int | rt_request_signal_mq (mqd_t mq) |
RTAI_SYSCALL_MODE mqd_t | _mq_open (char *mq_name, int oflags, mode_t permissions, struct mq_attr *mq_attr, long space) |
EXPORT_SYMBOL (_mq_open) | |
RTAI_SYSCALL_MODE size_t | _mq_receive (mqd_t mq, char *msg_buffer, size_t buflen, unsigned int *msgprio, int space) |
EXPORT_SYMBOL (_mq_receive) | |
RTAI_SYSCALL_MODE size_t | _mq_timedreceive (mqd_t mq, char *msg_buffer, size_t buflen, unsigned int *msgprio, const struct timespec *abstime, int space) |
EXPORT_SYMBOL (_mq_timedreceive) | |
RTAI_SYSCALL_MODE int | _mq_send (mqd_t mq, const char *msg, size_t msglen, unsigned int msgprio, int space) |
EXPORT_SYMBOL (_mq_send) | |
RTAI_SYSCALL_MODE int | _mq_timedsend (mqd_t mq, const char *msg, size_t msglen, unsigned int msgprio, const struct timespec *abstime, int space) |
EXPORT_SYMBOL (_mq_timedsend) | |
RTAI_SYSCALL_MODE int | mq_close (mqd_t mq) |
EXPORT_SYMBOL (mq_close) | |
RTAI_SYSCALL_MODE int | mq_getattr (mqd_t mq, struct mq_attr *attrbuf) |
EXPORT_SYMBOL (mq_getattr) | |
RTAI_SYSCALL_MODE int | mq_setattr (mqd_t mq, const struct mq_attr *new_attrs, struct mq_attr *old_attrs) |
EXPORT_SYMBOL (mq_setattr) | |
RTAI_SYSCALL_MODE int | mq_reg_usp_notifier (mqd_t mq, RT_TASK *task, struct sigevent *usp_notification) |
RTAI_SYSCALL_MODE int | _mq_notify (mqd_t mq, RT_TASK *task, long space, long rem, const struct sigevent *notification) |
EXPORT_SYMBOL (_mq_notify) | |
RTAI_SYSCALL_MODE int | mq_unlink (char *mq_name) |
EXPORT_SYMBOL (mq_unlink) | |
int | set_rt_fun_entries (struct rt_native_fun_entry *entry) |
void | reset_rt_fun_entries (struct rt_native_fun_entry *entry) |
int | __rtai_mq_init (void) |
void | __rtai_mq_exit (void) |
module_init (__rtai_mq_init) | |
module_exit (__rtai_mq_exit) | |
Variables | |
static int | num_pqueues = 0 |
static struct _pqueue_descr_struct | rt_pqueue_descr [MAX_PQUEUES] = {{0}} |
static struct _pqueue_access_struct | task_pqueue_access [MAX_RT_TASKS] = {{0}} |
static MQ_ATTR | default_queue_attrs = { MAX_MSGS, MAX_MSGSIZE, MQ_NONBLOCK, 0 } |
static mq_mutex_t | pqueue_mutex |
rt_native_fun_entry | rt_pqueue_entries [] |
#define ERROR -1 |
Definition at line 98 of file mq.c.
Referenced by _mq_notify(), _mq_receive(), _mq_timedreceive(), and name_to_id().
#define MAX_RT_TASKS 128 |
#define mq_cond_destroy rt_sem_delete |
#define mq_cond_signal rt_sem_signal |
Definition at line 91 of file mq.c.
Referenced by _mq_receive(), _mq_send(), _mq_timedreceive(), and _mq_timedsend().
#define mq_cond_timedwait | ( | cond, | |||
mutex, | |||||
abstime | ) |
Value:
do { \ RTIME t = timespec2count(abstime); \ int ret; \ rt_sem_signal(mutex); \ if (abs(ret = rt_sem_wait_until(cond, t)) >= RTE_LOWERR) { \ return ret == RTE_TIMOUT ? -ETIMEDOUT : -EBADF; \ } \ if (abs(ret = rt_sem_wait_until(mutex, t)) >= RTE_LOWERR) { \ rt_sem_signal(cond); \ return ret == RTE_TIMOUT ? -ETIMEDOUT : -EBADF; \ } \ } while (0)
Definition at line 78 of file mq.c.
Referenced by _mq_timedreceive(), and _mq_timedsend().
#define mq_cond_wait | ( | cond, | |||
mutex | ) |
Value:
do { \ rt_sem_signal(mutex); \ if (abs(rt_sem_wait(cond)) >= RTE_LOWERR) { \ return -EBADF; \ } \ if (abs(rt_sem_wait(mutex)) >= RTE_LOWERR) { \ rt_sem_signal(cond); \ return -EBADF; \ } \ } while (0)
Definition at line 67 of file mq.c.
Referenced by _mq_receive(), and _mq_send().
#define mq_mutex_destroy rt_sem_delete |
#define mq_mutex_init | ( | mutex, | |||
attr | ) | rt_typed_sem_init(mutex, 1, BIN_SEM | PRIO_Q) |
#define mq_mutex_lock | ( | mutex | ) |
Value:
do { \ if (abs(rt_sem_wait(mutex)) >= RTE_LOWERR) { \ return -EBADF; \ } \ } while (0)
Definition at line 50 of file mq.c.
Referenced by _mq_notify(), _mq_open(), _mq_receive(), _mq_send(), mq_close(), mq_reg_usp_notifier(), and mq_unlink().
#define mq_mutex_timedlock | ( | mutex, | |||
abstime | ) |
Value:
do { \ RTIME t = timespec2count(abstime); \ int ret; \ if (abs(ret = rt_sem_wait_until(mutex, t)) >= RTE_LOWERR) { \ return ret == RTE_TIMOUT ? -ETIMEDOUT : -EBADF; \ } \ } while (0)
Definition at line 56 of file mq.c.
Referenced by _mq_timedreceive(), and _mq_timedsend().
#define mq_mutex_trylock rt_sem_wait_if |
Definition at line 64 of file mq.c.
Referenced by _mq_receive(), _mq_send(), _mq_timedreceive(), and _mq_timedsend().
#define mq_mutex_unlock rt_sem_signal |
Definition at line 49 of file mq.c.
Referenced by _mq_notify(), _mq_open(), _mq_receive(), _mq_send(), _mq_timedreceive(), _mq_timedsend(), delete_queue(), mq_reg_usp_notifier(), and mq_unlink().
#define OK 0 |
Definition at line 95 of file mq.c.
Referenced by __rtai_mq_init(), _mq_notify(), mq_getattr(), and mq_unlink().
void __rtai_mq_exit | ( | void | ) |
Definition at line 1002 of file mq.c.
References mq_mutex_destroy, pqueue_mutex, printk(), and reset_rt_fun_entries().
Here is the call graph for this function:
int __rtai_mq_init | ( | void | ) |
Definition at line 990 of file mq.c.
References mq_mutex_init, num_pqueues, OK, pqueue_mutex, printk(), and set_rt_fun_entries().
Here is the call graph for this function:
RTAI_SYSCALL_MODE int _mq_notify | ( | mqd_t | mq, | |
RT_TASK * | task, | |||
long | space, | |||
long | rem, | |||
const struct sigevent * | notification | |||
) |
Definition at line 838 of file mq.c.
References ERROR, MAXSIGNALS, mq_mutex_lock, mq_mutex_unlock, OK, rt_pqueue_descr, rt_request_signal_mq(), and task.
Here is the call graph for this function:
RTAI_SYSCALL_MODE mqd_t _mq_open | ( | char * | mq_name, | |
int | oflags, | |||
mode_t | permissions, | |||
struct mq_attr * | mq_attr, | |||
long | space | |||
) |
Definition at line 323 of file mq.c.
References INVALID_PQUEUE, MAX_RT_TASKS, mq_mutex_lock, mq_mutex_unlock, MQ_OPEN_MAX, name_to_id(), pqueue_mutex, rt_pqueue_descr, and task_pqueue_access.
Here is the call graph for this function:
RTAI_SYSCALL_MODE size_t _mq_receive | ( | mqd_t | mq, | |
char * | msg_buffer, | |||
size_t | buflen, | |||
unsigned int * | msgprio, | |||
int | space | |||
) |
Definition at line 494 of file mq.c.
References can_access(), ERROR, freenode(), is_blocking(), is_empty(), mq_cond_signal, mq_cond_wait, mq_mutex_lock, mq_mutex_trylock, mq_mutex_unlock, and rt_pqueue_descr.
Here is the call graph for this function:
RTAI_SYSCALL_MODE int _mq_send | ( | mqd_t | mq, | |
const char * | msg, | |||
size_t | msglen, | |||
unsigned int | msgprio, | |||
int | space | |||
) |
Definition at line 616 of file mq.c.
References can_access(), getnode(), insert_message(), is_blocking(), is_empty(), is_full(), MAXSIGNALS, mq_cond_signal, mq_cond_wait, mq_mutex_lock, mq_mutex_trylock, mq_mutex_unlock, MQ_PRIO_MAX, rt_pqueue_descr, and rt_trigger_signal().
Here is the call graph for this function:
RTAI_SYSCALL_MODE size_t _mq_timedreceive | ( | mqd_t | mq, | |
char * | msg_buffer, | |||
size_t | buflen, | |||
unsigned int * | msgprio, | |||
const struct timespec * | abstime, | |||
int | space | |||
) |
Definition at line 553 of file mq.c.
References can_access(), ERROR, freenode(), is_blocking(), is_empty(), mq_cond_signal, mq_cond_timedwait, mq_mutex_timedlock, mq_mutex_trylock, mq_mutex_unlock, and rt_pqueue_descr.
Here is the call graph for this function:
RTAI_SYSCALL_MODE int _mq_timedsend | ( | mqd_t | mq, | |
const char * | msg, | |||
size_t | msglen, | |||
unsigned int | msgprio, | |||
const struct timespec * | abstime, | |||
int | space | |||
) |
Definition at line 673 of file mq.c.
References can_access(), getnode(), insert_message(), is_blocking(), is_empty(), is_full(), MAXSIGNALS, mq_cond_signal, mq_cond_timedwait, mq_mutex_timedlock, mq_mutex_trylock, mq_mutex_unlock, MQ_PRIO_MAX, rt_pqueue_descr, and rt_trigger_signal().
Here is the call graph for this function:
static mq_bool_t can_access | ( | MSG_QUEUE * | q, | |
Q_ACCESS | access | |||
) | [static] |
Definition at line 216 of file mq.c.
References MQ_OPEN_MAX.
Referenced by _mq_receive(), _mq_send(), _mq_timedreceive(), and _mq_timedsend().
static void delete_queue | ( | int | q_index | ) | [static] |
Definition at line 268 of file mq.c.
References INVALID_PQUEUE, mq_cond_destroy, mq_mutex_destroy, mq_mutex_unlock, num_pqueues, rt_free(), and rt_pqueue_descr.
Referenced by mq_unlink().
Here is the call graph for this function:
EXPORT_SYMBOL | ( | mq_unlink | ) |
EXPORT_SYMBOL | ( | _mq_notify | ) |
EXPORT_SYMBOL | ( | mq_setattr | ) |
EXPORT_SYMBOL | ( | mq_getattr | ) |
EXPORT_SYMBOL | ( | mq_close | ) |
EXPORT_SYMBOL | ( | _mq_timedsend | ) |
EXPORT_SYMBOL | ( | _mq_send | ) |
EXPORT_SYMBOL | ( | _mq_timedreceive | ) |
EXPORT_SYMBOL | ( | _mq_receive | ) |
EXPORT_SYMBOL | ( | _mq_open | ) |
static int freenode | ( | void * | node, | |
Q_CTRL * | queue | |||
) | [inline, static] |
static MSG_HDR* getnode | ( | Q_CTRL * | queue | ) | [inline, static] |
static void initialise_queue | ( | Q_CTRL * | q | ) | [inline, static] |
static void insert_message | ( | Q_CTRL * | q, | |
MSG_HDR * | this_msg | |||
) | [static] |
static mq_bool_t is_blocking | ( | MSG_QUEUE * | q | ) | [static] |
Definition at line 201 of file mq.c.
References MQ_OPEN_MAX.
Referenced by _mq_receive(), _mq_send(), _mq_timedreceive(), and _mq_timedsend().
static mq_bool_t is_empty | ( | struct queue_control * | q | ) | [inline, static] |
Definition at line 134 of file mq.c.
Referenced by _mq_receive(), _mq_send(), _mq_timedreceive(), and _mq_timedsend().
static mq_bool_t is_full | ( | struct queue_control * | q | ) | [inline, static] |
module_exit | ( | __rtai_mq_exit | ) |
module_init | ( | __rtai_mq_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
RTAI_SYSCALL_MODE int mq_close | ( | mqd_t | mq | ) |
Definition at line 736 of file mq.c.
References INVALID_PQUEUE, MAXSIGNALS, mq_mutex_lock, MQ_OPEN_MAX, pqueue_mutex, and rt_release_signal().
Here is the call graph for this function:
RTAI_SYSCALL_MODE int mq_reg_usp_notifier | ( | mqd_t | mq, | |
RT_TASK * | task, | |||
struct sigevent * | usp_notification | |||
) |
Definition at line 829 of file mq.c.
References mq_mutex_lock, mq_mutex_unlock, rt_pqueue_descr, and task.
RTAI_SYSCALL_MODE int mq_setattr | ( | mqd_t | mq, | |
const struct mq_attr * | new_attrs, | |||
struct mq_attr * | old_attrs | |||
) |
Definition at line 790 of file mq.c.
References MQ_BLOCK, mq_attr::mq_flags, MQ_NONBLOCK, MQ_OPEN_MAX, and rt_pqueue_descr.
RTAI_SYSCALL_MODE int mq_unlink | ( | char * | mq_name | ) |
Definition at line 885 of file mq.c.
References delete_queue(), mq_mutex_lock, mq_mutex_unlock, name_to_id(), OK, pqueue_mutex, and rt_pqueue_descr.
Here is the call graph for this function:
static int name_to_id | ( | char * | name | ) | [static] |
Definition at line 122 of file mq.c.
References ERROR, MAX_PQUEUES, and rt_pqueue_descr.
Referenced by _mq_open(), and mq_unlink().
int rt_request_signal_mq | ( | mqd_t | mq | ) |
Definition at line 306 of file mq.c.
References rt_malloc(), rt_task_init_cpuid(), rt_task_resume(), rt_task_suspend(), rt_whoami(), signal_suprt_fun_mq(), SIGNAL_TASK_STACK_SIZE, and suprt_fun_arg::task.
Here is the call graph for this function:
static void signal_suprt_fun_mq | ( | void * | fun_arg | ) | [static] |
Definition at line 292 of file mq.c.
References MAXSIGNALS, suprt_fun_arg::mq, rt_pqueue_descr, rt_request_signal_(), rt_task_resume(), rt_wait_signal(), and suprt_fun_arg::task.
Here is the call graph for this function:
MQ_ATTR default_queue_attrs = { MAX_MSGS, MAX_MSGSIZE, MQ_NONBLOCK, 0 } [static] |
int num_pqueues = 0 [static] |
mq_mutex_t pqueue_mutex [static] |
Definition at line 116 of file mq.c.
Referenced by __rtai_mq_exit(), __rtai_mq_init(), _mq_open(), mq_close(), and mq_unlink().
struct _pqueue_descr_struct rt_pqueue_descr[MAX_PQUEUES] = {{0}} [static] |
Definition at line 112 of file mq.c.
Referenced by _mq_notify(), _mq_open(), _mq_receive(), _mq_send(), _mq_timedreceive(), _mq_timedsend(), delete_queue(), mq_getattr(), mq_reg_usp_notifier(), mq_setattr(), mq_unlink(), name_to_id(), and signal_suprt_fun_mq().
struct rt_native_fun_entry rt_pqueue_entries[] |
Initial value:
{ { { UR1(1, 5) | UR2(4, 6), _mq_open }, MQ_OPEN }, { { 1, _mq_receive }, MQ_RECEIVE }, { { 1, _mq_send }, MQ_SEND }, { { 1, mq_close }, MQ_CLOSE }, { { UW1(2, 3), mq_getattr }, MQ_GETATTR }, { { UR1(2, 4) | UW1(3, 4), mq_setattr }, MQ_SETATTR }, { { UR1(5, 6), _mq_notify }, MQ_NOTIFY }, { { UR1(1, 2), mq_unlink }, MQ_UNLINK }, { { 1, _mq_timedreceive }, MQ_TIMEDRECEIVE }, { { 1, _mq_timedsend }, MQ_TIMEDSEND }, { { 1, mq_reg_usp_notifier }, MQ_REG_USP_NOTIFIER }, { { 0, 0 }, 000 } }
struct _pqueue_access_struct task_pqueue_access[MAX_RT_TASKS] = {{0}} [static] |