projects/linux·blob master · refs

29 lines · 647 B

1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * linux/include/asm-alpha/timex.h
4 *
5 * ALPHA architecture timex specifications
6 */
7#ifndef _ASMALPHA_TIMEX_H
8#define _ASMALPHA_TIMEX_H
9
10/*
11 * Standard way to access the cycle counter.
12 * Currently only used on SMP for scheduling.
13 *
14 * Only the low 32 bits are available as a continuously counting entity.
15 * But this only means we'll force a reschedule every 8 seconds or so,
16 * which isn't an evil thing.
17 */
18
19typedef unsigned int cycles_t;
20
21static inline cycles_t get_cycles (void)
22{
23 cycles_t ret;
24 __asm__ __volatile__ ("rpcc %0" : "=r"(ret));
25 return ret;
26}
27#define get_cycles get_cycles
28
29#endif