Jan Kiszka wrote:
> after receiving SIGXCPU for unexpected context switches in a larger
> application, I found out that the T_FPU bit does not seem to be
> recognised on x86 during native task creation. Here is a simple test
> case, watch out for /proc/xenomai/faults after program start and 5 s later:
> #include <native/task.h>
> #include <sys/mman.h>
> float x;
> void task_func(void *p)
> x = 3.14 + (int)p;
> RT_TASK task;
> rt_task_spawn(&task, NULL, 0, 40, T_FPU | T_JOINABLE, task_func, 0);
> return 0;
> Any immediate ideas?
User-space threads always have the FPU bit anyway. When a user-space
thread in primary mode uses FPU for the first time on x86, the FPU
hardware is initialized in the fault handler, this is the expected
behaviour. This allow the nucleus to not switch FPU context for
user-space threads that never use the FPU.
In case of an abnormal FPU fault, the message "invalid use of FPU" is
printed on console.
Xenomai-core mailing list