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

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

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 1a681ea..ef83fd3 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -198,6 +198,11 @@ typedef spinlock_t rthal_spinlock_t;
 #define rthal_emergency_console()      
ipipe_set_printk_sync(ipipe_current_domain)
 #endif /* !__IPIPE_FEATURE_PREPARE_PANIC */
 #define rthal_read_tsc(v)              ipipe_read_tsc(v)
+#ifdef __IPIPE_FEATURE_ROOT_PREEMPT_NOTIFIER
+#define rthal_root_preempt_notify()    ipipe_root_preempt_notify()
+#else /* !__IPIPE_FEATURE_ROOT_PREEMPT_NOTIFIER */
+#define rthal_root_preempt_notify()    do { } while (0)
+#endif /* !__IPIPE_FEATURE_ROOT_PREEMPT_NOTIFIER */
 
 #ifdef __IPIPE_FEATURE_SYSINFO_V2
        
diff --git a/include/asm-x86/bits/pod_32.h b/include/asm-x86/bits/pod_32.h
index 6e79382..61460bd 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