Module: xenomai-2.4
Branch: master
Commit: 31cff6aec85db15e14159c2d289c12d6d503bf02
URL:    
http://git.xenomai.org/?p=xenomai-2.4.git;a=commit;h=31cff6aec85db15e14159c2d289c12d6d503bf02

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jun 25 21:50:08 2009 +0200

x86: fix wrap_switch_iobitmap() for 2.6.30

---

 include/asm-x86/wrappers_32.h |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/include/asm-x86/wrappers_32.h b/include/asm-x86/wrappers_32.h
index 144c610..08ad4a1 100644
--- a/include/asm-x86/wrappers_32.h
+++ b/include/asm-x86/wrappers_32.h
@@ -107,7 +107,9 @@ do { \
 #define wrap_iobitmap_base(tss)  (tss)->x86_tss.io_bitmap_base
 #endif
 
-static inline void wrap_switch_iobitmap (struct task_struct *p, int cpu)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+
+static inline void wrap_switch_iobitmap(struct task_struct *p, int cpu)
 {
     struct thread_struct *thread = &p->thread;
 
@@ -133,6 +135,22 @@ static inline void wrap_switch_iobitmap (struct 
task_struct *p, int cpu)
     }
 }
 
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) */
+
+static inline void wrap_switch_iobitmap(struct task_struct *p, int cpu)
+{
+       struct thread_struct *thread = &p->thread;
+       struct tss_struct *tss;
+
+       if (test_tsk_thread_flag(p, TIF_IO_BITMAP)) {
+               tss = &per_cpu(init_tss, cpu);
+               memcpy(tss->io_bitmap, thread->io_bitmap_ptr,
+                      thread->io_bitmap_max);
+       } /* NOTE: We don't clear previous leftover io_bitmap in the tss */
+}
+
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) */
+
 #define wrap_strncpy_from_user(dstP,srcP,n) 
rthal_strncpy_from_user(dstP,srcP,n)
 
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */


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

Reply via email to