base/ipc/bits/bits.c File Reference

Include dependency graph for bits.c:

Go to the source code of this file.

Defines

#define MASK0(x)   ((unsigned long *)&(x))[0]
#define MASK1(x)   ((unsigned long *)&(x))[1]
#define CHECK_BITS_MAGIC(bits)   do { if (bits->magic != RT_BITS_MAGIC) return RTE_OBJINV; } while (0)
#define TEST_BUF(x, y)   do { (x)->retval = (unsigned long)(y); } while (0)
#define TEST_FUN(x)   ((long *)((unsigned long)(x)->retval))[0]
#define TEST_MASK(x)   ((unsigned long *)((unsigned long)(x)->retval))[1]

Functions

 MODULE_LICENSE ("GPL")
static int all_set (BITS *bits, unsigned long mask)
static int any_set (BITS *bits, unsigned long mask)
static int all_clr (BITS *bits, unsigned long mask)
static int any_clr (BITS *bits, unsigned long mask)
static int all_set_and_any_set (BITS *bits, unsigned long masks)
static int all_set_and_all_clr (BITS *bits, unsigned long masks)
static int all_set_and_any_clr (BITS *bits, unsigned long masks)
static int any_set_and_all_clr (BITS *bits, unsigned long masks)
static int any_set_and_any_clr (BITS *bits, unsigned long masks)
static int all_clr_and_any_clr (BITS *bits, unsigned long masks)
static int all_set_or_any_set (BITS *bits, unsigned long masks)
static int all_set_or_all_clr (BITS *bits, unsigned long masks)
static int all_set_or_any_clr (BITS *bits, unsigned long masks)
static int any_set_or_all_clr (BITS *bits, unsigned long masks)
static int any_set_or_any_clr (BITS *bits, unsigned long masks)
static int all_clr_or_any_clr (BITS *bits, unsigned long masks)
static void set_bits_mask (BITS *bits, unsigned long mask)
static void clr_bits_mask (BITS *bits, unsigned long mask)
static void set_clr_bits_mask (BITS *bits, unsigned long masks)
static void nop_fun (BITS *bits, unsigned long mask)
void rt_bits_init (BITS *bits, unsigned long mask)
int rt_bits_delete (BITS *bits)
RTAI_SYSCALL_MODE unsigned
long 
rt_get_bits (BITS *bits)
RTAI_SYSCALL_MODE unsigned
long 
rt_bits_reset (BITS *bits, unsigned long mask)
RTAI_SYSCALL_MODE unsigned
long 
rt_bits_signal (BITS *bits, int setfun, unsigned long masks)
RTAI_SYSCALL_MODE int _rt_bits_wait (BITS *bits, int testfun, unsigned long testmasks, int exitfun, unsigned long exitmasks, unsigned long *resulting_mask, int space)
RTAI_SYSCALL_MODE int _rt_bits_wait_if (BITS *bits, int testfun, unsigned long testmasks, int exitfun, unsigned long exitmasks, unsigned long *resulting_mask, int space)
RTAI_SYSCALL_MODE int _rt_bits_wait_until (BITS *bits, int testfun, unsigned long testmasks, int exitfun, unsigned long exitmasks, RTIME time, unsigned long *resulting_mask, int space)
RTAI_SYSCALL_MODE int _rt_bits_wait_timed (BITS *bits, int testfun, unsigned long testmasks, int exitfun, unsigned long exitmasks, RTIME delay, unsigned long *resulting_mask, int space)
RTAI_SYSCALL_MODE BITSrt_named_bits_init (const char *bits_name, unsigned long mask)
RTAI_SYSCALL_MODE int rt_named_bits_delete (BITS *bits)
RTAI_SYSCALL_MODE void * rt_bits_init_u (unsigned long name, unsigned long mask)
RTAI_SYSCALL_MODE int rt_bits_delete_u (BITS *bits)
int set_rt_fun_entries (struct rt_native_fun_entry *entry)
void reset_rt_fun_entries (struct rt_native_fun_entry *entry)
int __rtai_bits_init (void)
void __rtai_bits_exit (void)
 module_init (__rtai_bits_init)
 module_exit (__rtai_bits_exit)
 EXPORT_SYMBOL (rt_bits_init)
 EXPORT_SYMBOL (rt_bits_delete)
 EXPORT_SYMBOL (rt_get_bits)
 EXPORT_SYMBOL (rt_bits_reset)
 EXPORT_SYMBOL (rt_bits_signal)
 EXPORT_SYMBOL (_rt_bits_wait)
 EXPORT_SYMBOL (_rt_bits_wait_if)
 EXPORT_SYMBOL (_rt_bits_wait_until)
 EXPORT_SYMBOL (_rt_bits_wait_timed)
 EXPORT_SYMBOL (rt_named_bits_init)
 EXPORT_SYMBOL (rt_named_bits_delete)
 EXPORT_SYMBOL (rt_bits_init_u)
 EXPORT_SYMBOL (rt_bits_delete_u)

Variables

static int(*[]) test_fun (BITS *, unsigned long)
static void(*[]) exec_fun (BITS *, unsigned long)
rt_native_fun_entry rt_bits_entries []


Define Documentation

#define CHECK_BITS_MAGIC ( bits   )     do { if (bits->magic != RT_BITS_MAGIC) return RTE_OBJINV; } while (0)

Definition at line 150 of file bits.c.

Referenced by _rt_bits_wait(), _rt_bits_wait_if(), _rt_bits_wait_until(), rt_bits_delete(), rt_bits_reset(), and rt_bits_signal().

#define MASK0 (  )     ((unsigned long *)&(x))[0]

Definition at line 32 of file bits.c.

Referenced by all_clr_and_any_clr(), all_clr_or_any_clr(), all_set_and_all_clr(), all_set_and_any_clr(), all_set_and_any_set(), all_set_or_all_clr(), all_set_or_any_clr(), all_set_or_any_set(), any_set_and_all_clr(), any_set_and_any_clr(), any_set_or_all_clr(), any_set_or_any_clr(), and set_clr_bits_mask().

#define MASK1 (  )     ((unsigned long *)&(x))[1]

Definition at line 33 of file bits.c.

Referenced by all_clr_and_any_clr(), all_clr_or_any_clr(), all_set_and_all_clr(), all_set_and_any_clr(), all_set_and_any_set(), all_set_or_all_clr(), all_set_or_any_clr(), all_set_or_any_set(), any_set_and_all_clr(), any_set_and_any_clr(), any_set_or_all_clr(), any_set_or_any_clr(), and set_clr_bits_mask().

#define TEST_BUF ( x,
 )     do { (x)->retval = (unsigned long)(y); } while (0)

Definition at line 189 of file bits.c.

Referenced by _rt_bits_wait(), and _rt_bits_wait_until().

#define TEST_FUN (  )     ((long *)((unsigned long)(x)->retval))[0]

Definition at line 190 of file bits.c.

Referenced by _rt_bits_wait(), _rt_bits_wait_until(), and rt_bits_signal().

#define TEST_MASK (  )     ((unsigned long *)((unsigned long)(x)->retval))[1]

Definition at line 191 of file bits.c.

Referenced by _rt_bits_wait(), _rt_bits_wait_until(), and rt_bits_signal().


Function Documentation

void __rtai_bits_exit ( void   ) 

Definition at line 469 of file bits.c.

References reset_rt_fun_entries().

Here is the call graph for this function:

int __rtai_bits_init ( void   ) 

Definition at line 464 of file bits.c.

References set_rt_fun_entries().

Here is the call graph for this function:

RTAI_SYSCALL_MODE int _rt_bits_wait ( BITS bits,
int  testfun,
unsigned long  testmasks,
int  exitfun,
unsigned long  exitmasks,
unsigned long *  resulting_mask,
int  space 
)

Definition at line 258 of file bits.c.

References CHECK_BITS_MAGIC, dequeue_blocked(), enqueue_blocked(), exec_fun, flags, likely, RT_SCHED_SEMAPHORE, rt_schedule(), RTE_OBJREM, RTE_UNBLKD, RTP_OBJREM, TEST_BUF, TEST_FUN, test_fun, TEST_MASK, and unlikely.

Here is the call graph for this function:

RTAI_SYSCALL_MODE int _rt_bits_wait_if ( BITS bits,
int  testfun,
unsigned long  testmasks,
int  exitfun,
unsigned long  exitmasks,
unsigned long *  resulting_mask,
int  space 
)

Definition at line 304 of file bits.c.

References CHECK_BITS_MAGIC, exec_fun, flags, and test_fun.

RTAI_SYSCALL_MODE int _rt_bits_wait_timed ( BITS bits,
int  testfun,
unsigned long  testmasks,
int  exitfun,
unsigned long  exitmasks,
RTIME  delay,
unsigned long *  resulting_mask,
int  space 
)

Definition at line 382 of file bits.c.

References _rt_bits_wait_until().

Here is the call graph for this function:

RTAI_SYSCALL_MODE int _rt_bits_wait_until ( BITS bits,
int  testfun,
unsigned long  testmasks,
int  exitfun,
unsigned long  exitmasks,
RTIME  time,
unsigned long *  resulting_mask,
int  space 
)

Definition at line 330 of file bits.c.

References CHECK_BITS_MAGIC, dequeue_blocked(), enqueue_blocked(), exec_fun, flags, likely, RT_SCHED_DELAYED, RT_SCHED_SEMAPHORE, rt_schedule(), RTE_OBJREM, RTE_TIMOUT, RTE_UNBLKD, RTP_HIGERR, RTP_OBJREM, TEST_BUF, TEST_FUN, test_fun, TEST_MASK, and unlikely.

Referenced by _rt_bits_wait_timed().

Here is the call graph for this function:

static int all_clr ( BITS bits,
unsigned long  mask 
) [static]

Definition at line 45 of file bits.c.

static int all_clr_and_any_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 80 of file bits.c.

References MASK0, and MASK1.

static int all_clr_or_any_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 110 of file bits.c.

References MASK0, and MASK1.

static int all_set ( BITS bits,
unsigned long  mask 
) [static]

Definition at line 35 of file bits.c.

static int all_set_and_all_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 60 of file bits.c.

References MASK0, and MASK1.

static int all_set_and_any_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 65 of file bits.c.

References MASK0, and MASK1.

static int all_set_and_any_set ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 55 of file bits.c.

References MASK0, and MASK1.

static int all_set_or_all_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 90 of file bits.c.

References MASK0, and MASK1.

static int all_set_or_any_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 95 of file bits.c.

References MASK0, and MASK1.

static int all_set_or_any_set ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 85 of file bits.c.

References MASK0, and MASK1.

static int any_clr ( BITS bits,
unsigned long  mask 
) [static]

Definition at line 50 of file bits.c.

static int any_set ( BITS bits,
unsigned long  mask 
) [static]

Definition at line 40 of file bits.c.

static int any_set_and_all_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 70 of file bits.c.

References MASK0, and MASK1.

static int any_set_and_any_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 75 of file bits.c.

References MASK0, and MASK1.

static int any_set_or_all_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 100 of file bits.c.

References MASK0, and MASK1.

static int any_set_or_any_clr ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 105 of file bits.c.

References MASK0, and MASK1.

static void clr_bits_mask ( BITS bits,
unsigned long  mask 
) [static]

Definition at line 120 of file bits.c.

EXPORT_SYMBOL ( rt_bits_delete_u   ) 

EXPORT_SYMBOL ( rt_bits_init_u   ) 

EXPORT_SYMBOL ( rt_named_bits_delete   ) 

EXPORT_SYMBOL ( rt_named_bits_init   ) 

EXPORT_SYMBOL ( _rt_bits_wait_timed   ) 

EXPORT_SYMBOL ( _rt_bits_wait_until   ) 

EXPORT_SYMBOL ( _rt_bits_wait_if   ) 

EXPORT_SYMBOL ( _rt_bits_wait   ) 

EXPORT_SYMBOL ( rt_bits_signal   ) 

EXPORT_SYMBOL ( rt_bits_reset   ) 

EXPORT_SYMBOL ( rt_get_bits   ) 

EXPORT_SYMBOL ( rt_bits_delete   ) 

EXPORT_SYMBOL ( rt_bits_init   ) 

module_exit ( __rtai_bits_exit   ) 

module_init ( __rtai_bits_init   ) 

MODULE_LICENSE ( "GPL"   ) 

static void nop_fun ( BITS bits,
unsigned long  mask 
) [static]

