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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jun 24 12:16:27 2010 +0200

nucleus: export xnshadow_call_mayday() as a service

---

 include/asm-arm/bits/shadow.h      |    4 ++--
 include/asm-blackfin/bits/shadow.h |    4 ++--
 include/asm-nios2/bits/shadow.h    |    4 ++--
 include/asm-powerpc/bits/shadow.h  |    4 ++--
 include/asm-powerpc/calibration.h  |    4 ++++
 include/asm-x86/bits/shadow_32.h   |    4 ++--
 include/asm-x86/bits/shadow_64.h   |    4 ++--
 include/nucleus/shadow.h           |    5 +++--
 ksrc/nucleus/sched.c               |    5 ++---
 ksrc/nucleus/shadow.c              |    9 ++++++---
 10 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h
index 6021dad..9fe491a 100644
--- a/include/asm-arm/bits/shadow.h
+++ b/include/asm-arm/bits/shadow.h
@@ -262,9 +262,9 @@ static inline void xnarch_setup_mayday_page(void *page)
        flush_dcache_page(vmalloc_to_page(page));
 }
 
-static inline void xnarch_call_mayday(void)
+static inline void xnarch_call_mayday(struct task_struct *p)
 {
-       rthal_return_intercept(current);
+       rthal_return_intercept(p);
 }
 
 static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
diff --git a/include/asm-blackfin/bits/shadow.h 
b/include/asm-blackfin/bits/shadow.h
index 1a77fe4..778cf30 100644
--- a/include/asm-blackfin/bits/shadow.h
+++ b/include/asm-blackfin/bits/shadow.h
@@ -119,9 +119,9 @@ static inline void xnarch_setup_mayday_page(void *page)
                           (unsigned long)page + sizeof(code));
 }
 
-static inline void xnarch_call_mayday(void)
+static inline void xnarch_call_mayday(struct task_struct *p)
 {
-       rthal_return_intercept(current);
+       rthal_return_intercept(p);
 }
 
 static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
diff --git a/include/asm-nios2/bits/shadow.h b/include/asm-nios2/bits/shadow.h
index 8917045..8133128 100644
--- a/include/asm-nios2/bits/shadow.h
+++ b/include/asm-nios2/bits/shadow.h
@@ -101,9 +101,9 @@ static inline void xnarch_setup_mayday_page(void *page)
                           (unsigned long)page + sizeof(code));
 }
 
-static inline void xnarch_call_mayday(void)
+static inline void xnarch_call_mayday(struct task_struct *p)
 {
-       rthal_return_intercept(current);
+       rthal_return_intercept(p);
 }
 
 static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
diff --git a/include/asm-powerpc/bits/shadow.h 
b/include/asm-powerpc/bits/shadow.h
index 7f3554e..0763c57 100644
--- a/include/asm-powerpc/bits/shadow.h
+++ b/include/asm-powerpc/bits/shadow.h
@@ -95,9 +95,9 @@ static inline void xnarch_setup_mayday_page(void *page)
                           (unsigned long)page + sizeof(insn));
 }
 
-static inline void xnarch_call_mayday(void)
+static inline void xnarch_call_mayday(struct task_struct *p)
 {
-       rthal_return_intercept(current);
+       rthal_return_intercept(p);
 }
 
 static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
diff --git a/include/asm-powerpc/calibration.h 
b/include/asm-powerpc/calibration.h
index 25dd66d..7edf96b 100644
--- a/include/asm-powerpc/calibration.h
+++ b/include/asm-powerpc/calibration.h
@@ -76,6 +76,8 @@ static inline unsigned long xnarch_get_sched_latency(void)
 #define __sched_latency 1000
 #elif defined(CONFIG_TQM8555)
 #define __sched_latency 2000
