~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/core-api/floating-point.rst

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/core-api/floating-point.rst (Version linux-6.11.5) and /Documentation/core-api/floating-point.rst (Version linux-6.8.12)


  1 .. SPDX-License-Identifier: GPL-2.0+              
  2                                                   
  3 Floating-point API                                
  4 ==================                                
  5                                                   
  6 Kernel code is normally prohibited from using     
  7 instructions, including the C float and double    
  8 system call overhead, because the kernel does     
  9 userspace floating-point register state.          
 10                                                   
 11 However, occasionally drivers or library funct    
 12 This is supported by isolating the functions c    
 13 translation unit (a separate source file), and    
 14 state around calls to those functions. This cr    
 15 floating-point usage.                             
 16                                                   
 17 The reason for this isolation is to prevent th    
 18 touching the FP registers outside these critic    
 19 use FP registers to optimize inlined ``memcpy`    
 20 floating-point registers may be wider than gen    
 21                                                   
 22 Usability of floating-point code within the ke    
 23 Additionally, because a single kernel may be c    
 24 both with and without a floating-point unit, F    
 25 both at build time and at run time.               
 26                                                   
 27 Several architectures implement the generic ke    
 28 ``linux/fpu.h``, as described below. Some othe    
 29 own unique APIs, which are documented separate    
 30                                                   
 31 Build-time API                                    
 32 --------------                                    
 33                                                   
 34 Floating-point code may be built if the option    
 35 is enabled. For C code, such code must be plac    
 36 file must have its compilation flags adjusted     
 37                                                   
 38     CFLAGS_foo.o += $(CC_FLAGS_FPU)               
 39     CFLAGS_REMOVE_foo.o += $(CC_FLAGS_NO_FPU)     
 40                                                   
 41 Architectures are expected to define one or bo    
 42 top-level Makefile as needed. For example::       
 43                                                   
 44     CC_FLAGS_FPU := -mhard-float                  
 45                                                   
 46 or::                                              
 47                                                   
 48     CC_FLAGS_NO_FPU := -msoft-float               
 49                                                   
 50 Normal kernel code is assumed to use the equiv    
 51                                                   
 52 Runtime API                                       
 53 -----------                                       
 54                                                   
 55 The runtime API is provided in ``linux/fpu.h``    
 56 from files implementing FP code (those with th    
 57 above). Instead, it must be included when defi    
 58                                                   
 59 .. c:function:: bool kernel_fpu_available( voi    
 60                                                   
 61         This function reports if floating-poin    
 62         platform. The value returned by this f    
 63         at runtime, so it only needs to be cal    
 64         critical section.                         
 65                                                   
 66 .. c:function:: void kernel_fpu_begin( void )     
 67                 void kernel_fpu_end( void )       
 68                                                   
 69         These functions create a floating-poin    
 70         valid to call ``kernel_fpu_begin()`` a    
 71         ``kernel_fpu_available()`` returned ``    
 72         guaranteed to be callable from (preemp    
 73         context.                                  
 74                                                   
 75         Preemption may be disabled inside crit    
 76         should be minimized. They are *not* re    
 77         caller expects to nest critical sectio    
 78         reference counting.                       
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php