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

TOMOYO Linux Cross Reference
Linux/arch/arm/include/asm/delay.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arm/include/asm/delay.h (Architecture m68k) and /arch/sparc64/include/asm-sparc64/delay.h (Architecture sparc64)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * Copyright (C) 1995-2004 Russell King           
  4  *                                                
  5  * Delay routines, using a pre-computed "loops    
  6  */                                               
  7 #ifndef __ASM_ARM_DELAY_H                         
  8 #define __ASM_ARM_DELAY_H                         
  9                                                   
 10 #include <asm/page.h>                             
 11 #include <asm/param.h>  /* HZ */                  
 12                                                   
 13 /*                                                
 14  * Loop (or tick) based delay:                    
 15  *                                                
 16  * loops = loops_per_jiffy * jiffies_per_sec *    
 17  *                                                
 18  * where:                                         
 19  *                                                
 20  * jiffies_per_sec = HZ                           
 21  * us_per_sec = 1000000                           
 22  *                                                
 23  * Therefore the constant part is HZ / 1000000    
 24  * fractional number. To make this usable with    
 25  * scale up this constant by 2^31, perform the    
 26  * and scale the result back down by 2^31 with    
 27  *                                                
 28  * loops = (loops_per_jiffy * delay_us * UDELA    
 29  *                                                
 30  * where:                                         
 31  *                                                
 32  * UDELAY_MULT = 2^31 * HZ / 1000000              
 33  *             = (2^31 / 1000000) * HZ            
 34  *             = 2147.483648 * HZ                 
 35  *             = 2147 * HZ + 483648 * HZ / 100    
 36  *                                                
 37  * 31 is the biggest scale shift value that wo    
 38  * delay_us * UDELAY_MULT assuming HZ <= 1000     
 39  */                                               
 40 #define MAX_UDELAY_MS   2                         
 41 #define UDELAY_MULT     UL(2147 * HZ + 483648     
 42 #define UDELAY_SHIFT    31                        
 43                                                   
 44 #ifndef __ASSEMBLY__                              
 45                                                   
 46 struct delay_timer {                              
 47         unsigned long (*read_current_timer)(vo    
 48         unsigned long freq;                       
 49 };                                                
 50                                                   
 51 extern struct arm_delay_ops {                     
 52         void (*delay)(unsigned long);             
 53         void (*const_udelay)(unsigned long);      
 54         void (*udelay)(unsigned long);            
 55         unsigned long ticks_per_jiffy;            
 56 } arm_delay_ops;                                  
 57                                                   
 58 #define __delay(n)              arm_delay_ops.    
 59                                                   
 60 /*                                                
 61  * This function intentionally does not exist;    
 62  * it, it means that you're calling udelay() w    
 63  *                                                
 64  * With currently imposed limits, this means t    
 65  * of 2000us. Further limits: HZ<=1000            
 66  */                                               
 67 extern void __bad_udelay(void);                   
 68                                                   
 69 /*                                                
 70  * division by multiplication: you don't have     
 71  * loss of precision.                             
 72  *                                                
 73  * Use only for very small delays ( < 2 msec).    
 74  * lookup table, really, as the multiplication    
 75  * short delays.  This is a "reasonable" imple    
 76  * first constant multiplications gets optimiz    
 77  * a constant)                                    
 78  */                                               
 79 #define __udelay(n)             arm_delay_ops.    
 80 #define __const_udelay(n)       arm_delay_ops.    
 81                                                   
 82 #define udelay(n)                                 
 83         (__builtin_constant_p(n) ?                
 84           ((n) > (MAX_UDELAY_MS * 1000) ? __ba    
 85                         __const_udelay((n) * U    
 86           __udelay(n))                            
 87                                                   
 88 /* Loop-based definitions for assembly code. *    
 89 extern void __loop_delay(unsigned long loops);    
 90 extern void __loop_udelay(unsigned long usecs)    
 91 extern void __loop_const_udelay(unsigned long)    
 92                                                   
 93 /* Delay-loop timer registration. */              
 94 #define ARCH_HAS_READ_CURRENT_TIMER               
 95 extern void register_current_timer_delay(const    
 96                                                   
 97 #endif /* __ASSEMBLY__ */                         
 98                                                   
 99 #endif /* defined(_ARM_DELAY_H) */                
100                                                   
101                                                   

~ [ 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