diff options
author | Anton Blanchard <anton@ozlabs.org> | 2020-07-13 11:36:01 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-07-16 06:12:43 +0300 |
commit | ade7667a981be49af9310f7c682c226283ec833d (patch) | |
tree | 51dc1d8b7e9b5f3ca3c5f5b51f36d1324b687420 /arch/powerpc/include/asm/cputime.h | |
parent | e4208f1399b1bf7ed84ba359a6ba0979d1df4029 (diff) | |
download | linux-ade7667a981be49af9310f7c682c226283ec833d.tar.xz |
powerpc: Add cputime_to_nsecs()
Generic code has a wrapper to implement cputime_to_nsecs() on top of
cputime_to_usecs() but we can easily return the full nanosecond
resolution directly.
Signed-off-by: Anton Blanchard <anton@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200713083601.1103978-1-anton@ozlabs.org
Diffstat (limited to 'arch/powerpc/include/asm/cputime.h')
-rw-r--r-- | arch/powerpc/include/asm/cputime.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index 0fccd5ea1e9a..9335b93924b4 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h @@ -36,6 +36,8 @@ static inline unsigned long cputime_to_usecs(const cputime_t ct) return mulhdu((__force u64) ct, __cputime_usec_factor); } +#define cputime_to_nsecs(cputime) tb_to_ns((__force u64)cputime) + /* * PPC64 uses PACA which is task independent for storing accounting data while * PPC32 uses struct thread_info, therefore at task switch the accounting data |