Module: xenomai-head
Branch: master
Commit: 910e54fff28d504cc8dd7d41d013f4f79a5ae809
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=910e54fff28d504cc8dd7d41d013f4f79a5ae809

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Oct 18 17:44:16 2010 +0200

nucleus: remove kernel-space support for handling RT signals

Real-time signal support will be re-implemented from scratch, based on
the MAYDAY support.

This reverts commit b40b368a8e82fca055ce828d29aecc13561e913c.

---

 include/nucleus/shadow.h     |    6 --
 include/nucleus/thread.h     |    5 --
 ksrc/nucleus/pod.c           |    5 +-
 ksrc/nucleus/shadow.c        |  109 +-----------------------------------------
 ksrc/nucleus/thread.c        |    4 --
 ksrc/skins/native/syscall.c  |    1 -
 ksrc/skins/posix/syscall.c   |    1 -
 ksrc/skins/psos+/syscall.c   |    1 -
 ksrc/skins/rtdm/syscall.c    |    1 -
 ksrc/skins/uitron/syscall.c  |    1 -
 ksrc/skins/vrtx/syscall.c    |    1 -
 ksrc/skins/vxworks/syscall.c |    1 -
 12 files changed, 4 insertions(+), 132 deletions(-)

diff --git a/include/nucleus/shadow.h b/include/nucleus/shadow.h
index 88ea023..ad93058 100644
--- a/include/nucleus/shadow.h
+++ b/include/nucleus/shadow.h
@@ -42,14 +42,12 @@ struct pt_regs;
 struct timespec;
 struct timeval;
 struct xntbase;
-union xnsiginfo;
 
 struct xnskin_props {
        const char *name;
        unsigned magic;
        int nrcalls;
        void *(*eventcb)(int, void *);
-       int (*sig_unqueue)(struct xnthread *thread, union xnsiginfo __user *si);
        xnsysent_t *systab;
        struct xntbase **timebasep;
        struct module *module;
@@ -99,10 +97,6 @@ void xnshadow_send_sig(struct xnthread *thread,
 
 void xnshadow_rpi_check(void);
 
-int xnshadow_mark_sig(struct xnthread *thread, unsigned muxid);
-
-void xnshadow_clear_sig(struct xnthread *thread, unsigned muxid);
-
 #ifdef RTHAL_HAVE_RETURN_EVENT
 #define XNARCH_HAVE_MAYDAY  1
 void xnshadow_call_mayday(struct xnthread *thread, int sigtype);
diff --git a/include/nucleus/thread.h b/include/nucleus/thread.h
index 4513383..853a305 100644
--- a/include/nucleus/thread.h
+++ b/include/nucleus/thread.h
@@ -330,8 +330,6 @@ typedef struct xnthread {
 
 #ifdef CONFIG_XENO_OPT_PERVASIVE
        unsigned long __user *u_mode;   /* Thread mode variable in userland. */
-
-       unsigned u_sigpending;          /* One bit per skin */
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
 
     XNARCH_DECL_DISPLAY_CONTEXT();
@@ -392,9 +390,6 @@ typedef struct xnhook {
 #define xnthread_get_exectime(thread)      
xnstat_exectime_get_total(&(thread)->stat.account)
 #define xnthread_get_lastswitch(thread)    
xnstat_exectime_get_last_switch((thread)->sched)
 #ifdef CONFIG_XENO_OPT_PERVASIVE
-#define xnthread_sigpending(thread) ((thread)->u_sigpending)
-#define xnthread_set_sigpending(thread, pending) \
-       ((thread)->u_sigpending = (pending))
 #define xnthread_inc_rescnt(thread)        ({ (thread)->hrescnt++; })
 #define xnthread_dec_rescnt(thread)        ({ --(thread)->hrescnt; })
 #define xnthread_get_rescnt(thread)        ((thread)->hrescnt)
diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index 04e9d67..f45866b 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -1406,9 +1406,8 @@ void xnpod_suspend_thread(xnthread_t *thread, xnflags_t 
mask,
                 * context, to collect and act upon the pending Linux
                 * signal.
                 */
-               if ((mask & XNRELAX) == 0
-                   && (xnthread_sigpending(thread)
-                       || xnthread_test_info(thread, XNKICKED))) {
+               if ((mask & XNRELAX) == 0 &&
+                   xnthread_test_info(thread, XNKICKED)) {
                        xnthread_clear_info(thread, XNRMID | XNTIMEO);
                        xnthread_set_info(thread, XNBREAK);
                        goto unlock_and_exit;
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 667195c..a8098f5 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -666,47 +666,6 @@ static inline void ppd_remove_mm(struct mm_struct *mm,
        xnlock_put_irqrestore(&nklock, s);
 }
 
-/**
- * Mark the per-thread per-skin signal condition for the skin whose
- * muxid is @a muxid.
- *
- * @param thread the target thread;
- * @param muxid the muxid of the skin for which the signal is marked
- * pending.
- *
- * @return whether rescheduling is needed.
- */
-int xnshadow_mark_sig(xnthread_t *thread, unsigned muxid)
-{
-       int need_resched = 0;
-
-       if (xnthread_test_state(thread, XNMAPPED)) {
-               spl_t s;
-
-               xnlock_get_irqsave(&nklock, s);
-               thread->u_sigpending |= (1 << muxid);
-               need_resched = xnpod_unblock_thread(thread);
-               xnlock_put_irqrestore(&nklock, s);
-       }
-
-       return need_resched;
-}
-EXPORT_SYMBOL_GPL(xnshadow_mark_sig);
-
-/**
- * Clear the per-thrad per-skin signal condition.
- *
- * Called with nklock locked irqs off.
- *
- * @param thread the target thrad
- * @param muxid
- */
-void xnshadow_clear_sig(xnthread_t *thread, unsigned muxid)
-{
-       thread->u_sigpending &= ~(1 << muxid);
-}
-EXPORT_SYMBOL_GPL(xnshadow_clear_sig);
-
 struct xnvdso *nkvdso;
 EXPORT_SYMBOL_GPL(nkvdso);
 
@@ -724,50 +683,6 @@ void __init xnheap_init_vdso(void)
        nkvdso->features = XNVDSO_FEATURES;
 }
 
-static inline void handle_rt_signals(xnthread_t *thread,
-                                    struct pt_regs *regs,
-                                    int sysflags)
-{
-       int (*sig_unqueue)(xnthread_t *thread, union xnsiginfo __user *si);
-       struct xnsig __user *u_sigs;
-       const unsigned max_sigs = ARRAY_SIZE(u_sigs->pending);
-       unsigned int muxid, i, pending;
-       int rc, res = -ERESTART;
-
-       u_sigs = (struct xnsig __user *)__xn_reg_sigp(regs);
-       if (u_sigs == NULL)
-               goto out;
-
-       i = 0;
-       pending = xnthread_sigpending(thread);
-       do {
-               muxid = ffnz(pending);
-               sig_unqueue = muxtable[muxid].props->sig_unqueue;
-
-               do {
-                       __xn_put_user(muxid, &u_sigs->pending[i].muxid);
-                       rc = sig_unqueue(thread, &u_sigs->pending[i].si);
-                       if (res == -ERESTART)
-                               res = rc;
-                       ++i;
-                       pending = xnthread_sigpending(thread);
-               } while ((pending & (1 << muxid)) && i < max_sigs);
-
-       } while (pending && i < max_sigs);
-       __xn_put_user(i, &u_sigs->nsigs);
-       __xn_put_user(pending != 0, &u_sigs->remaining);
-
-out:
-/* In the case when we are going to handle linux signals, do not let
-   the kernel handle the syscall restart to give a chance to the
-   xenomai handlers to be executed. */
-       if (__xn_interrupted_p(regs)
-           || __xn_reg_rval(regs) == -ERESTARTSYS
-           || __xn_reg_rval(regs) == -ERESTARTNOHAND)
-               __xn_error_return(regs, ((sysflags & __xn_exec_norestart)
-                                        ? -EINTR : res));
-}
-
 static inline void request_syscall_restart(xnthread_t *thread,
                                           struct pt_regs *regs,
                                           int sysflags)
@@ -1445,8 +1360,6 @@ void xnshadow_unmap(xnthread_t *thread)
        p = xnthread_archtcb(thread)->user_task;
 
        xnthread_clear_state(thread, XNMAPPED);
-       xnthread_set_sigpending(thread, 0); /* thread->sipending must be 0 for
-                                    non mapped threads. */
        rpi_pop(thread);
 
        trace_mark(xn_nucleus, shadow_unmap,
@@ -2139,11 +2052,6 @@ static int xnshadow_sys_current_info(struct pt_regs 
*regs)
        return __xn_safe_copy_to_user(us_info, &info, sizeof(*us_info));
 }
 
-static int xnshadow_sys_get_next_sigs(struct pt_regs *regs)
-{
-       return -EINTR;
-}
-
 static int xnshadow_sys_drop_u_mode(struct pt_regs *regs)
 {
        xnthread_t *cur = xnshadow_thread(current);
@@ -2168,8 +2076,6 @@ static xnsysent_t __systab[] = {
        [__xn_sys_current] = {&xnshadow_sys_current, __xn_exec_any},
        [__xn_sys_current_info] =
                {&xnshadow_sys_current_info, __xn_exec_shadow},
-       [__xn_sys_get_next_sigs] =
-               {&xnshadow_sys_get_next_sigs, __xn_exec_conforming},
        [__xn_sys_drop_u_mode] =
                {&xnshadow_sys_drop_u_mode, __xn_exec_shadow},
        [__xn_sys_mayday] = {&xnshadow_sys_mayday, 
__xn_exec_any|__xn_exec_norestart},
@@ -2221,7 +2127,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = xnshadow_sys_event,
-       .sig_unqueue = NULL,
        .timebasep = NULL,
        .module = NULL
 };
@@ -2396,8 +2301,7 @@ static inline int do_hisyscall_event(unsigned event, 
unsigned domid, void *data)
                        sigs = 1;
                        xnthread_clear_amok(thread);
                        request_syscall_restart(thread, regs, sysflags);
-               } else if (!xnthread_sigpending(thread) &&
-                          xnthread_test_state(thread, XNOTHER) &&
+               } else if (xnthread_test_state(thread, XNOTHER) &&
                           xnthread_get_rescnt(thread) == 0) {
                        if (switched)
                                switched = 0;
@@ -2405,10 +2309,6 @@ static inline int do_hisyscall_event(unsigned event, 
unsigned domid, void *data)
                                xnshadow_relax(0, 0);
                }
        }
-       if (thread && xnthread_sigpending(thread)) {
-               sigs = 1;
-               handle_rt_signals(thread, regs, sysflags);
-       }
        if (!sigs && (sysflags & __xn_exec_switchback) != 0 && switched)
                xnshadow_harden();      /* -EPERM will be trapped later if 
needed. */
 
@@ -2568,15 +2468,10 @@ static inline int do_losyscall_event(unsigned event, 
unsigned domid, void *data)
                if (signal_pending(current)) {
                        sigs = 1;
                        request_syscall_restart(thread, regs, sysflags);
-               } else if (!xnthread_sigpending(thread) &&
-                          xnthread_test_state(thread, XNOTHER) &&
+               } else if (xnthread_test_state(thread, XNOTHER) &&
                           xnthread_get_rescnt(thread) == 0)
                        sysflags |= __xn_exec_switchback;
        }
-       if (thread && xnthread_sigpending(thread)) {
-               sigs = 1;
-               handle_rt_signals(thread, regs, sysflags);
-       }
        if (!sigs && (sysflags & __xn_exec_switchback) != 0 && switched)
                xnshadow_relax(0, 0);
 
diff --git a/ksrc/nucleus/thread.c b/ksrc/nucleus/thread.c
index 5e63daf..00c92f9 100644
--- a/ksrc/nucleus/thread.c
+++ b/ksrc/nucleus/thread.c
@@ -150,10 +150,6 @@ int xnthread_init(struct xnthread *thread,
 #endif /* CONFIG_XENO_OPT_SELECT */
        initpq(&thread->claimq);
 
-#ifdef CONFIG_XENO_OPT_PERVASIVE
-       xnthread_set_sigpending(thread, 0);
-#endif /* CONFIG_XENO_OPT_PERVASIVE */
-
        thread->sched = sched;
        thread->init_class = sched_class;
        thread->base_class = NULL; /* xnsched_set_policy() will set it. */
diff --git a/ksrc/skins/native/syscall.c b/ksrc/skins/native/syscall.c
index 0a9f039..556c567 100644
--- a/ksrc/skins/native/syscall.c
+++ b/ksrc/skins/native/syscall.c
@@ -4158,7 +4158,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = &__shadow_eventcb,
-       .sig_unqueue = NULL,
        .timebasep = &__native_tbase,
        .module = THIS_MODULE
 };
diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c
index f6eedc2..a814cbc 100644
--- a/ksrc/skins/posix/syscall.c
+++ b/ksrc/skins/posix/syscall.c
@@ -2948,7 +2948,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = &pse51_eventcb,
-       .sig_unqueue = NULL,
        .timebasep = &pse51_tbase,
        .module = THIS_MODULE
 };
diff --git a/ksrc/skins/psos+/syscall.c b/ksrc/skins/psos+/syscall.c
index a00fc81..3f03b5e 100644
--- a/ksrc/skins/psos+/syscall.c
+++ b/ksrc/skins/psos+/syscall.c
@@ -1601,7 +1601,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = &psos_shadow_eventcb,
-       .sig_unqueue = NULL,
        .timebasep = &psos_tbase,
        .module = THIS_MODULE
 };
diff --git a/ksrc/skins/rtdm/syscall.c b/ksrc/skins/rtdm/syscall.c
index 21b771f..0ff5d40 100644
--- a/ksrc/skins/rtdm/syscall.c
+++ b/ksrc/skins/rtdm/syscall.c
@@ -170,7 +170,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = &rtdm_skin_callback,
-       .sig_unqueue = NULL,
        .timebasep = NULL,
        .module = THIS_MODULE
 };
diff --git a/ksrc/skins/uitron/syscall.c b/ksrc/skins/uitron/syscall.c
index 12c8261..3bf9581 100644
--- a/ksrc/skins/uitron/syscall.c
+++ b/ksrc/skins/uitron/syscall.c
@@ -815,7 +815,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = &ui_shadow_eventcb,
-       .sig_unqueue = NULL,
        .timebasep = &ui_tbase,
        .module = THIS_MODULE
 };
diff --git a/ksrc/skins/vrtx/syscall.c b/ksrc/skins/vrtx/syscall.c
index 0c5f342..dba6390 100644
--- a/ksrc/skins/vrtx/syscall.c
+++ b/ksrc/skins/vrtx/syscall.c
@@ -1310,7 +1310,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = NULL,
-       .sig_unqueue = NULL,
        .timebasep = &vrtx_tbase,
        .module = THIS_MODULE
 };
diff --git a/ksrc/skins/vxworks/syscall.c b/ksrc/skins/vxworks/syscall.c
index 1cfb205..3543ad1 100644
--- a/ksrc/skins/vxworks/syscall.c
+++ b/ksrc/skins/vxworks/syscall.c
@@ -1264,7 +1264,6 @@ static struct xnskin_props __props = {
        .nrcalls = sizeof(__systab) / sizeof(__systab[0]),
        .systab = __systab,
        .eventcb = __wind_shadow_eventcb,
-       .sig_unqueue = NULL,
        .timebasep = &wind_tbase,
        .module = THIS_MODULE
 };


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to