Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321331
b: refs/heads/master
c: a7ea3bb
h: refs/heads/master
i:
  321329: c98e75a
  321327: be1108c
v: v3
  • Loading branch information
Catalin Marinas authored and Ingo Molnar committed Jul 31, 2012
1 parent 0f5fa90 commit a656909
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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: 1f815faec46e83bc96039797151846b60875bb06
refs/heads/master: a7ea3bbf5d58f4df2265d312f91d5769eabc8144
12 changes: 8 additions & 4 deletions trunk/include/linux/jiffies.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
# error Invalid value of HZ.
#endif

/* LATCH is used in the interval timer and ftape setup. */
#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */

/* Suppose we want to divide two numbers NOM and DEN: NOM/DEN, then we can
* improve accuracy by shifting LSH bits, hence calculating:
* (NOM << LSH) / DEN
Expand All @@ -54,8 +51,15 @@
#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \
+ ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))

#ifdef CLOCK_TICK_RATE
/* LATCH is used in the interval timer and ftape setup. */
# define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */

/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
# define ACTHZ (SH_DIV(CLOCK_TICK_RATE, LATCH, 8))
#else
# define ACTHZ (HZ << 8)
#endif

/* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */
#define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8))
Expand Down

0 comments on commit a656909

Please sign in to comment.