lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 5 Mar 2010 13:29:42 -0800
From:	john stultz <johnstul@...ibm.com>
To:	Lin Mac <mkl0301@...il.com>
Cc:	linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
	linux-kernel@...r.kernel.org
Subject: Re: Different definition in div_sc and clocksource_cyc2ns

On Fri, Mar 5, 2010 at 1:14 PM, Lin Mac <mkl0301@...il.com> wrote:
> While working with the clocksource, I found that the relation of cycle
> and nanosecond of div_sc and clocksource_cyc2ns is different.
>
> linux-2.6.33
> div_sc in include/linux/clockchips.h suggests that clock_ticks =
> (nanoseconds * factor) >> shift.

> However, clocksource_cyc2ns in include/linux/clocksource.h suggest
> nanoseconds=(cycles*mult)>>shift.

You're comparing similar helper conversion functions from two
different subsystems.

Both use similar shifted math, but the div_sc() is for clockchips.h,
which is used by the clockevents code to trigger interrupts at a
specified time, while clocksource_cyc2ns() is for the clocksource
code, which converts  clockosurce cycles into nanoseconds for
timekeeping.


thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