base/ipc/fifos/fifos.c File Reference


Detailed Description

Implementation of the RTAI FIFO module.

Author:
Paolo Mantegazza
Note:
Copyright © 1999-2003 Paolo Mantegazza <mantegazza@aero.polimi.it>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file fifos.c.#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/poll.h>
#include <linux/termios.h>
#include <linux/tty_driver.h>
#include <linux/console.h>
#include <linux/config.h>
#include <linux/slab.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/stat.h>
#include <linux/proc_fs.h>
#include <rtai_fifos.h>
#include <rtai_trace.h>
#include <rtai_proc_fs.h>
#include <rtai_sched.h>
#include <rtai_lxrt.h>

Include dependency graph for fifos.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  lx_queue
struct  lx_semaphore
struct  lx_task_struct
struct  lx_mailbox
struct  rt_fifo_struct

Defines

#define rtf_save_flags_and_cli(x)   do{x=rt_spin_lock_irqsave(&rtf_lock);}while(0)
#define rtf_restore_flags(x)   rt_spin_unlock_irqrestore((x),&rtf_lock)
#define rtf_spin_lock_irqsave(x, y)   do{x=rt_spin_lock_irqsave(&(y));}while(0)
#define rtf_spin_unlock_irqrestore(x, y)   rt_spin_unlock_irqrestore((x),&(y))
#define rtf_request_srq(x)   rt_request_srq(0, (x), 0)
#define rtf_free_srq(x)   rt_free_srq((x))
#define rtf_pend_srq(x)   rt_pend_linux_srq((x))
#define MAX_FIFOS   64
#define MAXREQS   64
#define MOD_SIZE(indx)   ((indx) < mbx->size ? (indx) : (indx) - mbx->size)
#define VALID_FIFO
#define DEFAULT_SIZE   1000
#define DELAY(x)   (((x)*HZ + 500)/1000)

Typedefs

typedef lx_queue F_QUEUE
typedef lx_semaphore F_SEM
typedef lx_task_struct LX_TASK
typedef lx_mailbox F_MBX
typedef rt_fifo_struct FIFO

Functions

 MODULE_LICENSE ("GPL")
int do_nothing (unsigned int arg)
void enqueue_blocked (LX_TASK *task, F_QUEUE *queue, int qtype, int priority)
void dequeue_blocked (LX_TASK *task)
void mbx_sem_signal (F_SEM *sem, FIFO *fifop)
void mbx_signal (F_MBX *mbx)
int mbx_sem_wait_if (F_SEM *sem)
int mbx_sem_wait (F_SEM *sem)
int mbx_wait (F_MBX *mbx, int *fravbs)
int mbx_sem_wait_timed (F_SEM *sem, int delay)
int mbx_wait_timed (F_MBX *mbx, int *fravbs, int delay)
int mbx_put (F_MBX *mbx, char **msg, int msg_size, int lnx)
int mbx_ovrwr_put (F_MBX *mbx, char **msg, int msg_size, int lnx)
int mbx_get (F_MBX *mbx, char **msg, int msg_size, int lnx)
int mbx_evdrp (F_MBX *mbx, char **msg, int msg_size, int lnx)
void mbx_sem_init (F_SEM *sem, int value)
int mbx_sem_delete (F_SEM *sem)
void mbx_init (F_MBX *mbx, int size, char *bufadr)
int mbx_delete (F_MBX *mbx)
int mbx_send (F_MBX *mbx, void *msg, int msg_size, int lnx)
int mbx_send_wp (F_MBX *mbx, void *msg, int msg_size, int lnx)
int mbx_send_if (F_MBX *mbx, void *msg, int msg_size, int lnx)
int mbx_send_timed (F_MBX *mbx, void *msg, int msg_size, int delay, int lnx)
int mbx_receive (F_MBX *mbx, void *msg, int msg_size, int lnx)
int mbx_receive_wjo (F_MBX *mbx, void *msg, int msg_size, int lnx)
int mbx_receive_wp (F_MBX *mbx, void *msg, int msg_size, int lnx)
int mbx_receive_if (F_MBX *mbx, void *msg, int msg_size, int lnx)
int mbx_receive_timed (F_MBX *mbx, void *msg, int msg_size, int delay, int lnx)
int mbx_ovrwr_send (F_MBX *mbx, void *msg, int msg_size, int lnx)
void rtf_sysrq_handler (void)
int rtf_reset (unsigned int minor)
int rtf_resize (unsigned int minor, int size)
int rtf_create (unsigned int minor, int size)
int rtf_destroy (unsigned int minor)
int rtf_create_handler (unsigned int minor, int(*handler)(unsigned int fifo))
int rtf_put (unsigned int minor, void *buf, int count)
int rtf_ovrwr_put (unsigned int minor, void *buf, int count)
int rtf_put_if (unsigned int minor, void *buf, int count)
int rtf_get (unsigned int minor, void *buf, int count)
int rtf_evdrp (unsigned int minor, void *msg, int msg_size)
int rtf_get_if (unsigned int minor, void *buf, int count)
int rtf_sem_init (unsigned int minor, int value)
int rtf_sem_post (unsigned int minor)
int rtf_sem_trywait (unsigned int minor)
int rtf_sem_destroy (unsigned int minor)
int rtf_open (struct inode *inode, struct file *filp)
int rtf_fasync (int fd, struct file *filp, int mode)
int rtf_release (struct inode *inode, struct file *filp)
ssize_t rtf_read (struct file *filp, char *buf, size_t count, loff_t *ppos)
ssize_t rtf_write (struct file *filp, const char *buf, size_t count, loff_t *ppos)
int rtf_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
unsigned int rtf_poll (struct file *filp, poll_table *wait)
loff_t rtf_llseek (struct file *filp, loff_t offset, int origin)
 MODULE_PARM (MaxFifos,"i")
int register_lxrt_fifos_support (void)
void unregister_lxrt_fifos_support (void)
int __rtai_fifos_init (void)
void __rtai_fifos_exit (void)
 module_init (__rtai_fifos_init)
 module_exit (__rtai_fifos_exit)
int rtf_named_create (const char *name, int size)
int rtf_create_named (const char *name)
int rtf_getfifobyname (const char *name)
 EXPORT_SYMBOL (rtf_create)
 EXPORT_SYMBOL (rtf_destroy)
 EXPORT_SYMBOL (rtf_evdrp)
 EXPORT_SYMBOL (rtf_get)
 EXPORT_SYMBOL (rtf_ovrwr_put)
 EXPORT_SYMBOL (rtf_put)
 EXPORT_SYMBOL (rtf_reset)
 EXPORT_SYMBOL (rtf_resize)
 EXPORT_SYMBOL (rtf_sem_destroy)
 EXPORT_SYMBOL (rtf_sem_init)
 EXPORT_SYMBOL (rtf_sem_post)
 EXPORT_SYMBOL (rtf_sem_trywait)
 EXPORT_SYMBOL (rtf_named_create)

Variables

int fifo_srq
int async_sig
spinlock_t rtf_lock = SPIN_LOCK_UNLOCKED
spinlock_t rtf_name_lock = SPIN_LOCK_UNLOCKED
FIFOfifo
struct {
   int   in
   int   out
   task_struct *   task [MAXREQS]
taskq
struct {
   int   in
   int   out
   FIFO *   fifo [MAXREQS]
pol_asyn_q
RT_TASKrt_base_linux_task
file_operations rtf_fops
int MaxFifos = MAX_FIFOS
rt_fun_entry rtai_fifos_fun []


Define Documentation

#define DEFAULT_SIZE   1000
 

Referenced by rtf_create_named(), and rtf_open().

#define DELAY  )     (((x)*HZ + 500)/1000)
 

Definition at line 1402 of file fifos.c.

Referenced by rtf_ioctl().

#define MAX_FIFOS   64
 

Definition at line 225 of file fifos.c.

#define MAXREQS   64
 

Definition at line 229 of file fifos.c.

Referenced by mbx_sem_delete(), mbx_sem_signal(), mbx_signal(), and rtf_sysrq_handler().

#define MOD_SIZE indx   )     ((indx) < mbx->size ? (indx) : (indx) - mbx->size)
 

Definition at line 430 of file fifos.c.

Referenced by mbx_evdrp(), mbx_get(), mbx_ovrwr_put(), mbx_put(), mbxevdrp(), mbxget(), mbxovrwrput(), and mbxput().

#define rtf_free_srq  )     rt_free_srq((x))
 

Definition at line 170 of file fifos.c.

Referenced by __rtai_fifos_exit().

#define rtf_pend_srq  )     rt_pend_linux_srq((x))
 

Definition at line 171 of file fifos.c.

Referenced by mbx_sem_delete(), mbx_sem_signal(), and mbx_signal().

#define rtf_request_srq  )     rt_request_srq(0, (x), 0)
 

Definition at line 169 of file fifos.c.

Referenced by __rtai_fifos_init().

#define rtf_restore_flags  )     rt_spin_unlock_irqrestore((x),&rtf_lock)
 

Definition at line 166 of file fifos.c.

Referenced by mbx_ovrwr_send(), mbx_receive_if(), mbx_receive_wp(), mbx_sem_delete(), mbx_sem_signal(), mbx_sem_wait(), mbx_sem_wait_if(), mbx_sem_wait_timed(), mbx_send_if(), mbx_send_wp(), mbx_signal(), mbx_wait(), and mbx_wait_timed().

#define rtf_save_flags_and_cli  )     do{x=rt_spin_lock_irqsave(&rtf_lock);}while(0)
 

Definition at line 165 of file fifos.c.

Referenced by mbx_ovrwr_send(), mbx_receive_if(), mbx_receive_wp(), mbx_sem_delete(), mbx_sem_signal(), mbx_sem_wait(), mbx_sem_wait_if(), mbx_sem_wait_timed(), mbx_send_if(), mbx_send_wp(), mbx_signal(), mbx_wait(), and mbx_wait_timed().

#define rtf_spin_lock_irqsave x,
 )     do{x=rt_spin_lock_irqsave(&(y));}while(0)
 

Definition at line 167 of file fifos.c.

Referenced by mbx_get(), mbx_ovrwr_put(), mbx_put(), and rtf_named_create().

#define rtf_spin_unlock_irqrestore x,
 )     rt_spin_unlock_irqrestore((x),&(y))
 

Definition at line 168 of file fifos.c.

Referenced by mbx_get(), mbx_ovrwr_put(), mbx_put(), and rtf_named_create().

#define VALID_FIFO
 

Value:

if (minor >= MAX_FIFOS) { return -ENODEV; } \ if (!(fifo[minor].opncnt)) { return -EINVAL; }
Definition at line 806 of file fifos.c.

Referenced by rtf_destroy(), rtf_evdrp(), rtf_get(), rtf_get_if(), rtf_ovrwr_put(), rtf_put(), rtf_put_if(), rtf_reset(), rtf_resize(), rtf_sem_destroy(), rtf_sem_init(), rtf_sem_post(), and rtf_sem_trywait().


Typedef Documentation

typedef struct lx_mailbox F_MBX
 

Referenced by mbx_delete(), mbx_evdrp(), mbx_get(), mbx_init(), mbx_ovrwr_put(), mbx_ovrwr_send(), mbx_put(), mbx_receive(), mbx_receive_if(), mbx_receive_timed(), mbx_receive_wjo(), mbx_receive_wp(), mbx_sem_signal(), mbx_send(), mbx_send_if(), mbx_send_timed(), mbx_send_wp(), mbx_signal(), mbx_wait(), mbx_wait_timed(), rtf_reset(), and rtf_resize().

typedef struct lx_queue F_QUEUE
 

Referenced by enqueue_blocked().

typedef struct lx_semaphore F_SEM
 

Referenced by mbx_sem_delete(), mbx_sem_init(), mbx_sem_signal(), mbx_sem_wait(), mbx_sem_wait_if(), and mbx_sem_wait_timed().

typedef struct rt_fifo_struct FIFO
 

Referenced by __rtai_fifos_init(), mbx_ovrwr_send(), mbx_receive(), mbx_receive_if(), mbx_receive_timed(), mbx_receive_wjo(), mbx_receive_wp(), mbx_sem_signal(), mbx_send(), mbx_send_if(), mbx_send_timed(), mbx_send_wp(), rtf_ioctl(), rtf_reset(), rtf_resize(), and rtf_sysrq_handler().

typedef struct lx_task_struct LX_TASK
 

Referenced by dequeue_blocked(), enqueue_blocked(), mbx_sem_delete(), mbx_sem_signal(), mbx_sem_wait(), and mbx_sem_wait_timed().


Function Documentation

void __rtai_fifos_exit void   ) 
 

Definition at line 1780 of file fifos.c.

References fifo, fifo_srq, printk(), RTAI_FIFOS_MAJOR, rtf_free_srq, and unregister_lxrt_fifos_support().

Here is the call graph for this function:

int __rtai_fifos_init void   ) 
 

Definition at line 1706 of file fifos.c.

References async_sig, rt_fifo_struct::asynq, FIFO, fifo, fifo_srq, MAX_FIFOS, MaxFifos, mbx_sem_init(), rt_fifo_struct::opncnt, rt_fifo_struct::pol_asyn_pended, pol_asyn_q, printk(), register_lxrt_fifos_support(), RTAI_FIFOS_MAJOR, rtf_fops, rtf_request_srq, rtf_sysrq_handler(), and taskq.

Here is the call graph for this function:

void dequeue_blocked LX_TASK task  )  [inline, static]
 

Definition at line 250 of file fifos.c.

References LX_TASK, and task.

Referenced by _rt_bits_wait_until(), mbx_sem_signal(), mbx_sem_wait(), mbx_sem_wait_timed(), rt_bits_reset(), rt_bits_signal(), rt_cndmtx_signal(), rt_cond_signal(), rt_cond_wait_until(), rt_dequeue_blocked(), rt_receive(), rt_receive_if(), rt_receive_linux_syscall(), rt_receive_until(), rt_return(), rt_return_linux_syscall(), rt_rpc_until(), rt_sem_broadcast(), rt_sem_signal(), rt_sem_wait_until(), and rt_send_until().

int do_nothing unsigned int  arg  )  [static]
 

Definition at line 235 of file fifos.c.

Referenced by rtf_create(), and rtf_destroy().

void enqueue_blocked LX_TASK task,
F_QUEUE queue,
int  qtype,
int  priority
[inline, static]
 

Definition at line 237 of file fifos.c.

References F_QUEUE, LX_TASK, lx_queue::next, lx_queue::prev, lx_queue::task, and task.

Referenced by _rt_bits_wait(), _rt_bits_wait_until(), mbx_sem_wait(), mbx_sem_wait_timed(), rt_cond_wait(), rt_cond_wait_until(), rt_enqueue_blocked(), rt_exec_linux_syscall(), rt_receive(), rt_receive_if(), rt_receive_linux_syscall(), rt_receive_until(), rt_rpc(), rt_rpc_if(), rt_rpc_until(), rt_sem_wait(), rt_sem_wait_until(), rt_send(), and rt_send_until().

EXPORT_SYMBOL rtf_named_create   ) 
 

EXPORT_SYMBOL rtf_sem_trywait   ) 
 

EXPORT_SYMBOL rtf_sem_post   ) 
 

EXPORT_SYMBOL rtf_sem_init   ) 
 

EXPORT_SYMBOL rtf_sem_destroy   ) 
 

EXPORT_SYMBOL rtf_resize   ) 
 

EXPORT_SYMBOL rtf_reset   ) 
 

EXPORT_SYMBOL rtf_put   ) 
 

EXPORT_SYMBOL rtf_ovrwr_put   ) 
 

EXPORT_SYMBOL rtf_get   ) 
 

EXPORT_SYMBOL rtf_evdrp   ) 
 

EXPORT_SYMBOL rtf_destroy   ) 
 

EXPORT_SYMBOL rtf_create   ) 
 

int mbx_delete F_MBX mbx  )  [inline, static]
 

Definition at line 603 of file fifos.c.

References F_MBX, mbx_sem_delete(), mbx_signal(), lx_mailbox::rcvsem, and lx_mailbox::sndsem.

Referenced by rtf_destroy().

Here is the call graph for this function:

int mbx_evdrp F_MBX mbx,
char **  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 537 of file fifos.c.

References lx_mailbox::avbs, lx_mailbox::bufadr, F_MBX, lx_mailbox::fbyte, MOD_SIZE, and lx_mailbox::size.

Referenced by rtf_evdrp(), and rtf_ioctl().

int mbx_get F_MBX mbx,
char **  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 509 of file fifos.c.

References lx_mailbox::avbs, lx_mailbox::bufadr, lx_mailbox::buflock, F_MBX, lx_mailbox::fbyte, flags, lx_mailbox::frbs, MOD_SIZE, rtf_spin_lock_irqsave, rtf_spin_unlock_irqrestore, and lx_mailbox::size.

Referenced by mbx_receive(), mbx_receive_if(), mbx_receive_timed(), mbx_receive_wjo(), mbx_receive_wp(), and rtf_resize().

void mbx_init F_MBX mbx,
int  size,
char *  bufadr
[inline, static]
 

Definition at line 589 of file fifos.c.

References lx_mailbox::avbs, lx_mailbox::bufadr, lx_mailbox::buflock, F_MBX, lx_mailbox::fbyte, lx_mailbox::frbs, lx_mailbox::lbyte, mbx_sem_init(), lx_mailbox::rcvsem, lx_mailbox::size, lx_mailbox::sndsem, and lx_mailbox::waiting_task.

Referenced by rtf_create().

Here is the call graph for this function:

int mbx_ovrwr_put F_MBX mbx,
char **  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 460 of file fifos.c.

References lx_mailbox::avbs, lx_mailbox::bufadr, lx_mailbox::buflock, F_MBX, lx_mailbox::fbyte, flags, lx_mailbox::frbs, lx_mailbox::lbyte, MOD_SIZE, rtf_spin_lock_irqsave, rtf_spin_unlock_irqrestore, and lx_mailbox::size.

Referenced by mbx_ovrwr_send().

int mbx_ovrwr_send F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 765 of file fifos.c.

References F_MBX, FIFO, flags, lx_semaphore::free, mbx_ovrwr_put(), mbx_sem_signal(), mbx_signal(), rtf_restore_flags, rtf_save_flags_and_cli, and lx_mailbox::sndsem.

Referenced by rtf_ioctl(), and rtf_ovrwr_put().

Here is the call graph for this function:

int mbx_put F_MBX mbx,
char **  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 432 of file fifos.c.

References lx_mailbox::avbs, lx_mailbox::bufadr, lx_mailbox::buflock, F_MBX, flags, lx_mailbox::frbs, lx_mailbox::lbyte, MOD_SIZE, rtf_spin_lock_irqsave, rtf_spin_unlock_irqrestore, and lx_mailbox::size.

Referenced by mbx_send(), mbx_send_if(), mbx_send_timed(), and mbx_send_wp().

int mbx_receive F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 680 of file fifos.c.

References lx_mailbox::avbs, F_MBX, FIFO, mbx_get(), mbx_sem_signal(), mbx_sem_wait(), mbx_signal(), mbx_wait(), and lx_mailbox::rcvsem.

Referenced by rtf_ioctl().

Here is the call graph for this function:

int mbx_receive_if F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 731 of file fifos.c.

References F_MBX, FIFO, flags, lx_mailbox::frbs, lx_semaphore::free, mbx_get(), mbx_sem_signal(), mbx_signal(), lx_mailbox::rcvsem, rtf_restore_flags, and rtf_save_flags_and_cli.

Referenced by rtf_ioctl().

Here is the call graph for this function:

int mbx_receive_timed F_MBX mbx,
void *  msg,
int  msg_size,
int  delay,
int  lnx
[static]
 

Definition at line 748 of file fifos.c.

References lx_mailbox::avbs, F_MBX, FIFO, mbx_get(), mbx_sem_signal(), mbx_sem_wait_timed(), mbx_signal(), mbx_wait_timed(), and lx_mailbox::rcvsem.

Referenced by rtf_ioctl().

Here is the call graph for this function:

int mbx_receive_wjo F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 697 of file fifos.c.

References lx_mailbox::avbs, F_MBX, FIFO, mbx_get(), mbx_sem_signal(), mbx_sem_wait(), mbx_signal(), mbx_wait(), and lx_mailbox::rcvsem.

Referenced by rtf_read().

Here is the call graph for this function:

int mbx_receive_wp F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 714 of file fifos.c.

References lx_mailbox::avbs, F_MBX, FIFO, flags, lx_semaphore::free, mbx_get(), mbx_sem_signal(), mbx_signal(), lx_mailbox::rcvsem, rtf_restore_flags, and rtf_save_flags_and_cli.

Referenced by rtf_get(), rtf_ioctl(), and rtf_read().

Here is the call graph for this function:

int mbx_sem_delete F_SEM sem  )  [inline, static]
 

Definition at line 572 of file fifos.c.

