Skip to content

Commit

Permalink
powerpc: Add cputime_to_nsecs()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Anton Blanchard authored and Michael Ellerman committed Jul 16, 2020
1 parent e4208f1 commit ade7667
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ade7667

Please sign in to comment.