[Click] ]use of log() funtcion in click?

Eddie Kohler kohler at CS.UCLA.EDU
Thu Dec 16 13:43:21 EST 2004


Hi Michele,

> Dear all,
> I'm working on the Log() function by Giorgio;
> The results of the function _seem_ to be incorrect when a process in
> userspace does a lot of floating point operations.
> I tried with the workaround proposed by Eddie/Linus:
> [CODE]
> ...
> #include <click/cxxprotect.h>
> CLICK_CXX_PROTECT
> #if __i386__
> #include <asm/i387.h>
> #endif
> CLICK_CXX_UNPROTECT
> #include <click/cxxunprotect.h>
> ...
> kernel_fpu_begin();
>  ... Log() ...
> kernel_fpu_end();
> ...
> [/CODE]
>
> But something goes wrong, when I try to launch click:
>
> /usr/local/lib/click.o: unresolved symbol kernel_fpu_begin
> click-install: '/sbin/insmod /usr/local/lib/click.o' failed


Weird.  Check in /proc/ksyms to make sure that the kernel_fpu_begin 
symbol is exported.  If it's not, you'll have to muck with 
kernel/ksyms.c to add the appropriate EXPORT_SYMBOL.

I think Linus was saying that kernel_fpu_begin/end will save the FPU 
state, once you get it working.

Eddie

>
> The function is present in my /boot/System.map, so what's wrong?
>
>
>
> More in general, I found this on the net:
> Rusty Russell about the FPU from his kernel guide:
> [QUOTE]
> "The FPU context is not saved; even in user context the FPU state
> probably
> won't correspond with the current process: you would mess with some 
> user
> process' FPU state. If you really want to do this, you would have to
> explicitly save/restore the full FPU state (and avoid context
> switches)."
> [/QUOTE]
>
> I'm looking for documents or examples that can explain to me [kernel
> newbie ;-)] how to protect the fpu registers, any suggestions?
>
> Thanks in advance,
> Michele
>
> p.s.: sorry for my incorrect english.
>
> -- 
> Michele Mordenti
> http://xoomer.virgilio.it/michele.mordenti
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list