On 17 Mar 2002, Oleg Goldshmidt wrote:

> Shlomi Fish <[EMAIL PROTECTED]> writes:
>
> > 1. Rip the i386's log implementation from glibc and use it for i386
> > modules. It was very hard.
> >
> > 2. Write a portable implementation of log in C, and then compile it for
> > every architecture. However, I discovered that running FPU code in the
> > SPARC kernel was not allowed. It may be of use on other
> > architectures.
>
> I only need i386. There seems to be some FPU (not math) stuff in the
> kernel. Did you write log from scratch, or did you use some available
> code?

I ripped the glibc code and then modified it so it compiles cleanly.

> What can you say about precision and performance?
>

It yields the same results as the glibc function (quite logically, since
it's the same codebase). As for performance - I did not benchmark it. It
is written in Assembly and uses the FPU's built-in log function so it
should be very fast.

> > You can find the code in the IP-Noise CVS. Send me a private E-mail for
> > the exact URL.
>
> Yes, please.
>

Check:

http://cvs.berlios.de/cgi-bin/cvsweb.cgi/C/arbitrator/e_log.s?cvsroot=ip-noise

Compile with "kgcc -c".

> > I read somewhere that kernel modules are not supposed to use FPU code,
> > because the registers are not protected when switching from user-land to
> > kernel-land. So far it did not disturb us, but it is an issue one should
> > be aware of.
>
> Why is that relevant if you and your math are both inside the kernel?
>

If you wrote a kernel device driver that uses FPU and the program that
uses it also uses FPU, then it is possible that there will be errors
because the context is not saved.

Regards,

        Shlomi Fish

> Thanks,
>
> --
> Oleg Goldshmidt | [EMAIL PROTECTED]
> If it aint't broken it hasn't got enough features yet.
>



----------------------------------------------------------------------
Shlomi Fish        [EMAIL PROTECTED]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [EMAIL PROTECTED]

"Let's suppose you have a table with 2^n cups..."
"Wait a second - is n a natural number?"


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to