You can't call math.h functions from kernel functions, but you can call
them within real time threads. First, you need to set the thread floating
point attribute to TRUE. Either:

pthread_attr_setfp(&thread_attr,1): before you create the thread, or
pthread_setfp_np(thread_name,1): within the thread. I could be wrong on
the pthread_setfp_np syntax...haven't used it in a while...

Then you have to statically link the math library in some funky way that
I don't completely understand. Compile your module with some dummy
name, say 'rt_mod_temp.o'. After you compile your 'rt_mod_temp.o', try

ld -r -static -o rt_mod.o rt_mod_temp.o -L/usr/lib -lc -lm

The -lm is the math library, and you need the -static, I'm not sure
what the -r and -lc are, but this works for me.

-Chuck



On Thu, 15 Feb 2001, Stefano Miotto wrote:

> An easy question:
> I'm a new user of RT-Linux. I'd like to know if it's possible to call
> math.h functions from kernel space in RT Linux version 2.0.
> When I load my modules I get messages saying: unresolved symbol
> 'function name' Do I miss some linking ?
> Thanks. Stefano

Reply via email to