[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] Re: math.h library
Bart Thissen wrote:
>
> bionic@vassalboro.bu.edu wrote:
> >
> > 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
> >
>
> I don't think it's a good idea to use user-space clib functions in a kernel-space module!
> Maybe you get away with a few small functions, but I wouldn't try file io...
REMARK.
What above is of no concern anymore. On ix86 newest gccs, e.g. 2.95.2,
use directly the FPU functions in asm code generation. So you need only
to include math.h, no linking with libm any more, in whichever space you
are.
Ciao, Paolo.