trampoline
trampoline copied to clipboard
Trampoline FPU armv7
Hello Jean-Luc, I have a question. Is it possible in Trampoline to use hardware FPU ? We have one but there was hardly a reference to FPU in the code. Will it work in case of task switch ? I have some problems with my softfpu library from gcc and would like to solve it, using the hardware fpu, but I am not sure if this is supported by the OS. BR Sven Grundmann
Hello Sven,
Currently, it is not possible. It won't work in case of a context switch because the FPU registers are not saved on the stack.
To support a FPU, you need to:
- add an attribute in OS object in the OIL file to indicate the FPU is used (let's say a FPU boolean attribute);
- add code conditional to WITH_FPU macro definition in kernel to perform initializations;
- add flag in the task object OIL description to indicate the task uses the FPU;
- add a flag in the static task descriptor, conditional to WITH_FPU, indicating if the task uses FPU;
- add code in tpl_sc_handler/systick handler/ISR2 handlers that read the flag of the switched tasks to save FP regs and load FP regs when necessary.
Best regards
Jean-Luc Béchennec