On 14 Mar 2002, Oleg Goldshmidt wrote:

>
> Can I use math functions (e.g. exp log) in a Linux kernel module in a
> transparent way? It does not seem to be trivial, and I have not found
> any useful docs, but maybe someone here knows the right trick?
>
> If not, does anyone know glibc well enough to tell me if it is
> possible to rip the right pieces from it and create a "math" module
> from them?
>

Hmmpf. I encountered a similar task in the IP-Noise project when I needed
a log in the kernel. I eventually managed to:

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.

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

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.

Regards,

        Shlomi Fish

> --
> Oleg Goldshmidt | [EMAIL PROTECTED]
> [Lisp] is the only computer language that is beautiful.
>                       - Neal Stephenson
>
> =================================================================
> 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]
>



----------------------------------------------------------------------
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