Module: xenomai-forge
Branch: master
Commit: 59968ff08b1ec5891c4b7ecee13ce96f84307487
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=59968ff08b1ec5891c4b7ecee13ce96f84307487

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Jan  8 14:45:20 2013 +0100

cobalt/nucleus: remove API to set kthread and ASR initial imask

Starting kernel threads and ASRs with (hw) interrupts respectively
enabled and disabled should be the common case. Particular settings
should be enforced by the user code directly.

---

 include/cobalt/nucleus/lock.h       |    9 ---------
 include/cobalt/nucleus/thread.h     |    3 ---
 kernel/cobalt/nucleus/pod.c         |   23 ++---------------------
 kernel/cobalt/nucleus/shadow.c      |    1 -
 kernel/cobalt/nucleus/thread.c      |    1 -
 kernel/cobalt/rtdm/drvlib.c         |    1 -
 kernel/drivers/testing/switchtest.c |    1 -
 7 files changed, 2 insertions(+), 37 deletions(-)

diff --git a/include/cobalt/nucleus/lock.h b/include/cobalt/nucleus/lock.h
index b142e84..56561b3 100644
--- a/include/cobalt/nucleus/lock.h
+++ b/include/cobalt/nucleus/lock.h
@@ -43,15 +43,6 @@ typedef unsigned long spl_t;
 #define splnone()   ipipe_unstall_head()
 #define spltest()   ipipe_test_head()
 
-static inline int xnpod_setimask(int imask)
-{
-       spl_t s;
-
-       splhigh(s);
-       splexit(!!imask);
-       return !!s;
-}
-
 #ifndef CONFIG_XENO_OPT_DEBUG_XNLOCK
 #define CONFIG_XENO_OPT_DEBUG_XNLOCK 0
 #endif
diff --git a/include/cobalt/nucleus/thread.h b/include/cobalt/nucleus/thread.h
index 6fc77d7..bfe561a 100644
--- a/include/cobalt/nucleus/thread.h
+++ b/include/cobalt/nucleus/thread.h
@@ -177,7 +177,6 @@ struct xnthread_init_attr {
 
 struct xnthread_start_attr {
        xnflags_t mode;
-       int imask;
        cpumask_t affinity;
        void (*entry)(void *cookie);
        void *cookie;
@@ -268,8 +267,6 @@ typedef struct xnthread {
 
        unsigned asrlevel;              /* ASR execution level (ASRs are 
reentrant) */
 
-       int imask;                      /* Initial interrupt mask */
-
        int imode;                      /* Initial mode */
 
        struct xnsched_class *init_class; /* Initial scheduling class */
diff --git a/kernel/cobalt/nucleus/pod.c b/kernel/cobalt/nucleus/pod.c
index a822ca2..5d36df4 100644
--- a/kernel/cobalt/nucleus/pod.c
+++ b/kernel/cobalt/nucleus/pod.c
@@ -550,15 +550,6 @@ EXPORT_SYMBOL_GPL(xnpod_init_thread);
  * case, the thread will have to be explicitly resumed using the
  * xnpod_resume_thread() service for its execution to actually begin.
  *
- * - imask: The interrupt mask that should be asserted when the thread
- * starts. The processor interrupt state will be set to the given
- * value when the thread starts running. The interpretation of this
- * value might be different across real-time layers, but a non-zero
- * value should always mark an interrupt masking in effect
- * (e.g. local_irq_disable()). Conversely, a zero value should always
- * mark a fully preemptible state regarding interrupts
- * (e.g. local_irq_enable()).
- *
  * - affinity: The processor affinity of this thread. Passing
  * XNPOD_ALL_CPUS or an empty affinity set means "any cpu".
  *
@@ -628,7 +619,6 @@ int xnpod_start_thread(struct xnthread *thread,
 #endif /* CONFIG_SMP */
 
        xnthread_set_state(thread, (attr->mode & (XNTHREAD_MODE_BITS | XNSUSP)) 
| XNSTARTED);
-       thread->imask = attr->imask;
        thread->imode = (attr->mode & XNTHREAD_MODE_BITS);
        thread->entry = attr->entry;
        thread->cookie = attr->cookie;
@@ -902,9 +892,9 @@ EXPORT_SYMBOL_GPL(xnpod_testcancel_thread);
  * reaches a cancellation point. Cancellation points are defined for
  * the following situations:
  *
- * - @a thread calls xnpod_cancel_thread().
+ * - @a thread self-cancels by a call to xnpod_cancel_thread().
  * - @a thread calls any blocking Xenomai service that would otherwise
- * lead to suspension in xnpod_suspend_thread().
+ * lead to a suspension in xnpod_suspend_thread().
  * - @a thread resumes from xnpod_suspend_thread().
  * - @a thread invokes a Linux syscall (user-space shadow only).
  * - @a thread receives a Linux signal (user-space shadow only).
@@ -1659,7 +1649,6 @@ EXPORT_SYMBOL_GPL(xnpod_migrate_thread);
 void xnpod_dispatch_signals(void)
 {
        xnthread_t *thread = xnpod_current_thread();
-       int asrimask, savedmask;
        xnflags_t oldmode;
        xnsigmask_t sigs;
        xnasr_t asr;
@@ -1677,23 +1666,15 @@ void xnpod_dispatch_signals(void)
        /* Start the asynchronous service routine */
        oldmode = xnthread_test_state(thread, XNTHREAD_MODE_BITS);
        sigs = thread->signals;
-       asrimask = thread->asrimask;
        asr = thread->asr;
 
        /* Clear pending signals mask since an ASR can be reentrant */
        thread->signals = 0;
 
-       /* Reset ASR mode bits */
        xnthread_clear_state(thread, XNTHREAD_MODE_BITS);
        xnthread_set_state(thread, thread->asrmode);
        thread->asrlevel++;
-
-       /* Setup ASR interrupt mask then fire it. */
-       savedmask = xnpod_setimask(asrimask);
        asr(sigs);
-       xnpod_setimask(savedmask);
-
-       /* Reset the thread mode bits */
        thread->asrlevel--;
        xnthread_clear_state(thread, XNTHREAD_MODE_BITS);
        xnthread_set_state(thread, oldmode);
diff --git a/kernel/cobalt/nucleus/shadow.c b/kernel/cobalt/nucleus/shadow.c
index 2966a4f..274c664 100644
--- a/kernel/cobalt/nucleus/shadow.c
+++ b/kernel/cobalt/nucleus/shadow.c
@@ -862,7 +862,6 @@ int xnshadow_map_user(struct xnthread *thread,
                xnthread_set_state(thread, XNOTHER);
 
        attr.mode = 0;
-       attr.imask = 0;
        attr.affinity = affinity;
        attr.entry = NULL;
        attr.cookie = NULL;
diff --git a/kernel/cobalt/nucleus/thread.c b/kernel/cobalt/nucleus/thread.c
index 8c61d4f..38918a6 100644
--- a/kernel/cobalt/nucleus/thread.c
+++ b/kernel/cobalt/nucleus/thread.c
@@ -168,7 +168,6 @@ int xnthread_init(struct xnthread *thread,
        memset(&thread->stat, 0, sizeof(thread->stat));
 
        /* These will be filled by xnpod_start_thread() */
-       thread->imask = 0;
        thread->imode = 0;
        thread->entry = NULL;
        thread->cookie = 0;
diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
index 6bc67ba..ebfb278 100644
--- a/kernel/cobalt/rtdm/drvlib.c
+++ b/kernel/cobalt/rtdm/drvlib.c
@@ -163,7 +163,6 @@ int rtdm_task_init(rtdm_task_t *task, const char *name,
        }
 
        sattr.mode = 0;
-       sattr.imask = 0;
        sattr.affinity = XNPOD_ALL_CPUS;
        sattr.entry = task_proc;
        sattr.cookie = arg;
diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index 72964d3..1376b82 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -476,7 +476,6 @@ static int rtswitch_create_ktask(rtswitch_context_t *ctx,
                                &iattr, &xnsched_class_rt, &param);
        if (!err) {
                sattr.mode = 0;
-               sattr.imask = 0;
                sattr.affinity = cpumask_of_cpu(ctx->cpu);
                sattr.entry = rtswitch_ktask;
                sattr.cookie = &arg;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to