Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  Copyright IBM Corp. 2004
0004  *
0005  *  Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
0006  */
0007 
0008 #ifndef _S390_CPUTIME_H
0009 #define _S390_CPUTIME_H
0010 
0011 #include <linux/types.h>
0012 #include <asm/timex.h>
0013 
0014 #define CPUTIME_PER_USEC 4096ULL
0015 #define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)
0016 
0017 /* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
0018 
0019 #define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)
0020 
0021 /*
0022  * Convert cputime to microseconds.
0023  */
0024 static inline u64 cputime_to_usecs(const u64 cputime)
0025 {
0026     return cputime >> 12;
0027 }
0028 
0029 /*
0030  * Convert cputime to nanoseconds.
0031  */
0032 #define cputime_to_nsecs(cputime) tod_to_ns(cputime)
0033 
0034 u64 arch_cpu_idle_time(int cpu);
0035 
0036 #define arch_idle_time(cpu) arch_cpu_idle_time(cpu)
0037 
0038 void account_idle_time_irq(void);
0039 
0040 #endif /* _S390_CPUTIME_H */