Module: xenomai-gch
Branch: for-3.0.x
Commit: 1ef53f4913bcb1835d7468ba029787a311f5fa0c
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=1ef53f4913bcb1835d7468ba029787a311f5fa0c

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 |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c
index 46fe764..821c573 100644
--- a/kernel/cobalt/posix/process.c
+++ b/kernel/cobalt/posix/process.c
@@ -720,6 +720,7 @@ static inline int handle_exception(struct ipipe_trap_data 
*d)
 {
        struct xnthread *thread;
        struct xnsched *sched;
+       spl_t s;
 
        sched = xnsched_current();
        thread = sched->curr;
@@ -732,10 +733,13 @@ static inline int handle_exception(struct ipipe_trap_data 
*d)
        if (xnarch_fault_fpu_p(d)) {
 #ifdef CONFIG_XENO_ARCH_FPU
                /* 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