Exists a user function executed before C++ class object initialization?

Joel Sherrill joel at rtems.org
Tue Apr 25 13:15:19 UTC 2017


On Apr 25, 2017 7:56 AM, <Jan.Sommer at dlr.de> wrote:

Hi,

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.
As it turns out this is too late because the rtems tasks are created before
that in the constructors of global C++ classes.
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.

Is there a service hook which I could register to set this bit before
global class objects are initialized?


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.

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.

You need to look at the fp context init code for the sparc port. How that
is implemented dictates the solution.

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.


Best regards

   Jan


Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)
German Aerospace Center
Simulation and Software Technology | Software for Space Systems and
Interactive Visualization | Lilienthalplatz 7 | 38108 Braunschweig | Germany

Jan Sommer
Telephone +49 531 295-2494 | Telefax 0531 295-2767 | jan.sommer at dlr.de
DLR.de/SC

_______________________________________________
users mailing list
users at rtems.org
http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170425/cb5c8870/attachment-0002.html>


More information about the users mailing list