Module: xenomai-jki
Branch: for-upstream
Commit: 749a8d8b805712a2bbe40fffb3d76f916ed46ab0
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=749a8d8b805712a2bbe40fffb3d76f916ed46ab0

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Thu Sep  2 13:47:45 2010 +0200

x86: Fire root preemption notifier

This allows the use KVM aside Xenomai user space tasks on x86 targets.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/asm-generic/hal.h     |    5 +++++
 include/asm-x86/bits/pod_32.h |    2 ++
 include/asm-x86/bits/pod_64.h |    2 ++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index 940320d..b99e4bc 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -190,6 +190,11 @@ typedef spinlock_t rthal_spinlock_t;
 #define rthal_setsched_root(t,pol,prio)        
ipipe_setscheduler_root(t,pol,prio)
 #define rthal_reenter_root(t,pol,prio) ipipe_reenter_root(t,pol,prio)
 #define rthal_read_tsc(v)              ipipe_read_tsc(v)
+#ifdef __IPIPE_FEATURE_ROOTPREEMPT_NOTIFIER
+#define rthal_root_preempt_notify()    ipipe_root_preempt_notify()
+#else /* !__IPIPE_FEATURE_ROOTPREEMPT_NOTIFIER */
+#define rthal_root_preempt_notify()    do { } while (0)
+#endif /* !__IPIPE_FEATURE_ROOTPREEMPT_NOTIFIER */
 
 #define rthal_emergency_console()                              \
        do {                                                    \
diff --git a/include/asm-x86/bits/pod_32.h b/include/asm-x86/bits/pod_32.h
index b23b6f2..500d4a5 100644
--- a/include/asm-x86/bits/pod_32.h
+++ b/include/asm-x86/bits/pod_32.h
@@ -42,6 +42,8 @@ void xnpod_delete_thread(struct xnthread *);
 
 static inline void xnarch_leave_root(xnarchtcb_t * rootcb)
 {
+       rthal_root_preempt_notify();
+
        /* Remember the preempted Linux task pointer. */
        rootcb->user_task = rootcb->active_task = current;
        rootcb->ts_usedfpu = wrap_test_fpu_used(current) != 0;
diff --git a/include/asm-x86/bits/pod_64.h b/include/asm-x86/bits/pod_64.h
index 88e049d..46bd380 100644
--- a/include/asm-x86/bits/pod_64.h
+++ b/include/asm-x86/bits/pod_64.h
@@ -41,6 +41,8 @@ void xnpod_delete_thread(struct xnthread *);
 
 static inline void xnarch_leave_root(xnarchtcb_t *rootcb)
 {
+       rthal_root_preempt_notify();
+
        /* Remember the preempted Linux task pointer. */
        rootcb->user_task = rootcb->active_task = current;
        rootcb->rspp = &current->thread.x86reg_sp;


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

Reply via email to