Definition at line 130 of file bits.c.

void reset_rt_fun_entries ( struct rt_native_fun_entry *  entry  ) 

Definition at line 1696 of file sched.c.

Referenced by __rtai_bits_exit(), __rtai_mbx_exit(), __rtai_mq_exit(), __rtai_msg_exit(), __rtai_msg_queue_exit(), __rtai_netrpc_exit(), __rtai_sem_exit(), lxrt_exit(), and set_rt_fun_entries().

int rt_bits_delete ( BITS bits  ) 

Definition at line 162 of file bits.c.

References CHECK_BITS_MAGIC, flags, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_SEMAPHORE, RTP_OBJREM, and task.

RTAI_SYSCALL_MODE int rt_bits_delete_u ( BITS bits  ) 

Definition at line 435 of file bits.c.

References rt_bits_delete(), rt_drg_on_adr(), and rt_free().

Here is the call graph for this function:

void rt_bits_init ( BITS bits,
unsigned long  mask 
)

Definition at line 153 of file bits.c.

References RT_BITS_MAGIC.

RTAI_SYSCALL_MODE void* rt_bits_init_u ( unsigned long  name,
unsigned long  mask 
)

Definition at line 418 of file bits.c.

References current, IS_BIT, rt_bits_init(), rt_free(), rt_get_adr(), rt_malloc(), and rt_register().

Here is the call graph for this function:

RTAI_SYSCALL_MODE unsigned long rt_bits_reset ( BITS bits,
unsigned long  mask 
)

Definition at line 198 of file bits.c.

References CHECK_BITS_MAGIC, dequeue_blocked(), flags, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_SEMAPHORE, and task.

Here is the call graph for this function:

RTAI_SYSCALL_MODE unsigned long rt_bits_signal ( BITS bits,
int  setfun,
unsigned long  masks 
)

Definition at line 227 of file bits.c.

References CHECK_BITS_MAGIC, dequeue_blocked(), exec_fun, flags, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_SEMAPHORE, task, TEST_FUN, test_fun, and TEST_MASK.

Here is the call graph for this function:

RTAI_SYSCALL_MODE unsigned long rt_get_bits ( BITS bits  ) 

Definition at line 193 of file bits.c.

RTAI_SYSCALL_MODE int rt_named_bits_delete ( BITS bits  ) 

Definition at line 410 of file bits.c.

References rt_bits_delete(), rt_drg_on_adr(), and rt_free().

Here is the call graph for this function:

RTAI_SYSCALL_MODE BITS* rt_named_bits_init ( const char *  bits_name,
unsigned long  mask 
)

Definition at line 391 of file bits.c.

References IS_BIT, rt_bits_delete(), rt_bits_init(), rt_free(), rt_get_adr(), rt_malloc(), and rt_register().

Here is the call graph for this function:

static void set_bits_mask ( BITS bits,
unsigned long  mask 
) [static]

Definition at line 115 of file bits.c.

static void set_clr_bits_mask ( BITS bits,
unsigned long  masks 
) [static]

Definition at line 125 of file bits.c.

References MASK0, and MASK1.

int set_rt_fun_entries ( struct rt_native_fun_entry *  entry  ) 

Definition at line 1708 of file sched.c.

Referenced by __rtai_bits_init(), __rtai_mbx_init(), __rtai_mq_init(), __rtai_msg_init(), __rtai_msg_queue_init(), __rtai_netrpc_init(), __rtai_sem_init(), __rtai_shm_init(), and lxrt_init().


Variable Documentation

void(*[]) exec_fun(BITS *, unsigned long) [static]

Initial value:

Definition at line 144 of file bits.c.

Referenced by _rt_bits_wait(), _rt_bits_wait_if(), _rt_bits_wait_until(), and rt_bits_signal().

struct rt_native_fun_entry rt_bits_entries[]

Initial value:

Definition at line 446 of file bits.c.

int(*[]) test_fun(BITS *, unsigned long) [static]

Initial value:

Definition at line 134 of file bits.c.

Referenced by _rt_bits_wait(), _rt_bits_wait_if(), _rt_bits_wait_until(), and rt_bits_signal().


Generated on Tue Feb 2 17:47:29 2010 for RTAI API by  doxygen 1.4.7