Re: Does the kernel supports floating point operations?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 04, 2005 at 10:19:18AM +0000, dileep reddy wrote:
> Hi,
>    As my subject says, is that supported? I am writing
> a kernel module which extensively uses floating point
> operations. One of the books I went through, mentioned
> that all C types are supported in kernel. But which
> format character is used to print those floting point
> values. When I use %f in printk(), it is printing %f
> as it as on the screen.

The reason it's not permitted is because the kernel doesn't save or
restore the floating point registers when entering and leaving kernel
space. If you use the floating point registers you might end up
changing them for the program running, which they may not expect.

Now, it's probably possible if you code carefully, but I'm not
surprised that printk doesn't support it. Look around for other modules
that do it for hints...

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpDEtgKKxbGA.pgp
Description: PGP signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux