From a185e44a331149657fc59f35f31ca2b072880748 Mon Sep 17 00:00:00 2001
From: Thomas Chou <thomas@wytron.com.tw>
Date: Sun, 9 Mar 2008 06:46:14 +0800
Subject: [PATCH] nios2: fix clobbered register in local_irq_restore inline asm

gregor1 identified a bug and submitted a patch.

The function local_irq_restore(x) in include/asm/system.h in the current
linux kernel seems to have a big problem. The register r8 will not be
reserved. So the compiler can use this variable for the normal c-code.

This patch adds register r8 to the clobber list of the inline asm.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 linux-2.6.x/include/asm-nios2nommu/system.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/linux-2.6.x/include/asm-nios2nommu/system.h b/linux-2.6.x/include/asm-nios2nommu/system.h
index a6ea4c8..a9e01c7 100644
--- a/linux-2.6.x/include/asm-nios2nommu/system.h
+++ b/linux-2.6.x/include/asm-nios2nommu/system.h
@@ -74,7 +74,7 @@ asmlinkage void resume(void);
 #define local_irq_restore(x) __asm__ __volatile__ (	\
 	"mov	r8, %0\n"				\
 	"wrctl	status, r8\n"				\
-	: :"r" (x) : "memory")
+	: :"r" (x) : "r8", "memory")
 
 /* For spinlocks etc */
 #define local_irq_save(x) do { local_save_flags(x); local_irq_disable(); } while (0)
-- 
1.5.3.3

