cregit-Linux how code gets into the kernel

Release 4.14 arch/xtensa/include/asm/timex.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 - 2013 Tensilica Inc.
 */

#ifndef _XTENSA_TIMEX_H

#define _XTENSA_TIMEX_H

#include <asm/processor.h>
#include <linux/stringify.h>

#if XCHAL_NUM_TIMERS > 0 && \
	XTENSA_INT_LEVEL(XCHAL_TIMER0_INTERRUPT) <= XCHAL_EXCM_LEVEL

# define LINUX_TIMER     0

# define LINUX_TIMER_INT XCHAL_TIMER0_INTERRUPT
#elif XCHAL_NUM_TIMERS > 1 && \
	XTENSA_INT_LEVEL(XCHAL_TIMER1_INTERRUPT) <= XCHAL_EXCM_LEVEL

# define LINUX_TIMER     1

# define LINUX_TIMER_INT XCHAL_TIMER1_INTERRUPT
#elif XCHAL_NUM_TIMERS > 2 && \
	XTENSA_INT_LEVEL(XCHAL_TIMER2_INTERRUPT) <= XCHAL_EXCM_LEVEL

# define LINUX_TIMER     2

# define LINUX_TIMER_INT XCHAL_TIMER2_INTERRUPT
#else
# error "Bad timer number for Linux configurations!"
#endif

extern unsigned long ccount_freq;


typedef unsigned long long cycles_t;


#define get_cycles()	(0)

void local_timer_setup(unsigned cpu);

/*
 * Register access.
 */


#define WSR_CCOUNT(r)	  asm volatile ("wsr %0, ccount" :: "a" (r))

#define RSR_CCOUNT(r)	  asm volatile ("rsr %0, ccount" : "=a" (r))

#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) :: "a"(r))

#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) : "=a"(r))


static inline unsigned long get_ccount (void) { unsigned long ccount; RSR_CCOUNT(ccount); return ccount; }

Contributors

PersonTokensPropCommitsCommitProp
Chris Zankel22100.00%1100.00%
Total22100.00%1100.00%


static inline void set_ccount (unsigned long ccount) { WSR_CCOUNT(ccount); }

Contributors

PersonTokensPropCommitsCommitProp
Chris Zankel16100.00%1100.00%
Total16100.00%1100.00%


static inline unsigned long get_linux_timer (void) { unsigned ccompare; RSR_CCOMPARE(LINUX_TIMER, ccompare); return ccompare; }

Contributors

PersonTokensPropCommitsCommitProp
Chris Zankel23100.00%1100.00%
Total23100.00%1100.00%


static inline void set_linux_timer (unsigned long ccompare) { WSR_CCOMPARE(LINUX_TIMER, ccompare); }

Contributors

PersonTokensPropCommitsCommitProp
Chris Zankel18100.00%1100.00%
Total18100.00%1100.00%

#endif /* _XTENSA_TIMEX_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
Chris Zankel18483.26%225.00%
Max Filippov3013.57%450.00%
Marc Gauthier62.71%112.50%
Baruch Siach10.45%112.50%
Total221100.00%8100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.