Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32069
b: refs/heads/master
c: a8e0c51
h: refs/heads/master
i:
  32067: 3441788
v: v3
  • Loading branch information
David Woodhouse authored and Linus Torvalds committed Jul 5, 2006
1 parent 622dd61 commit 639b19c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba1826e5eced176cc9ec0033ad8ee0f1cd5ad2e4
refs/heads/master: a8e0c51c71fc973b400f6502382063553b82af5a
18 changes: 18 additions & 0 deletions trunk/include/asm-powerpc/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ typedef u64 cputime64_t;

#define cputime64_zero ((cputime64_t)0)
#define cputime64_add(__a, __b) ((__a) + (__b))
#define cputime64_sub(__a, __b) ((__a) - (__b))
#define cputime_to_cputime64(__ct) (__ct)

#ifdef __KERNEL__
Expand Down Expand Up @@ -74,6 +75,23 @@ static inline cputime_t jiffies_to_cputime(const unsigned long jif)
return ct;
}

static inline cputime64_t jiffies64_to_cputime64(const u64 jif)
{
cputime_t ct;
u64 sec;

/* have to be a little careful about overflow */
ct = jif % HZ;
sec = jif / HZ;
if (ct) {
ct *= tb_ticks_per_sec;
do_div(ct, HZ);
}
if (sec)
ct += (cputime_t) sec * tb_ticks_per_sec;
return ct;
}

static inline u64 cputime64_to_jiffies64(const cputime_t ct)
{
return mulhdu(ct, __cputime_jiffies_factor);
Expand Down

0 comments on commit 639b19c

Please sign in to comment.