[PATCH 2.6.12-rc5-mm2] m32r: Update m32r_sio.c to use cpu_relax()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I fixed m32r_sio.c to use cpu_relax().

Thanks.

From: Andrew Morton <[email protected]>
Subject: Re: [PATCH 2.6.12-rc5] m32r: Support M3A-2170(Mappi-III) platform
Date: Tue, 31 May 2005 14:01:51 -0700
> Hirokazu Takata <[email protected]> wrote:
> >
> > This patchset is for supporting a new m32r platform,
> > M3A-2170(Mappi-III) evaluation board.
> > An M32R chip multiprocessor is equipped on the board.
> > http://http://www.linux-m32r.org/eng/platform/platform.html
> > 
> > ...
> >  static void putc(char c)
> >  {
> > -
> >  	while ((*BOOT_SIO0STS & 0x3) != 0x3) ;
> 
> cpu_relax()?
> 
> >  static void putc(char c)
> >  {
> > -
> >  	while ((*SIO0STS & 0x1) == 0) ;
> 
> cpu_relax()?
> 

Signed-off-by: Hirokazu Takata <[email protected]>
---

 arch/m32r/boot/compressed/m32r_sio.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)


diff -ruNp a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c
--- a/arch/m32r/boot/compressed/m32r_sio.c	2005-06-02 12:09:19.000000000 +0900
+++ b/arch/m32r/boot/compressed/m32r_sio.c	2005-06-02 18:16:54.000000000 +0900
@@ -6,6 +6,7 @@
  */
 
 #include <linux/config.h>
+#include <asm/processor.h>
 
 static void putc(char c);
 
@@ -38,10 +39,12 @@ static int puts(const char *s)
 
 static void putc(char c)
 {
-	while ((*BOOT_SIO0STS & 0x3) != 0x3) ;
+	while ((*BOOT_SIO0STS & 0x3) != 0x3)
+		cpu_relax();
 	if (c == '\n') {
 		*BOOT_SIO0TXB = '\r';
-		while ((*BOOT_SIO0STS & 0x3) != 0x3) ;
+		while ((*BOOT_SIO0STS & 0x3) != 0x3)
+			cpu_relax();
 	}
 	*BOOT_SIO0TXB = c;
 }
@@ -56,10 +59,12 @@ static void putc(char c)
 
 static void putc(char c)
 {
-	while ((*SIO0STS & 0x1) == 0) ;
+	while ((*SIO0STS & 0x1) == 0)
+		cpu_relax();
 	if (c == '\n') {
 		*SIO0TXB = '\r';
-		while ((*SIO0STS & 0x1) == 0) ;
+		while ((*SIO0STS & 0x1) == 0)
+			cpu_relax();
 	}
 	*SIO0TXB = c;
 }

--
Hirokazu Takata <[email protected]>
Linux/M32R Project:  http://www.linux-m32r.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux