[FUSION][PATCH] rt_sem_broadcast() is missing from librtai and syscall table

Philippe Gerum rpm at xenomai.org
Sat Jan 15 12:14:58 CET 2005


On Sat, 2005-01-15 at 01:52, Max Krasnyansky wrote:
> Philippe,
> 
> Here is the patch to expose rt_sem_broadcast() to the user space.
> Basically just cut&paste of rt_sem_v().
> 

Applied, thanks.

> Max
> --
> 
> > RCS file: /cvs/rtai/fusion/skins/rtai/syscall.c,v
> > retrieving revision 1.42
> > diff -u -r1.42 syscall.c
> > --- skins/rtai/syscall.c	12 Jan 2005 10:27:29 -0000	1.42
> > +++ skins/rtai/syscall.c	15 Jan 2005 00:10:10 -0000
> > @@ -861,6 +861,30 @@
> >  }
> >  
> >  /*
> > + * int __rt_sem_broadcast(RT_SEM_PLACEHOLDER *ph)
> > + */
> > +
> > +static int __rt_sem_broadcast (struct task_struct *curr, struct pt_regs *regs)
> > +
> > +{
> > +    RT_SEM_PLACEHOLDER ph;
> > +    RT_SEM *sem;
> > +
> > +    if (!__xn_access_ok(curr,VERIFY_READ,__xn_reg_arg1(regs),sizeof(ph)))
> > +	return -EFAULT;
> > +
> > +    __xn_copy_from_user(curr,&ph,(void __user *)__xn_reg_arg1(regs),sizeof(ph));
> > +
> > +    sem = (RT_SEM *)rt_registry_fetch(ph.opaque);
> > +
> > +    if (!sem)
> > +	return -ESRCH;
> > +
> > +    return rt_sem_broadcast(sem);
> > +}
> > +
> > +
> > +/*
> >   * int __rt_sem_inquire(RT_SEM_PLACEHOLDER *ph,
> >   *                      RT_SEM_INFO *infop)
> >   */
> > @@ -902,6 +926,7 @@
> >  #define __rt_sem_p       __rt_call_not_available
> >  #define __rt_sem_v       __rt_call_not_available
> >  #define __rt_sem_inquire __rt_call_not_available
> > +#define __rt_sem_broadcast __rt_call_not_available
> >  
> >  #endif /* CONFIG_RTAI_OPT_NATIVE_SEM */
> >  
> > @@ -2811,6 +2836,7 @@
> >      [__rtai_sem_delete ] = { &__rt_sem_delete, __xn_flag_anycall },
> >      [__rtai_sem_p ] = { &__rt_sem_p, __xn_flag_regular },
> >      [__rtai_sem_v ] = { &__rt_sem_v, __xn_flag_anycall },
> > +    [__rtai_sem_broadcast ] = { &__rt_sem_broadcast, __xn_flag_anycall },
> >      [__rtai_sem_inquire ] = { &__rt_sem_inquire, __xn_flag_anycall },
> >      [__rtai_event_create ] = { &__rt_event_create, __xn_flag_anycall },
> >      [__rtai_event_bind ] = { &__rt_event_bind, __xn_flag_regular },
> > Index: skins/rtai/syscall.h
> > ===================================================================
> > RCS file: /cvs/rtai/fusion/skins/rtai/syscall.h,v
> > retrieving revision 1.16
> > diff -u -r1.16 syscall.h
> > --- skins/rtai/syscall.h	8 Jan 2005 16:55:01 -0000	1.16
> > +++ skins/rtai/syscall.h	15 Jan 2005 00:10:10 -0000
> > @@ -53,54 +53,55 @@
> >  #define __rtai_sem_delete         27
> >  #define __rtai_sem_p              28
> >  #define __rtai_sem_v              29
> > -#define __rtai_sem_inquire        30
> > -#define __rtai_event_create       31
> > -#define __rtai_event_bind         32
> > -#define __rtai_event_delete       33
> > -#define __rtai_event_wait         34
> > -#define __rtai_event_signal       35
> > -#define __rtai_event_clear        36
> > -#define __rtai_event_inquire      37
> > -#define __rtai_mutex_create       38
> > -#define __rtai_mutex_bind         39
> > -#define __rtai_mutex_delete       40
> > -#define __rtai_mutex_lock         41
> > -#define __rtai_mutex_unlock       42
> > -#define __rtai_mutex_inquire      43
> > -#define __rtai_cond_create        44
> > -#define __rtai_cond_bind          45
> > -#define __rtai_cond_delete        46
> > -#define __rtai_cond_wait          47
> > -#define __rtai_cond_signal        48
> > -#define __rtai_cond_broadcast     49
> > -#define __rtai_cond_inquire       50
> > -#define __rtai_queue_create       51
> > -#define __rtai_queue_bind         52
> > -#define __rtai_queue_delete       53
> > -#define __rtai_queue_alloc        54
> > -#define __rtai_queue_free         55
> > -#define __rtai_queue_send         56
> > -#define __rtai_queue_recv         57
> > -#define __rtai_queue_inquire      58
> > -#define __rtai_heap_create        59
> > -#define __rtai_heap_bind          60
> > -#define __rtai_heap_delete        61
> > -#define __rtai_heap_alloc         62
> > -#define __rtai_heap_free          63
> > -#define __rtai_heap_inquire       64
> > -#define __rtai_alarm_create       65
> > -#define __rtai_alarm_delete       66
> > -#define __rtai_alarm_start        67
> > -#define __rtai_alarm_stop         68
> > -#define __rtai_alarm_wait         69
> > -#define __rtai_alarm_inquire      70
> > -#define __rtai_intr_create        71
> > -#define __rtai_intr_bind          72
> > -#define __rtai_intr_delete        73
> > -#define __rtai_intr_wait          74
> > -#define __rtai_intr_enable        75
> > -#define __rtai_intr_disable       76
> > -#define __rtai_intr_inquire       77
> > +#define __rtai_sem_broadcast      30 
> > +#define __rtai_sem_inquire        31
> > +#define __rtai_event_create       32
> > +#define __rtai_event_bind         33
> > +#define __rtai_event_delete       34
> > +#define __rtai_event_wait         35
> > +#define __rtai_event_signal       36
> > +#define __rtai_event_clear        37
> > +#define __rtai_event_inquire      38
> > +#define __rtai_mutex_create       39
> > +#define __rtai_mutex_bind         40
> > +#define __rtai_mutex_delete       41
> > +#define __rtai_mutex_lock         42
> > +#define __rtai_mutex_unlock       43
> > +#define __rtai_mutex_inquire      44
> > +#define __rtai_cond_create        45
> > +#define __rtai_cond_bind          46
> > +#define __rtai_cond_delete        47
> > +#define __rtai_cond_wait          48
> > +#define __rtai_cond_signal        49
> > +#define __rtai_cond_broadcast     50
> > +#define __rtai_cond_inquire       51
> > +#define __rtai_queue_create       52
> > +#define __rtai_queue_bind         53
> > +#define __rtai_queue_delete       54
> > +#define __rtai_queue_alloc        55
> > +#define __rtai_queue_free         56
> > +#define __rtai_queue_send         57
> > +#define __rtai_queue_recv         58
> > +#define __rtai_queue_inquire      59
> > +#define __rtai_heap_create        60
> > +#define __rtai_heap_bind          61
> > +#define __rtai_heap_delete        62
> > +#define __rtai_heap_alloc         63
> > +#define __rtai_heap_free          64
> > +#define __rtai_heap_inquire       65
> > +#define __rtai_alarm_create       66
> > +#define __rtai_alarm_delete       67
> > +#define __rtai_alarm_start        68
> > +#define __rtai_alarm_stop         69
> > +#define __rtai_alarm_wait         70
> > +#define __rtai_alarm_inquire      71
> > +#define __rtai_intr_create        72
> > +#define __rtai_intr_bind          73
> > +#define __rtai_intr_delete        74
> > +#define __rtai_intr_wait          75
> > +#define __rtai_intr_enable        76
> > +#define __rtai_intr_disable       77
> > +#define __rtai_intr_inquire       78
> >  
> >  struct rt_arg_bulk {
> >  
> > Index: skins/rtai/lib/sem.c
> > ===================================================================
> > RCS file: /cvs/rtai/fusion/skins/rtai/lib/sem.c,v
> > retrieving revision 1.8
> > diff -u -r1.8 sem.c
> > --- skins/rtai/lib/sem.c	3 Jan 2005 14:33:09 -0000	1.8
> > +++ skins/rtai/lib/sem.c	15 Jan 2005 00:10:10 -0000
> > @@ -77,6 +77,14 @@
> >  			     sem);
> >  }
> >  
> > +int rt_sem_broadcast (RT_SEM *sem)
> > +
> > +{
> > +    return XENOMAI_SKINCALL1(__rtai_muxid,
> > +			     __rtai_sem_broadcast,
> > +			     sem);
> > +}
> > +
> >  int rt_sem_inquire (RT_SEM *sem,
> >  		    RT_SEM_INFO *info)
> >  {
> 
> _______________________________________________
> RTAI mailing list
> RTAI at rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
-- 

Philippe.





More information about the Rtai mailing list