[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] Bug in llimd in RTAI (version 1.5 and 1.6)
Laurent.Kersten@alcatel.be wrote:
>
> Hello,
>
> Whether I try to use llimd with a negative number as first argument, I got a crash (or an
> arithmetic exception if I use the function in a normal linux process).
>
> The following call crash : llimd ( -25 000 000,400 000 000, 1000 000)
> But the following seems OK : llimd ( 25 000 000,400 000 000, 1000 000)
>
> In a non RT task, the exception is generated by the first div instruction. According to Intel's
> documentation, it should trigger an exception when the result is too big for the target register, this seems not to be the case (as long as we don't treat the EDX:EAX pairs has an unsigned number but as a negative one, it should be no problem).
>
> Does anybody have a clue for that ?
The name is a misnomer, it should be ullmid. It so by design, it is up
to you to wrap it with a test for the sign. See nano2count and
count2nano in RTAI schedulers.
Ciao, Paolo.