aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parser.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 01:50:04 -0500
committerNick Piggin <npiggin@kernel.dk>2011-01-07 01:50:31 -0500
commit626d607435617cc0f033522083e2bb195b81813c (patch)
treec1decac81fa5218e7391b6e2b75e2642ec4d8f27 /lib/parser.c
parent4e35e6070b1ceed89c3bba2af4216c286fb1dafd (diff)
bit_spinlock: add required includes
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'lib/parser.c')
0 files changed, 0 insertions, 0 deletions
32 jiffies_to_AHZ(unsigned long x) { #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 # if HZ < AHZ return x * (AHZ / HZ); # else return x / (HZ / AHZ); # endif #else u64 tmp = (u64)x * TICK_NSEC; do_div(tmp, (NSEC_PER_SEC / AHZ)); return (long)tmp; #endif } static inline u64 nsec_to_AHZ(u64 x) { #if (NSEC_PER_SEC % AHZ) == 0 do_div(x, (NSEC_PER_SEC / AHZ)); #elif (AHZ % 512) == 0 x *= AHZ/512; do_div(x, (NSEC_PER_SEC / 512)); #else /* * max relative error 5.7e-8 (1.8s per year) for AHZ <= 1024, * overflow after 64.99 years. * exact for AHZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... */ x *= 9; do_div(x, (unsigned long)((9ull * NSEC_PER_SEC + (AHZ/2)) / AHZ)); #endif return x; } #endif /* _LINUX_ACCT_H */