public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 4/9] UML - Delay loop cleanups
       [not found] <20050518141800.299476d9.akpm@osdl.org>
@ 2005-05-20 14:35 ` Jeff Dike
  2005-05-22 19:47   ` [PATCH] UML - 2.6.12-rc4-mm2 Compile error Eric BEGOT
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Dike @ 2005-05-20 14:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, user-mode-linux-devel, 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 <jdike@addtoit.com>

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 <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <asm/param.h>
 
 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<n;i++) ;
+        for(i=0;i<n;i++)
+                cpu_relax();
 }
 
+EXPORT_SYMBOL(__udelay);
+
 void __const_udelay(unsigned long usecs)
 {
 	int i, n;
 
 	n = (loops_per_jiffy * HZ * usecs) / MILLION;
-	for(i=0;i<n;i++) ;
+        for(i=0;i<n;i++)
+                cpu_relax();
 }
+
+EXPORT_SYMBOL(__const_udelay);
Index: linux-2.6.11/arch/um/sys-x86_64/delay.c
===================================================================
--- linux-2.6.11.orig/arch/um/sys-x86_64/delay.c	2005-05-19 13:18:50.000000000 -0400
+++ linux-2.6.11/arch/um/sys-x86_64/delay.c	2005-05-19 13:19:40.000000000 -0400
@@ -5,40 +5,37 @@
  * Licensed under the GPL
  */
 
-#include "linux/delay.h"
-#include "asm/processor.h"
-#include "asm/param.h"
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <asm/processor.h>
+#include <asm/param.h>
 
 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<n;i++) ;
+        for(i=0;i<n;i++)
+                cpu_relax();
 }
 
+EXPORT_SYMBOL(__udelay);
+
 void __const_udelay(unsigned long usecs)
 {
-	int i, n;
+	unsigned long i, n;
 
 	n = (loops_per_jiffy * HZ * usecs) / MILLION;
-	for(i=0;i<n;i++) ;
+        for(i=0;i<n;i++)
+                cpu_relax();
 }
 
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
+EXPORT_SYMBOL(__const_udelay);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] UML - 2.6.12-rc4-mm2 Compile error
  2005-05-20 14:35 ` [PATCH 4/9] UML - Delay loop cleanups Jeff Dike
@ 2005-05-22 19:47   ` Eric BEGOT
  2005-05-23 14:09     ` [uml-devel] " Blaisorblade
  2005-05-23 17:32     ` Blaisorblade
  0 siblings, 2 replies; 6+ messages in thread
From: Eric BEGOT @ 2005-05-22 19:47 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Andrew Morton, linux-kernel, user-mode-linux-devel

Here is a patch to correct a compile error on linux 2.6.12-rc4-mm2 for uml.
At the compilation of init/main.c, it complains because it doens't find 
the 2 constants FIXADDR_USER_START and FIXADDR_USER_END


--- linux-2.6.12-rc4-mm2/include/asm/fixmap.h.orig 2005-05-22 
21:37:13.000000000 +0200
+++ linux-2.6.12-rc4-mm2/include/asm/fixmap.h 2005-05-22 
21:38:17.000000000 +0200
@@ -60,7 +60,8 @@ extern unsigned long get_kmem_end(void);

#define FIXADDR_TOP (get_kmem_end() - 0x2000)
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
-#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
+#define FIXADDR_USER_START (FIXADDR_TOP - FIXADDR_SIZE)
+#define FIXADDR_USER_END FIXADDR_TOP

#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
@@ -91,7 +92,7 @@ static inline unsigned long fix_to_virt(

static inline unsigned long virt_to_fix(const unsigned long vaddr)
{
- BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
+ BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_USER_START);
return __virt_to_fix(vaddr);
}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [uml-devel] [PATCH] UML - 2.6.12-rc4-mm2 Compile error
  2005-05-22 19:47   ` [PATCH] UML - 2.6.12-rc4-mm2 Compile error Eric BEGOT
@ 2005-05-23 14:09     ` Blaisorblade
  2005-05-23 14:16       ` Miklos Szeredi
  2005-05-23 17:32     ` Blaisorblade
  1 sibling, 1 reply; 6+ messages in thread
From: Blaisorblade @ 2005-05-23 14:09 UTC (permalink / raw)
  To: user-mode-linux-devel, eric.begot; +Cc: Jeff Dike, Andrew Morton, linux-kernel

On Sunday 22 May 2005 21:47, Eric BEGOT wrote:
> Here is a patch to correct a compile error on linux 2.6.12-rc4-mm2 for uml.
> At the compilation of init/main.c, it complains because it doens't find
> the 2 constants FIXADDR_USER_START and FIXADDR_USER_END
Why deleting FIXADDR_START? Also FIXADDR_USER_* are defined, just in a 
different way (and the patch below is IIRC uncorrect).
>
> --- linux-2.6.12-rc4-mm2/include/asm/fixmap.h.orig 2005-05-22
> 21:37:13.000000000 +0200
> +++ linux-2.6.12-rc4-mm2/include/asm/fixmap.h 2005-05-22
> 21:38:17.000000000 +0200
> @@ -60,7 +60,8 @@ extern unsigned long get_kmem_end(void);
>
> #define FIXADDR_TOP (get_kmem_end() - 0x2000)
> #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
> -#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
> +#define FIXADDR_USER_START (FIXADDR_TOP - FIXADDR_SIZE)
> +#define FIXADDR_USER_END FIXADDR_TOP
>
> #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
> #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
> @@ -91,7 +92,7 @@ static inline unsigned long fix_to_virt(
>
> static inline unsigned long virt_to_fix(const unsigned long vaddr)
> {
> - BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
> + BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_USER_START);
> return __virt_to_fix(vaddr);
> }

-- 
Paolo Giarrusso, aka Blaisorblade
Skype user "PaoloGiarrusso"
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [uml-devel] [PATCH] UML - 2.6.12-rc4-mm2 Compile error
  2005-05-23 14:09     ` [uml-devel] " Blaisorblade
@ 2005-05-23 14:16       ` Miklos Szeredi
  2005-05-23 17:36         ` Blaisorblade
  0 siblings, 1 reply; 6+ messages in thread
From: Miklos Szeredi @ 2005-05-23 14:16 UTC (permalink / raw)
  To: blaisorblade; +Cc: user-mode-linux-devel, eric.begot, jdike, akpm, linux-kernel

> > Here is a patch to correct a compile error on linux 2.6.12-rc4-mm2 for uml.
> > At the compilation of init/main.c, it complains because it doens't find
> > the 2 constants FIXADDR_USER_START and FIXADDR_USER_END
> Why deleting FIXADDR_START? Also FIXADDR_USER_* are defined, just in a 
> different way (and the patch below is IIRC uncorrect).

I've seen this error too after 'make menuconfig ARCH=um' on a clean
tree.

The following fixes it:

  cp .config /tmp
  make mrproper ARCH=um
  cp /tmp/.config .
  make ARCH=um

So there's definitely something wrong with the build on UML.

Miklos

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [uml-devel] [PATCH] UML - 2.6.12-rc4-mm2 Compile error
  2005-05-22 19:47   ` [PATCH] UML - 2.6.12-rc4-mm2 Compile error Eric BEGOT
  2005-05-23 14:09     ` [uml-devel] " Blaisorblade
@ 2005-05-23 17:32     ` Blaisorblade
  1 sibling, 0 replies; 6+ messages in thread
From: Blaisorblade @ 2005-05-23 17:32 UTC (permalink / raw)
  To: user-mode-linux-devel, eric.begot; +Cc: Jeff Dike, Andrew Morton, linux-kernel

On Sunday 22 May 2005 21:47, Eric BEGOT wrote:
> Here is a patch to correct a compile error on linux 2.6.12-rc4-mm2 for uml.
> At the compilation of init/main.c, it complains because it doens't find
> the 2 constants FIXADDR_USER_START and FIXADDR_USER_END
On mainline it's defined by either include/asm-um/archparam-x86_64.h or 
include/asm-um/elf-i386.h.

Make sure you used a clean tree and a correct command line (make init/main.o 
ARCH=um wouldn't work because it would not create the needed header 
symlinks).
-- 
Paolo Giarrusso, aka Blaisorblade
Skype user "PaoloGiarrusso"
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [uml-devel] [PATCH] UML - 2.6.12-rc4-mm2 Compile error
  2005-05-23 14:16       ` Miklos Szeredi
@ 2005-05-23 17:36         ` Blaisorblade
  0 siblings, 0 replies; 6+ messages in thread
From: Blaisorblade @ 2005-05-23 17:36 UTC (permalink / raw)
  To: user-mode-linux-devel
  Cc: Miklos Szeredi, eric.begot, jdike, akpm, linux-kernel

On Monday 23 May 2005 16:16, Miklos Szeredi wrote:
> > > Here is a patch to correct a compile error on linux 2.6.12-rc4-mm2 for
> > > uml. At the compilation of init/main.c, it complains because it doens't
> > > find the 2 constants FIXADDR_USER_START and FIXADDR_USER_END
> >
> > Why deleting FIXADDR_START? Also FIXADDR_USER_* are defined, just in a
> > different way (and the patch below is IIRC uncorrect).
>
> I've seen this error too after 'make menuconfig ARCH=um' on a clean
> tree.
>
> The following fixes it:
>
>   cp .config /tmp
>   make mrproper ARCH=um
>   cp /tmp/.config .
>   make ARCH=um
>
> So there's definitely something wrong with the build on UML.
Yes, an empty include/asm-um/elf.h which is not by default replaced by a 
symlink. Sadly a patch which should have been deleted it simply emptied it 
(courtesy of quilt). So

include/asm-um/elf.h:
	$(call create_the_symlink)
(which is pseudo-code) won't create it.

As a last resort I'll force that symlink to be unconditional (I hope not 
needing this).
-- 
Paolo Giarrusso, aka Blaisorblade
Skype user "PaoloGiarrusso"
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-05-23 17:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20050518141800.299476d9.akpm@osdl.org>
2005-05-20 14:35 ` [PATCH 4/9] UML - Delay loop cleanups Jeff Dike
2005-05-22 19:47   ` [PATCH] UML - 2.6.12-rc4-mm2 Compile error Eric BEGOT
2005-05-23 14:09     ` [uml-devel] " Blaisorblade
2005-05-23 14:16       ` Miklos Szeredi
2005-05-23 17:36         ` Blaisorblade
2005-05-23 17:32     ` Blaisorblade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox