Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179573
b: refs/heads/master
c: 3e7b484
h: refs/heads/master
i:
  179571: ed27719
v: v3
  • Loading branch information
Stefan Roese authored and Benjamin Herrenschmidt committed Jan 15, 2010
1 parent b320dcb commit 3daea25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b0ff153cd6228b2502e1c3ce5e226b82ae4e0679
refs/heads/master: 3e7b484354c8f60c12119c1c5174ef354696c30d
11 changes: 10 additions & 1 deletion trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,12 +903,21 @@ static void decrementer_set_mode(enum clock_event_mode mode,
decrementer_set_next_event(DECREMENTER_MAX, dev);
}

static inline uint64_t div_sc64(unsigned long ticks, unsigned long nsec,
int shift)
{
uint64_t tmp = ((uint64_t)ticks) << shift;

do_div(tmp, nsec);
return tmp;
}

static void __init setup_clockevent_multiplier(unsigned long hz)
{
u64 mult, shift = 32;

while (1) {
mult = div_sc(hz, NSEC_PER_SEC, shift);
mult = div_sc64(hz, NSEC_PER_SEC, shift);
if (mult && (mult >> 32UL) == 0UL)
break;

Expand Down

0 comments on commit 3daea25

Please sign in to comment.