References F_SEM, fifo_srq, flags, LX_TASK, MAXREQS, lx_queue::next, lx_semaphore::queue, rtf_pend_srq, rtf_restore_flags, rtf_save_flags_and_cli, task, and taskq.

Referenced by mbx_delete(), rtf_ioctl(), and rtf_sem_destroy().

void mbx_sem_init F_SEM sem,
int  value
[inline, static]
 

Definition at line 563 of file fifos.c.

References F_SEM, lx_semaphore::free, lx_queue::next, lx_queue::prev, lx_semaphore::qtype, lx_semaphore::queue, and lx_queue::task.

Referenced by __rtai_fifos_init(), mbx_init(), rtf_create(), rtf_ioctl(), and rtf_sem_init().

void mbx_sem_signal F_SEM sem,
FIFO fifop
[inline, static]
 

Definition at line 257 of file fifos.c.

References rt_fifo_struct::asynq, dequeue_blocked(), F_MBX, F_SEM, FIFO, fifo_srq, flags, lx_semaphore::free, LX_TASK, MAXREQS, lx_queue::next, rt_fifo_struct::pol_asyn_pended, pol_asyn_q, rt_fifo_struct::pollq, lx_semaphore::queue, rtf_pend_srq, rtf_restore_flags, rtf_save_flags_and_cli, task, and taskq.

Referenced by mbx_ovrwr_send(), mbx_receive(), mbx_receive_if(), mbx_receive_timed(), mbx_receive_wjo(), mbx_receive_wp(), mbx_send(), mbx_send_if(), mbx_send_timed(), mbx_send_wp(), rtf_ioctl(), rtf_reset(), rtf_resize(), and rtf_sem_post().

Here is the call graph for this function:

int mbx_sem_wait F_SEM sem  )  [inline, static]
 

Definition at line 313 of file fifos.c.

References dequeue_blocked(), enqueue_blocked(), F_SEM, flags, lx_semaphore::free, LX_TASK, lx_queue::next, lx_semaphore::qtype, lx_semaphore::queue, rtf_restore_flags, rtf_save_flags_and_cli, and task.

Referenced by mbx_receive(), mbx_receive_wjo(), mbx_send(), rtf_ioctl(), rtf_reset(), and rtf_resize().

Here is the call graph for this function:

int mbx_sem_wait_if F_SEM sem  )  [inline, static]
 

Definition at line 299 of file fifos.c.

References F_SEM, flags, lx_semaphore::free, rtf_restore_flags, and rtf_save_flags_and_cli.

Referenced by rtf_ioctl(), rtf_reset(), rtf_resize(), and rtf_sem_trywait().

int mbx_sem_wait_timed F_SEM sem,
int  delay
[inline, static]
 

Definition at line 373 of file fifos.c.

References dequeue_blocked(), enqueue_blocked(), F_SEM, flags, lx_semaphore::free, LX_TASK, lx_queue::next, lx_semaphore::qtype, lx_semaphore::queue, rtf_restore_flags, rtf_save_flags_and_cli, and task.

Referenced by mbx_receive_timed(), mbx_send_timed(), and rtf_ioctl().

Here is the call graph for this function:

int mbx_send F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 612 of file fifos.c.

References F_MBX, FIFO, lx_mailbox::frbs, mbx_put(), mbx_sem_signal(), mbx_sem_wait(), mbx_signal(), mbx_wait(), and lx_mailbox::sndsem.

Referenced by rtf_write().

Here is the call graph for this function:

int mbx_send_if F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 646 of file fifos.c.

References F_MBX, FIFO, flags, lx_mailbox::frbs, lx_semaphore::free, mbx_put(), mbx_sem_signal(), mbx_signal(), rtf_restore_flags, rtf_save_flags_and_cli, and lx_mailbox::sndsem.

Here is the call graph for this function:

int mbx_send_timed F_MBX mbx,
void *  msg,
int  msg_size,
int  delay,
int  lnx
[static]
 

Definition at line 663 of file fifos.c.

References F_MBX, FIFO, lx_mailbox::frbs, mbx_put(), mbx_sem_signal(), mbx_sem_wait_timed(), mbx_signal(), mbx_wait_timed(), and lx_mailbox::sndsem.

Referenced by rtf_ioctl().

Here is the call graph for this function:

int mbx_send_wp F_MBX mbx,
void *  msg,
int  msg_size,
int  lnx
[inline, static]
 

Definition at line 629 of file fifos.c.

References F_MBX, FIFO, flags, lx_mailbox::frbs, lx_semaphore::free, mbx_put(), mbx_sem_signal(), mbx_signal(), rtf_restore_flags, rtf_save_flags_and_cli, and lx_mailbox::sndsem.

Referenced by rtf_ioctl(), rtf_put(), and rtf_write().

Here is the call graph for this function:

void mbx_signal F_MBX mbx  )  [inline, static]
 

Definition at line 283 of file fifos.c.

References F_MBX, fifo_srq, flags, MAXREQS, rtf_pend_srq, rtf_restore_flags, rtf_save_flags_and_cli, task, taskq, and lx_mailbox::waiting_task.

int mbx_wait F_MBX mbx,
int *  fravbs
[inline, static]
 

Definition at line 349 of file fifos.c.

References F_MBX, flags, rtf_restore_flags, rtf_save_flags_and_cli, and lx_mailbox::waiting_task.

int mbx_wait_timed F_MBX mbx,
int *  fravbs,
int  delay
[inline, static]
 

