summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/cputime.h
blob: e5672d6276a60d39b1da4547580eff175b46d298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 *  Copyright IBM Corp. 2004
 *
 *  Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
 */

#ifndef _S390_CPUTIME_H
#define _S390_CPUTIME_H

#include <linux/types.h>

#define CPUTIME_PER_USEC 4096ULL
#define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)

/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */

#define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)

/*
 * Convert cputime to microseconds and back.
 */
static inline u64 cputime_to_usecs(const u64 cputime)
{
	return cputime >> 12;
}

u64 arch_cpu_idle_time(int cpu);

#define arch_idle_time(cpu) arch_cpu_idle_time(cpu)

#endif /* _S390_CPUTIME_H */