All of lore.kernel.org
 help / color / mirror / Atom feed
From: zippel@linux-m68k.org
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 04/21] small flush_icache() cleanup
Date: Fri, 23 Jun 2006 20:31:00 +0200	[thread overview]
Message-ID: <20060623183910.241438000@linux-m68k.org> (raw)
In-Reply-To: 20060623183056.479024000@linux-m68k.org

[-- Attachment #1: 0004-M68K-small-flush_icache-cleanup.txt --]
[-- Type: text/plain, Size: 1829 bytes --]

Make flush_icache() an inline function and clean it up a litte.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

---

 include/asm-m68k/cacheflush.h |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

01911c188ddfe00537e598d3feaf5451627271a3
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h
index 8aba971..24d3ff4 100644
--- a/include/asm-m68k/cacheflush.h
+++ b/include/asm-m68k/cacheflush.h
@@ -3,26 +3,30 @@ #define _M68K_CACHEFLUSH_H
 
 #include <linux/mm.h>
 
+/* cache code */
+#define FLUSH_I_AND_D	(0x00000808)
+#define FLUSH_I		(0x00000008)
+
 /*
  * Cache handling functions
  */
 
-#define flush_icache()						\
-({								\
-	if (CPU_IS_040_OR_060)					\
-		__asm__ __volatile__("nop\n\t"			\
-				     ".chip 68040\n\t"		\
-				     "cinva %%ic\n\t"		\
-				     ".chip 68k" : );		\
-	else {							\
-		unsigned long _tmp;				\
-		__asm__ __volatile__("movec %%cacr,%0\n\t"	\
-				     "orw %1,%0\n\t"		\
-				     "movec %0,%%cacr"		\
-				     : "=&d" (_tmp)		\
-				     : "id" (FLUSH_I));	\
-	}							\
-})
+static inline void flush_icache(void)
+{
+	if (CPU_IS_040_OR_060)
+		asm volatile (	"nop\n"
+			"	.chip	68040\n"
+			"	cpusha	%bc\n"
+			"	.chip	68k");
+	else {
+		unsigned long tmp;
+		asm volatile (	"movec	%%cacr,%0\n"
+			"	or.w	%1,%0\n"
+			"	movec	%0,%%cacr"
+			: "=&d" (tmp)
+			: "id" (FLUSH_I));
+	}
+}
 
 /*
  * invalidate the cache for the specified memory range.
@@ -43,10 +47,6 @@ extern void cache_push(unsigned long pad
  */
 extern void cache_push_v(unsigned long vaddr, int len);
 
-/* cache code */
-#define FLUSH_I_AND_D	(0x00000808)
-#define FLUSH_I		(0x00000008)
-
 /* This is needed whenever the virtual mapping of the current
    process changes.  */
 #define __flush_cache_all()					\
-- 
1.3.3

--


  parent reply	other threads:[~2006-06-23 18:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23 18:30 [PATCH 00/21] m68k patches zippel
2006-06-23 18:30 ` [PATCH 01/21] fix uaccess.h for gcc-3.x zippel
2006-06-23 18:30 ` [PATCH 02/21] fix constraints of the signal functions and some cleanup zippel
2006-06-23 18:30 ` [PATCH 03/21] fix __iounmap for 030 zippel
2006-06-23 18:31 ` zippel [this message]
2006-06-23 18:31 ` [PATCH 05/21] Add the generic dma API functions zippel
2006-06-23 18:31 ` [PATCH 06/21] dma API addition zippel
2006-06-23 18:31 ` [PATCH 07/21] fix show_registers() zippel
2006-06-23 18:31 ` [PATCH 08/21] gcc 4 fix zippel
2006-06-23 19:35   ` Al Viro
2006-06-23 20:05     ` Roman Zippel
2006-06-24  4:45       ` Finn Thain
2006-06-26 17:43         ` Brad Boyer
2006-06-23 18:31 ` [PATCH 09/21] separate handler for auto and user vector interrupt zippel
2006-06-23 18:31 ` [PATCH 10/21] cleanup generic irq names zippel
2006-06-23 18:31 ` [PATCH 11/21] cleanup amiga irq numbering zippel
2006-06-23 18:31 ` [PATCH 12/21] introduce irq controller zippel
2006-06-23 18:31 ` [PATCH 13/21] convert generic irq code to " zippel
2006-06-23 18:31 ` [PATCH 14/21] convert amiga irq code zippel
2006-06-23 18:31 ` [PATCH 15/21] convert apollo " zippel
2006-06-23 18:31 ` [PATCH 16/21] convert atari " zippel
2006-06-23 18:31 ` [PATCH 17/21] convert hp300 " zippel
2006-06-23 18:31 ` [PATCH 18/21] convert mac " zippel
2006-06-23 18:31 ` [PATCH 19/21] convert q40 " zippel
2006-06-23 18:31 ` [PATCH 20/21] convert sun3 " zippel
2006-06-23 18:31 ` [PATCH 21/21] convert VME " zippel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060623183910.241438000@linux-m68k.org \
    --to=zippel@linux-m68k.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.