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]
Message-Id: <200906140031.55091.arnd@arndb.de>
Date:	Sun, 14 Jun 2009 00:31:54 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	liqin.chen@...plusct.com
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	torvalds@...ux-foundation.org
Subject: Re: [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h

On Saturday 13 June 2009, liqin.chen@...plusct.com wrote:
> Arnd Bergmann <arnd@...db.de> 写于 2009-06-10 01:18:20:
> 
> > On Tuesday 09 June 2009, liqin.chen@...plusct.com wrote:
> > 
> > Having a working udelay() function is required for many
> > drivers that are sensitive to timing, you should probably
> > implement that at some point in the future.
> 
> Add udelay() implement in code.

so you use 

static inline void __delay(unsigned long loops)
{
        __asm__ __volatile__ (
                "1:\tsubi\t%0,1\n\t"
                "cmpz.c\t%0\n\t"
                "bne\t1b\n\t"
                : "=r" (loops)
                : "0" (loops));
}

static inline void __udelay(unsigned long usecs)
{
        __delay(usecs);
}


This is much better than before, but is far from exact in the __udelay()
case. Please take a look at init/calibrate.c and how other architectures
use loops_per_jiffy if you don't have an exact time source you can use.

If you have a time source with microsecond resolution or better, just loop
until the amount of microseconds has expired.

	Arnd <><
--
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