+#elif defined(CONFIG_KUP4K)
+#define __sched_latency 10000
 /*
  * Check for the most generic configs at the bottom of this list, so
  * that the most specific choices available are picked first.
@@ -86,6 +88,8 @@ static inline unsigned long xnarch_get_sched_latency(void)
 #define __sched_latency 9000
 #elif defined(CONFIG_PPC_MPC52xx)
 #define __sched_latency 4500
+#elif defined(CONFIG_PPC_8xx)
+#define __sched_latency 15000
 #endif
 
 #ifndef __sched_latency
diff --git a/include/asm-x86/bits/shadow_32.h b/include/asm-x86/bits/shadow_32.h
index 40ccc62..c5ce164 100644
--- a/include/asm-x86/bits/shadow_32.h
+++ b/include/asm-x86/bits/shadow_32.h
@@ -135,9 +135,9 @@ static inline void xnarch_setup_mayday_page(void *page)
        /* no cache flush required. */
 }
 
-static inline void xnarch_call_mayday(void)
+static inline void xnarch_call_mayday(struct task_struct *p)
 {
-       rthal_return_intercept(current);
+       rthal_return_intercept(p);
 }
 
 static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
diff --git a/include/asm-x86/bits/shadow_64.h b/include/asm-x86/bits/shadow_64.h
index 41a266f..d347ef6 100644
--- a/include/asm-x86/bits/shadow_64.h
+++ b/include/asm-x86/bits/shadow_64.h
@@ -98,9 +98,9 @@ static inline void xnarch_setup_mayday_page(void *page)
        /* no cache flush required. */
 }
 
-static inline void xnarch_call_mayday(void)
+static inline void xnarch_call_mayday(struct task_struct *p)
 {
-       rthal_return_intercept(current);
+       rthal_return_intercept(p);
 }
 
 static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
diff --git a/include/nucleus/shadow.h b/include/nucleus/shadow.h
index 93e4206..18b4726 100644
--- a/include/nucleus/shadow.h
+++ b/include/nucleus/shadow.h
@@ -111,9 +111,10 @@ 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);
+void xnshadow_call_mayday(struct xnthread *thread, int sigtype);
 #else
-static inline void xnshadow_call_mayday(struct xnthread *thread)
+static inline void xnshadow_call_mayday(struct xnthread *thread,
+                                       int sigtype)
 {
        /* no luck, I-pipe too old. Nobody hears you screaming... */
 }
diff --git a/ksrc/nucleus/sched.c b/ksrc/nucleus/sched.c
index 0b51882..fc3af64 100644
--- a/ksrc/nucleus/sched.c
+++ b/ksrc/nucleus/sched.c
@@ -98,9 +98,8 @@ static void xnsched_watchdog_handler(struct xntimer *timer)
                           thread, xnthread_name(thread));
                xnprintf("watchdog triggered -- signaling runaway thread "
                         "'%s'\n", xnthread_name(thread));
-               xnthread_set_info(thread, XNAMOK | XNKICKED);
-               xnshadow_send_sig(thread, SIGDEBUG, SIGDEBUG_WATCHDOG, 1);
-               xnshadow_call_mayday(thread);
+               xnthread_set_info(thread, XNAMOK);
+               xnshadow_call_mayday(thread, SIGDEBUG_WATCHDOG);
        } else
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
        {
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 80b9caa..9c801aa 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -1618,11 +1618,14 @@ static unsigned long map_mayday_page(struct task_struct 
*p)
        return IS_ERR_VALUE(u_addr) ? 0UL : u_addr;
 }
 
-void xnshadow_call_mayday(struct xnthread *thread)
+void xnshadow_call_mayday(struct xnthread *thread, int sigtype)
 {
-       XENO_BUGON(NUCLEUS, !xnpod_current_p(thread));
-       xnarch_call_mayday();
+       struct task_struct *p = xnthread_archtcb(thread)->user_task;
+       xnthread_set_info(thread, XNKICKED);
+       xnshadow_send_sig(thread, SIGDEBUG, sigtype, 1);
+       xnarch_call_mayday(p);
 }
+EXPORT_SYMBOL_GPL(xnshadow_call_mayday);
 
 static int xnshadow_sys_mayday(struct pt_regs *regs)
 {


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

Reply via email to