cregit-Linux how code gets into the kernel

Release 4.14 arch/xtensa/include/asm/delay.h

/*
 * include/asm-xtensa/delay.h
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2001 - 2005 Tensilica Inc.
 *
 */

#ifndef _XTENSA_DELAY_H

#define _XTENSA_DELAY_H

#include <asm/timex.h>
#include <asm/param.h>

extern unsigned long loops_per_jiffy;


static inline void __delay(unsigned long loops) { if (__builtin_constant_p(loops) && loops < 2) __asm__ __volatile__ ("nop"); else if (loops >= 2) /* 2 cycles per loop. */ __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b" : "+r" (loops)); }

Contributors

PersonTokensPropCommitsCommitProp
Max Filippov2261.11%133.33%
Chris Zankel1233.33%133.33%
Adrian Bunk25.56%133.33%
Total36100.00%3100.00%

/* Undefined function to get compile-time error */ void __bad_udelay(void); void __bad_ndelay(void); #define __MAX_UDELAY 30000 #define __MAX_NDELAY 30000
static inline void __udelay(unsigned long usecs) { unsigned long start = get_ccount(); unsigned long cycles = (usecs * (ccount_freq >> 15)) >> 5; /* Note: all variables are unsigned (can wrap around)! */ while (((unsigned long)get_ccount()) - start < cycles) cpu_relax(); }

Contributors

PersonTokensPropCommitsCommitProp
Chris Zankel3973.58%133.33%
Max Filippov1222.64%133.33%
Baruch Siach23.77%133.33%
Total53100.00%3100.00%


static inline void udelay(unsigned long usec) { if (__builtin_constant_p(usec) && usec >= __MAX_UDELAY) __bad_udelay(); else __udelay(usec); }

Contributors

PersonTokensPropCommitsCommitProp
Max Filippov3096.77%150.00%
Chris Zankel13.23%150.00%
Total31100.00%2100.00%


static inline void __ndelay(unsigned long nsec) { /* * Inner shift makes sure multiplication doesn't overflow * for legitimate nsec values */ unsigned long cycles = (nsec * (ccount_freq >> 15)) >> 15; __delay(cycles); }

Contributors

PersonTokensPropCommitsCommitProp
Max Filippov33100.00%1100.00%
Total33100.00%1100.00%

#define ndelay(n) ndelay(n)
static inline void ndelay(unsigned long nsec) { if (__builtin_constant_p(nsec) && nsec >= __MAX_NDELAY) __bad_ndelay(); else __ndelay(nsec); }

Contributors

PersonTokensPropCommitsCommitProp
Max Filippov31100.00%1100.00%
Total31100.00%1100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Max Filippov15667.24%350.00%
Chris Zankel7130.60%116.67%
Baruch Siach31.29%116.67%
Adrian Bunk20.86%116.67%
Total232100.00%6100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.