Why printk in linux kernel modules lacks floating-point support unlike printf
Asked
Active
Viewed 643 times
3
-
1http://stackoverflow.com/questions/13886338/use-of-floating-point-in-the-linux-kernel – gengisdave Jun 30 '15 at 06:31
1 Answers
6
printk
does not have floating-point support because the kernel does not using float point numbers. On certain architectures floating point numbers are treated differently in the sense that they use certain hardware features, x86 FPU for example. This requires saving extra state during kernel to user transitions if the kernel uses the float point processor, just as how the kernel has to save general registers, it would now also have the save FPU state. Also the kernel doesn't really need to use floating point numbers so the necessary state isn't saved and therefore printk
doesn't support printing float point numbers.

missimer
- 4,022
- 1
- 19
- 33