Definition at line 406 of file fifos.c.

References F_MBX, flags, rtf_restore_flags, rtf_save_flags_and_cli, and lx_mailbox::waiting_task.

Referenced by mbx_receive_timed(), and mbx_send_timed().

module_exit __rtai_fifos_exit   ) 
 

module_init __rtai_fifos_init   ) 
 

MODULE_LICENSE "GPL"   ) 
 

MODULE_PARM MaxFifos  ,
"i" 
 

int register_lxrt_fifos_support void   )  [static]
 

Definition at line 1686 of file fifos.c.

References FUN_FIFOS_LXRT_INDX, NR_RT_CPUS, printk(), rt_base_linux_task, rt_get_base_linux_task(), RT_TASK, and rtai_fifos_fun.

Referenced by __rtai_fifos_init().

Here is the call graph for this function:

int rtf_create_named const char *  name  ) 
 

Definition at line 1913 of file fifos.c.

References DEFAULT_SIZE, and rtf_named_create().

Referenced by rtf_ioctl().

Here is the call graph for this function:

int rtf_evdrp unsigned int  minor,
void *  msg,
int  msg_size
 

Definition at line 1186 of file fifos.c.

References fifo, mbx_evdrp(), and VALID_FIFO.

Here is the call graph for this function:

int rtf_fasync int  fd,
struct file filp,
int  mode
[static]
 

Definition at line 1322 of file fifos.c.

References rt_fifo_struct::asynq, fifo, and TRACE_RTAI_FIFO.

Referenced by rtf_release().

int rtf_get_if unsigned int  minor,
void *  buf,
int  count
 

Definition at line 1193 of file fifos.c.

References count, fifo, mbx_send_if(), and VALID_FIFO.

Here is the call graph for this function:

int rtf_getfifobyname const char *  name  ) 
 

Definition at line 1918 of file fifos.c.

References fifo, MAX_FIFOS, rt_fifo_struct::opncnt, and RTF_NAMELEN.

Referenced by rtf_ioctl().

int rtf_ioctl struct inode *  inode,
struct file filp,
unsigned int  cmd,
unsigned long  arg
[static]
 

Definition at line 1404 of file fifos.c.

References async_sig, count, DELAY, EAVESDROP, fifo, FIFO, rt_fifo_info_struct::fifo_number, rt_fifo_struct::handler, MAX_FIFOS, rt_fifo_struct::mbx, mbx_evdrp(), mbx_ovrwr_send(), mbx_receive(), mbx_receive_if(), mbx_receive_timed(), mbx_receive_wp(), mbx_sem_delete(), mbx_sem_init(), mbx_sem_signal(), mbx_sem_wait(), mbx_sem_wait_if(), mbx_sem_wait_timed(), mbx_send_timed(), mbx_send_wp(), rt_fifo_struct::name, rt_fifo_info_struct::name, OPEN_SIZED, rt_fifo_struct::opncnt, rt_fifo_info_struct::opncnt, OVRWRITE, printk(), READ_ALL_AT_ONCE, READ_IF, READ_TIMED, RESET, RESIZE, rtf_create(), rtf_create_named(), RTF_CREATE_NAMED, RTF_GET_FIFO_INFO, RTF_GET_N_FIFOS, rtf_getfifobyname(), RTF_NAME_LOOKUP, rtf_named_create(), RTF_NAMED_CREATE, RTF_NAMELEN, rtf_reset(), rtf_resize(), RTF_SEM_DESTROY, RTF_SEM_INIT, RTF_SEM_POST, RTF_SEM_TIMED_WAIT, RTF_SEM_TRYWAIT, RTF_SEM_WAIT, rt_fifo_struct::sem, SET_ASYNC_SIG, lx_mailbox::size, rt_fifo_info_struct::size, SUSPEND_TIMED, TRACE_RTAI_FIFO, WRITE_IF, and WRITE_TIMED.

Here is the call graph for this function:

loff_t rtf_llseek struct file filp,
loff_t  offset,
int  origin
[static]
 

Definition at line 1638 of file fifos.c.

References rtf_reset(), and TRACE_RTAI_FIFO.

Here is the call graph for this function:

int rtf_named_create const char *  name,
int  size
 

Definition at line 1887 of file fifos.c.

References fifo, flags, MAX_FIFOS, rt_fifo_struct::name, rt_fifo_struct::opncnt, rtf_create(), rtf_name_lock, RTF_NAMELEN, rtf_spin_lock_irqsave, and rtf_spin_unlock_irqrestore.

Referenced by rtf_create_named(), and rtf_ioctl().

Here is the call graph for this function:

int rtf_open struct inode *  inode,
struct file filp
[static]
 

Definition at line 1314 of file fifos.c.

References DEFAULT_SIZE, rtf_create(), and TRACE_RTAI_FIFO.

Here is the call graph for this function:

int rtf_ovrwr_put unsigned int  minor,
void *  buf,
int  count
 

Definition at line 1130 of file fifos.c.

References count, fifo, mbx_ovrwr_send(), and VALID_FIFO.

Here is the call graph for this function:

unsigned int rtf_poll struct file filp,
poll_table *  wait
[static]
 

Definition at line 1621 of file fifos.c.

References lx_mailbox::avbs, fifo, lx_mailbox::frbs, rt_fifo_struct::mbx, and TRACE_RTAI_FIFO.

int rtf_put_if unsigned int  minor,
void *  buf,
int  count
 

Definition at line 1136 of file fifos.c.

References count, fifo, mbx_send_if(), and VALID_FIFO.

Here is the call graph for this function:

ssize_t rtf_read struct file filp,
char *  buf,
size_t  count,
loff_t *  ppos
[static]
 

Definition at line 1350 of file fifos.c.

References count, fifo, rt_fifo_struct::handler, mbx_receive_wjo(), mbx_receive_wp(), and TRACE_RTAI_FIFO.

Here is the call graph for this function:

int rtf_release struct inode *  inode,
struct file filp
[static]
 

Definition at line 1335 of file fifos.c.

References fifo, rtf_destroy(), rtf_fasync(), and TRACE_RTAI_FIFO.

Here is the call graph for this function:

void rtf_sysrq_handler void   )  [static]
 

Definition at line 782 of file fifos.c.

References async_sig, rt_fifo_struct::asynq, FIFO, MAXREQS, rt_fifo_struct::pol_asyn_pended, pol_asyn_q, rt_fifo_struct::pollq, and taskq.

Referenced by __rtai_fifos_init().

ssize_t rtf_write struct file filp,
const char *  buf,
size_t  count,
loff_t *  ppos
[static]
 

Definition at line 1377 of file fifos.c.

References count, fifo, rt_fifo_struct::handler, mbx_send(), mbx_send_wp(), and TRACE_RTAI_FIFO.

Here is the call graph for this function:

void unregister_lxrt_fifos_support void   )  [static]
 

Definition at line 1699 of file fifos.c.

References FUN_FIFOS_LXRT_INDX, rt_base_linux_task, and rtai_fifos_fun.

Referenced by __rtai_fifos_exit().


Variable Documentation

int async_sig [static]
 

Definition at line 221 of file fifos.c.

Referenced by __rtai_fifos_init(), rtf_ioctl(), and rtf_sysrq_handler().

FIFO* fifo[MAXREQS] [static]
 

Definition at line 231 of file fifos.c.

Referenced by __rtai_fifos_exit(), __rtai_fifos_init(), rtf_create(), rtf_create_handler(), rtf_destroy(), rtf_evdrp(), rtf_fasync(), rtf_get(), rtf_get_if(), rtf_getfifobyname(), rtf_ioctl(), rtf_named_create(), rtf_ovrwr_put(), rtf_poll(), rtf_put(), rtf_put_if(), rtf_read(), rtf_release(), rtf_reset(), rtf_resize(), rtf_sem_destroy(), rtf_sem_init(), rtf_sem_post(), rtf_sem_trywait(), and rtf_write().

int fifo_srq [static]
 

Definition at line 221 of file fifos.c.

Referenced by __rtai_fifos_exit(), __rtai_fifos_init(), mbx_sem_delete(), mbx_sem_signal(), and mbx_signal().

int in
 

Definition at line 231 of file fifos.c.

Referenced by conf_expand_value(), and conf_read().

int MaxFifos = MAX_FIFOS [static]
 

Definition at line 1665 of file fifos.c.

Referenced by __rtai_fifos_init().

int out
 

Definition at line 231 of file fifos.c.

Referenced by conf_write(), expr_fprint(), print_quoted_string(), print_symbol(), sym_check_deps(), and zconfdump().

struct { ... } pol_asyn_q [static]
 

Referenced by __rtai_fifos_init(), mbx_sem_signal(), and rtf_sysrq_handler().

RT_TASK* rt_base_linux_task [static]
 

Definition at line 233 of file fifos.c.

Referenced by register_lxrt_fifos_support(), and unregister_lxrt_fifos_support().

struct rt_fun_entry rtai_fifos_fun[] [static]
 

Initial value:

{ [_CREATE] = { 0, rtf_create }, [_DESTROY] = { 0, rtf_destroy }, [_PUT] = { 0, rtf_put }, [_GET] = { 0, rtf_get }, [_RESET] = { 0, rtf_reset }, [_RESIZE] = { 0, rtf_resize }, [_SEM_INIT] = { 0, rtf_sem_init }, [_SEM_DESTRY] = { 0, rtf_sem_destroy }, [_SEM_POST] = { 0, rtf_sem_post }, [_SEM_TRY] = { 0, rtf_sem_trywait }, [_CREATE_NAMED] = { 0, rtf_create_named }, [_GETBY_NAME] = { 0, rtf_getfifobyname }, [_OVERWRITE] = { 0, rtf_ovrwr_put }, [_PUT_IF] = { 0, rtf_put_if }, [_GET_IF] = { 0, rtf_get_if } }
Definition at line 1668 of file fifos.c.

Referenced by register_lxrt_fifos_support(), and unregister_lxrt_fifos_support().

struct file_operations rtf_fops [static]
 

Initial value:

{ owner: THIS_MODULE, llseek: rtf_llseek, read: rtf_read, write: rtf_write, poll: rtf_poll, ioctl: rtf_ioctl, open: rtf_open, release: rtf_release, fasync: rtf_fasync, }
Definition at line 1645 of file fifos.c.

Referenced by __rtai_fifos_init().

spinlock_t rtf_lock = SPIN_LOCK_UNLOCKED [static]
 

Definition at line 222 of file fifos.c.

spinlock_t rtf_name_lock = SPIN_LOCK_UNLOCKED [static]
 

