Paul Koning wrote:
> >>>>> "mas" == mas <Jos> writes:
>
> mas> Hello, How can be used the sqrt() function inside an rt-task?
> mas> When I put this function inside an rt-task, the module can not
> mas> be inserted because it can resolve the raise() function (and
> mas> anothers): I think that this function is used to signal the
> mas> kernel when an error is found.
>
> mas> Has anybody some sqrt() funcion suitable for the inclusion in a
> mas> rt-task.
>
> Duplicating sqrt, or typing it in from reference books, seems like a
> silly waste of effort. In general, library functions should be
> directly useable, just link them in.
>
> Here you have a special case because a library function calls an
> operating system service (raise). The obvious solution is to supply a
> version of raise() of your own. As a minimum it could be a null
> function, especially if you are careful in your sqrt() calls so the
> raise won't occur in the first place. Alternatively, it could be some
> sort of error report.
>
> paul
Now that RTLinux uses "finit" to initialise the fpu for RTL tasks there
will be no fp exceptions; default exception actions are taken by the fpu
itself instead.So to use fpu functions you just have to "#include
<math.h>" in your module and do something like "ld -r -static -o
rt_process rt_process.o -L/usr/lib -lm -lc". Note that the last "-lc" is
important to link raise, errno... what? and something else, but they are
never used.
Try it with the sqrt of a negative variable and you'll see that nothing
happens.
If you do not like the fpu default actions then you must write an fpu
exception handler capable of supporting both RTLinux and Linux.
When you'll do I like to have a copy.
Ciao, Paolo.
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/