Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * linux/include/asm-alpha/timex.h
0004  *
0005  * ALPHA architecture timex specifications
0006  */
0007 #ifndef _ASMALPHA_TIMEX_H
0008 #define _ASMALPHA_TIMEX_H
0009 
0010 /* With only one or two oddballs, we use the RTC as the ticker, selecting
0011    the 32.768kHz reference clock, which nicely divides down to our HZ.  */
0012 #define CLOCK_TICK_RATE 32768
0013 
0014 /*
0015  * Standard way to access the cycle counter.
0016  * Currently only used on SMP for scheduling.
0017  *
0018  * Only the low 32 bits are available as a continuously counting entity. 
0019  * But this only means we'll force a reschedule every 8 seconds or so,
0020  * which isn't an evil thing.
0021  */
0022 
0023 typedef unsigned int cycles_t;
0024 
0025 static inline cycles_t get_cycles (void)
0026 {
0027     cycles_t ret;
0028     __asm__ __volatile__ ("rpcc %0" : "=r"(ret));
0029     return ret;
0030 }
0031 #define get_cycles get_cycles
0032 
0033 #endif