From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12] helo=sc8-sf-mx2.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) id 1DZ8gs-0004sy-Hw for user-mode-linux-devel@lists.sourceforge.net; Fri, 20 May 2005 07:41:30 -0700 Received: from lakshmi.addtoit.com ([198.99.130.6] helo=lakshmi.solana.com) by sc8-sf-mx2.sourceforge.net with esmtp (Exim 4.41) id 1DZ8gq-0004MX-Ue for user-mode-linux-devel@lists.sourceforge.net; Fri, 20 May 2005 07:41:30 -0700 Message-Id: <200505201436.j4KEZxjh006235@ccure.user-mode-linux.org> In-Reply-To: Your message of "Wed, 18 May 2005 14:18:00 PDT." <20050518141800.299476d9.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii From: Jeff Dike Subject: [uml-devel] Re: [PATCH 4/9] UML - Delay loop cleanups Sender: user-mode-linux-devel-admin@lists.sourceforge.net Errors-To: user-mode-linux-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Id: The user-mode Linux development list List-Post: List-Help: List-Subscribe: , List-Archive: Date: Fri, 20 May 2005 10:35:57 -0400 To: Andrew Morton Cc: linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, Arjan van de Ven akpm@osdl.org said: > I'll drop this in light of the review comments - pls redo&&resend Here 'tis. This patch cleans up the delay implementations a bit, makes the loops unoptimizable, and exports __udelay and __const_udelay. Signed-off-by: Jeff Dike Index: linux-2.6.11/arch/um/sys-i386/delay.c =================================================================== --- linux-2.6.11.orig/arch/um/sys-i386/delay.c 2005-05-19 13:18:50.000000000 -0400 +++ linux-2.6.11/arch/um/sys-i386/delay.c 2005-05-19 13:19:40.000000000 -0400 @@ -1,5 +1,7 @@ -#include "linux/delay.h" -#include "asm/param.h" +#include +#include +#include +#include void __delay(unsigned long time) { @@ -20,13 +22,19 @@ void __udelay(unsigned long usecs) int i, n; n = (loops_per_jiffy * HZ * usecs) / MILLION; - for(i=0;i +#include +#include +#include void __delay(unsigned long loops) { unsigned long i; - for(i = 0; i < loops; i++) ; + for(i = 0; i < loops; i++) + cpu_relax(); } void __udelay(unsigned long usecs) { - int i, n; + unsigned long i, n; n = (loops_per_jiffy * HZ * usecs) / MILLION; - for(i=0;i