cputime.h 766 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright IBM Corp. 2004
  3. *
  4. * Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
  5. */
  6. #ifndef _S390_CPUTIME_H
  7. #define _S390_CPUTIME_H
  8. #include <linux/types.h>
  9. #include <asm/timex.h>
  10. #define CPUTIME_PER_USEC 4096ULL
  11. #define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)
  12. /* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
  13. #define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)
  14. /*
  15. * Convert cputime to microseconds.
  16. */
  17. static inline u64 cputime_to_usecs(const u64 cputime)
  18. {
  19. return cputime >> 12;
  20. }
  21. /*
  22. * Convert cputime to nanoseconds.
  23. */
  24. #define cputime_to_nsecs(cputime) tod_to_ns(cputime)
  25. u64 arch_cpu_idle_time(int cpu);
  26. #define arch_idle_time(cpu) arch_cpu_idle_time(cpu)
  27. #endif /* _S390_CPUTIME_H */