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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080219141330.9c5dfb76.randy.dunlap@oracle.com>
Date:	Tue, 19 Feb 2008 14:13:30 -0800
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	Jonathan Lim <jlim@....com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH] Provide u64 version of jiffies_to_usecs() in

On Tue, 19 Feb 2008 13:59:27 -0800 (PST) Jonathan Lim wrote:

> On Tue Feb 19 13:25:25 2008, randy.dunlap@...cle.com wrote:
> > 
> > > +u64 inline jiffies_64_to_usecs(const u64 j)
> > > +{
> > > +	u64 tmp = j*HZ_TO_USEC_NUM + HZ_TO_USEC_DEN-1;
> > > +	do_div(tmp, HZ_TO_USEC_DEN);
> > 
> > do_div() is:
> >  * The semantics of do_div() are:
> >  *
> >  * uint32_t do_div(uint64_t *n, uint32_t base)
> > 
> > Maybe you want div64_64().
> > 
> > > +	return tmp;
> > > +}
> > > +EXPORT_SYMBOL(jiffies_64_to_usecs);
> > > +
> 
> In include/asm-generic/div64.h, div64_64(uint64_t dividend, uint64_t divisor)
> just returns (dividend / divisor).  Isn't this the same as what I had before
> in jiffies_64_to_usecs(), except that the arguments are of type u64?

but the (linker) problem is with X86_32, so don't look at
asm-generic/div64.h.  Look at lib/div64.c.

Or use div64() with the correct parameter types.

---
~Randy
--
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