All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] arch/tile: use extended assembly to inline __mb_incoherent()
Date: Mon, 28 Feb 2011 15:28:00 -0500	[thread overview]
Message-ID: <201103011934.p21JYdSt010306@farm-0010.internal.tilera.com> (raw)
In-Reply-To: <201103011931.p21JVtqp010237@farm-0010.internal.tilera.com>

This avoids having to maintain an additional separate assembly
file, and of course the inline is slightly more efficient as well.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
---
 arch/tile/include/asm/system.h |   19 ++++++++++++++++++-
 arch/tile/lib/Makefile         |    5 ++---
 arch/tile/lib/exports.c        |    3 ---
 arch/tile/lib/mb_incoherent.S  |   34 ----------------------------------
 4 files changed, 20 insertions(+), 41 deletions(-)
 delete mode 100644 arch/tile/lib/mb_incoherent.S

diff --git a/arch/tile/include/asm/system.h b/arch/tile/include/asm/system.h
index 5388850..23d1842 100644
--- a/arch/tile/include/asm/system.h
+++ b/arch/tile/include/asm/system.h
@@ -90,7 +90,24 @@
 #endif
 
 #if !CHIP_HAS_MF_WAITS_FOR_VICTIMS()
-int __mb_incoherent(void);  /* Helper routine for mb_incoherent(). */
+#include <hv/syscall_public.h>
+/*
+ * Issue an uncacheable load to each memory controller, then
+ * wait until those loads have completed.
+ */
+static inline void __mb_incoherent(void)
+{
+	long clobber_r10;
+	asm volatile("swint2"
+		     : "=R10" (clobber_r10)
+		     : "R10" (HV_SYS_fence_incoherent)
+		     : "r0", "r1", "r2", "r3", "r4",
+		       "r5", "r6", "r7", "r8", "r9",
+		       "r11", "r12", "r13", "r14",
+		       "r15", "r16", "r17", "r18", "r19",
+		       "r20", "r21", "r22", "r23", "r24",
+		       "r25", "r26", "r27", "r28", "r29");
+}
 #endif
 
 /* Fence to guarantee visibility of stores to incoherent memory. */
diff --git a/arch/tile/lib/Makefile b/arch/tile/lib/Makefile
index 93122d5..0c26086 100644
--- a/arch/tile/lib/Makefile
+++ b/arch/tile/lib/Makefile
@@ -2,9 +2,8 @@
 # Makefile for TILE-specific library files..
 #
 
-lib-y = cacheflush.o checksum.o cpumask.o delay.o \
-	mb_incoherent.o uaccess.o memmove.o \
-	memcpy_$(BITS).o memchr_$(BITS).o memset_$(BITS).o \
+lib-y = cacheflush.o checksum.o cpumask.o delay.o uaccess.o \
+	memmove.o memcpy_$(BITS).o memchr_$(BITS).o memset_$(BITS).o \
 	strchr_$(BITS).o strlen_$(BITS).o
 
 ifeq ($(CONFIG_TILEGX),y)
diff --git a/arch/tile/lib/exports.c b/arch/tile/lib/exports.c
index 1509c55..ce5dbf5 100644
--- a/arch/tile/lib/exports.c
+++ b/arch/tile/lib/exports.c
@@ -45,9 +45,6 @@ EXPORT_SYMBOL(__copy_from_user_zeroing);
 EXPORT_SYMBOL(__copy_in_user_inatomic);
 #endif
 
-/* arch/tile/lib/mb_incoherent.S */
-EXPORT_SYMBOL(__mb_incoherent);
-
 /* hypervisor glue */
 #include <hv/hypervisor.h>
 EXPORT_SYMBOL(hv_dev_open);
diff --git a/arch/tile/lib/mb_incoherent.S b/arch/tile/lib/mb_incoherent.S
deleted file mode 100644
index 989ad7b..0000000
--- a/arch/tile/lib/mb_incoherent.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Tilera Corporation. All Rights Reserved.
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation, version 2.
- *
- *   This program is distributed in the hope that it will be useful, but
- *   WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- *   NON INFRINGEMENT.  See the GNU General Public License for
- *   more details.
- *
- * Assembly code for invoking the HV's fence_incoherent syscall.
- */
-
-#include <linux/linkage.h>
-#include <hv/syscall_public.h>
-#include <arch/abi.h>
-#include <arch/chip.h>
-
-#if !CHIP_HAS_MF_WAITS_FOR_VICTIMS()
-
-/*
- * Invoke the hypervisor's fence_incoherent syscall, which guarantees
- * that all victims for cachelines homed on this tile have reached memory.
- */
-STD_ENTRY(__mb_incoherent)
-	moveli TREG_SYSCALL_NR_NAME, HV_SYS_fence_incoherent
-	swint2
-	jrp lr
-	STD_ENDPROC(__mb_incoherent)
-
-#endif
-- 
1.6.5.2


  parent reply	other threads:[~2011-03-01 19:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-27 23:52 arch/tile: various fixes for 2.6.39 Chris Metcalf
2011-02-27 23:52 ` [PATCH] arch/tile: catch up with section naming convention in 2.6.35 Chris Metcalf
2011-03-01 20:52   ` Sam Ravnborg
2011-03-01 21:17     ` Chris Metcalf
2011-02-28 18:08 ` [PATCH] arch/tile: bug fix: exec'ed task thought it was still single-stepping Chris Metcalf
2011-02-28 18:21 ` [PATCH] arch/tile: fix __ndelay etc to work better Chris Metcalf
2011-02-28 18:24 ` [PATCH] arch/tile: stop disabling INTCTRL_1 interrupts during hypervisor downcalls Chris Metcalf
2011-02-28 18:32 ` [PATCH] arch/tile: warn and retry if an IPI is not accepted by the target cpu Chris Metcalf
2011-02-28 18:35 ` [PATCH] arch/tile: export <asm/hardwall.h> to userspace Chris Metcalf
2011-02-28 20:01 ` [PATCH] arch/tile: avoid a simulator warning during bootup Chris Metcalf
2011-02-28 20:14 ` [PATCH] arch/tile: fix reversed test of strict_strtol() return value Chris Metcalf
2011-02-28 20:19 ` [PATCH] arch/tile: sync up with <arch/sim.h> and <arch/sim_def.h> changes Chris Metcalf
2011-02-28 20:22 ` [PATCH] arch/tile: use a cleaner technique to enable interrupt for cpu_idle() Chris Metcalf
2011-02-28 20:28 ` Chris Metcalf [this message]
2011-02-28 20:30 ` [PATCH] arch/tile: fix two bugs in the backtracer code Chris Metcalf
2011-02-28 20:48 ` [PATCH] arch/tile: enhance existing finv_buffer_remote() routine Chris Metcalf
2011-02-28 20:51 ` [PATCH] arch/tile: export some additional module symbols Chris Metcalf
2011-02-28 20:58 ` [PATCH] arch/tile: fix some comments and whitespace Chris Metcalf
2011-02-28 21:01 ` [PATCH] arch/tile: add some more VMSPLIT options and use consistent naming Chris Metcalf
2011-02-28 21:37 ` [PATCH] arch/tile: support 4KB page size as well as 64KB Chris Metcalf

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=201103011934.p21JYdSt010306@farm-0010.internal.tilera.com \
    --to=cmetcalf@tilera.com \
    --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.