<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Apr 25, 2017 7:56 AM,  <<a href="mailto:Jan.Sommer@dlr.de">Jan.Sommer@dlr.de</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
We would like to operate the Leon3 FPU in non-standard mode to avoid traps with denormalized numbers and set the corresponding NS bit in the fsr in the init task.<br>
As it turns out this is too late because the rtems tasks are created before that in the constructors of global C++ classes.<br>
That means after the init task is done, the context restore function of RTEMS will restore the fsr of the tasks without the NS bit set.<br>
<br>
Is there a service hook which I could register to set this bit before global class objects are initialized?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">You could consider adding this as a simple device driver.  Set the FPU in the initialization method and have NULL for the other entries. But if the port grabs it from the initial state, this is likely too late.</div><div dir="auto"><br></div><div dir="auto">Assuming this register is inherited and not constructed for each task. This would be in the port's FP context management code. If this is the case, then some score sparc code needs tinkering.</div><div dir="auto"><br></div><div dir="auto">You need to look at the fp context init code for the sparc port. How that is implemented dictates the solution. </div><div dir="auto"><br></div><div dir="auto">Another alternative is to statically configure a user extension that sets this during the begin hook. Configure that extension statically. I think this would work portably from an order of execution view point.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best regards<br>
<br>
   Jan<br>
<br>
<br>
Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)<br>
German Aerospace Center<br>
Simulation and Software Technology | Software for Space Systems and Interactive Visualization | Lilienthalplatz 7 | 38108 Braunschweig | Germany<br>
<br>
Jan Sommer<br>
Telephone <a href="tel:%2B49%20531%20295-2494" value="+495312952494">+49 531 295-2494</a> | Telefax 0531 295-2767 | <a href="mailto:jan.sommer@dlr.de">jan.sommer@dlr.de</a><br>
DLR.de/SC<br>
<br>
______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br>
</blockquote></div><br></div></div></div>