Skip to content

Commit cea0fc7

Browse files
committed
Fix FPU usage within interrupt handlers
1 parent 0705aa4 commit cea0fc7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

libogc/lwp_threads.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ void __thread_dispatch_fp(void)
216216
#ifdef _LWPTHREADS_DEBUG
217217
__lwp_dumpcontext_fp(exec,_thr_allocated_fp);
218218
#endif
219-
if(!__lwp_thread_isallocatedfp(exec)) {
219+
if(__lwp_isr_in_progress()) {
220+
if(_thr_allocated_fp) _cpu_context_save_fp(&_thr_allocated_fp->context);
221+
_thr_allocated_fp = NULL;
222+
} else if(!__lwp_thread_isallocatedfp(exec)) {
220223
if(_thr_allocated_fp) _cpu_context_save_fp(&_thr_allocated_fp->context);
221224
_cpu_context_restore_fp(&exec->context);
222225
_thr_allocated_fp = exec;

0 commit comments

Comments
 (0)