18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * OpenRISC Linux 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Linux architectural port borrowing liberally from similar works of 68c2ecf20Sopenharmony_ci * others. All original copyrights apply as per the original source 78c2ecf20Sopenharmony_ci * declaration. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * OpenRISC implementation: 108c2ecf20Sopenharmony_ci * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> 118c2ecf20Sopenharmony_ci */ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#ifndef __ASM_OPENRISC_TIMEX_H 148c2ecf20Sopenharmony_ci#define __ASM_OPENRISC_TIMEX_H 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define get_cycles get_cycles 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include <asm-generic/timex.h> 198c2ecf20Sopenharmony_ci#include <asm/spr.h> 208c2ecf20Sopenharmony_ci#include <asm/spr_defs.h> 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_cistatic inline cycles_t get_cycles(void) 238c2ecf20Sopenharmony_ci{ 248c2ecf20Sopenharmony_ci return mfspr(SPR_TTCR); 258c2ecf20Sopenharmony_ci} 268c2ecf20Sopenharmony_ci#define get_cycles get_cycles 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci/* This isn't really used any more */ 298c2ecf20Sopenharmony_ci#define CLOCK_TICK_RATE 1000 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#define ARCH_HAS_READ_CURRENT_TIMER 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#endif 34