Module: xenomai-3
Branch: next
Commit: 24f4f3d8609cf1b9bfc9f3055211657cd6bf7d28
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=24f4f3d8609cf1b9bfc9f3055211657cd6bf7d28

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Fri Nov 20 14:50:28 2015 +0100

cobalt/fpu: stall head domain to handle fpu fault

Handling an FPU fault and setting the fpu holder must be atomic.

---

 kernel/cobalt/posix/process.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c
index cc056ef..788a24a 100644
--- a/kernel/cobalt/posix/process.c
+++ b/kernel/cobalt/posix/process.c
@@ -731,11 +731,16 @@ static inline int handle_exception(struct ipipe_trap_data 
*d)
 
        if (xnarch_fault_fpu_p(d)) {
 #ifdef CONFIG_XENO_ARCH_FPU
+               spl_t s;
+
                /* FPU exception received in primary mode. */
+               splhigh(s);
                if (xnarch_handle_fpu_fault(sched->fpuholder, thread, d)) {
                        sched->fpuholder = thread;
+                       splexit(s);
                        return 1;
                }
+               splexit(s);
 #endif /* CONFIG_XENO_ARCH_FPU */
                print_symbol("invalid use of FPU in Xenomai context at %s\n",
                             xnarch_fault_pc(d));


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

Reply via email to