Definition at line 223 of file fifos.c.

Referenced by rtf_named_create().

struct task_struct* task[MAXREQS]
 

Definition at line 230 of file fifos.c.

Referenced by __rt_proxy_attach(), __rtai_netrpc_exit(), clr_rtext(), dequeue_blocked(), enqueue_blocked(), force_soft(), handle_lxrt_request(), hard_stub_fun(), kthread_fun(), kthread_m(), linux_syscall_server_fun(), lxrt_intercept_exit(), lxrt_intercept_sig_wakeup(), lxrt_intercept_syscall_epilogue(), lxrt_intercept_syscall_prologue(), main(), mbx_delete_signal(), mbx_sem_delete(), mbx_sem_signal(), mbx_sem_wait(), mbx_sem_wait_timed(), mbx_signal(), port_server_fun(), put_current_on_cpu(), reset_task_prio(), rt_bits_delete(), rt_bits_reset(), rt_bits_signal(), rt_buddy_task_use_fpu(), rt_change_prio(), rt_cndmtx_signal(), rt_cond_signal(), rt_Creceive(), rt_dequeue_blocked(), rt_disable_signal(), rt_do_signal(), rt_enable_signal(), rt_enqueue_blocked(), RT_evdrp(), rt_evdrp(), RT_evdrpx(), rt_evdrpx(), rt_exec_linux_syscall(), rt_exec_signal(), rt_get_errno(), rt_get_exectime(), rt_get_inher_prio(), rt_get_linux_signal(), rt_get_prio(), rt_get_task_state(), rt_get_usp_flags(), rt_get_usp_flags_mask(), rt_halloc_typed(), rt_hfree_typed(), rt_is_hard_real_time(), RT_isrpc(), rt_isrpc(), rt_kthread_init(), rt_kthread_init_cpuid(), rt_linux_syscall_server_create(), rt_Name_attach(), rt_Name_locate(), rt_named_halloc_typed(), rt_named_hfree_typed(), rt_named_task_delete(), rt_named_task_init(), rt_named_task_init_cpuid(), rt_net_rpc(), rt_Proxy_attach(), rt_proxy_attach(), rt_Receive(), RT_receive(), rt_receive(), RT_receive_if(), rt_receive_if(), rt_receive_linux_syscall(), RT_receive_timed(), rt_receive_timed(), RT_receive_until(), rt_receive_until(), RT_receivex(), rt_receivex(), RT_receivex_if(), rt_receivex_if(), RT_receivex_timed(), rt_receivex_timed(), RT_receivex_until(), rt_receivex_until(), rt_register_task(), rt_register_watchdog(), rt_release_irq_task(), rt_release_signal(), rt_rem_ready_task(), rt_rem_timed_task(), rt_Reply(), rt_request_irq_task(), rt_request_signal(), rt_request_signal_(), RT_return(), rt_return(), rt_return_linux_syscall(), RT_returnx(), rt_returnx(), RT_rpc(), rt_rpc(), RT_rpc_if(), rt_rpc_if(), RT_rpc_timed(), rt_rpc_timed(), RT_rpc_until(), rt_rpc_until(), RT_rpcx(), rt_rpcx(), RT_rpcx_if(), rt_rpcx_if(), RT_rpcx_timed(), rt_rpcx_timed(), RT_rpcx_until(), rt_rpcx_until(), rt_schedule(), rt_sem_broadcast(), rt_sem_delete(), rt_sem_signal(), rt_Send(), RT_send(), rt_send(), RT_send_if(), rt_send_if(), rt_send_req_rel_port(), RT_send_timed(), rt_send_timed(), RT_send_until(), rt_send_until(), RT_sendx(), rt_sendx(), RT_sendx_if(), rt_sendx_if(), RT_sendx_timed(), rt_sendx_timed(), RT_sendx_until(), rt_sendx_until(), rt_set_heap(), rt_set_linux_signal_handler(), rt_set_period(), rt_set_resume_time(), rt_set_runnable_on_cpuid(), rt_set_runnable_on_cpus(), rt_set_sched_policy(), rt_set_task_trap_handler(), rt_set_usp_flags(), rt_signal_helper(), rt_signal_wake_up(), rt_spv_RMS(), rt_task_delete(), rt_task_init(), rt_task_init_cpuid(), rt_task_make_periodic(), rt_task_make_periodic_relative_ns(), rt_task_masked_unblock(), RT_task_resume(), rt_task_resume(), rt_task_signal_handler(), RT_task_suspend(), rt_task_suspend(), rt_task_suspend_if(), rt_task_suspend_timed(), rt_task_suspend_until(), rt_task_use_fpu(), rt_task_yield(), rt_tasklet_use_fpu(), rt_timer_handler(), rt_trigger_signal(), rt_wait_signal(), rtai_lxrt_invoke(), set_rtext(), signal_suprt_fun(), soft_kthread_delete(), soft_kthread_init(), soft_rt_fun_call(), soft_rt_genfun_call(), soft_stub_fun(), start_stop_kthread(), support_tasklet(), thread_fun(), and watchdog().

struct { ... } taskq [static]
 

Referenced by __rtai_fifos_init(), mbx_sem_delete(), mbx_sem_signal(), mbx_signal(), and rtf_sysrq_handler().


Generated on Thu Nov 20 11:54:47 2008 for RTAI API by doxygen 1.3.8