public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Hugh Dickins <hugh@veritas.com>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
	Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Clean up asm/pgalloc.h include (sh)
Date: Tue, 20 Apr 2004 12:19:40 -0400	[thread overview]
Message-ID: <20040420161940.GA20353@linux-sh.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0404201647020.4724-100000@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 4829 bytes --]

On Tue, Apr 20, 2004 at 05:01:17PM +0100, Hugh Dickins wrote:
> On Tue, 20 Apr 2004, Paul Mundt wrote:
> > Failed to compile. sh has ptep_get_and_clear in asm/pgalloc.h.
> > This moves it out of the way, and your patch builds fine.
> 
> Paul, the patch you show reflects how ptep_get_and_clear looked in
> 2.6.5, but not how it now looks in 2.6.6-rc1-bk - should be using
> page_mapping(page) and mapping_writably_mapped(mapping).
> 
> I dare say you're referring to a master tree into which the recent
> mainline changes need to be ported (I CC'ed gniibe@m17n.org when
> sending those changes to akpm): I'm not saying your version is
> wrong, just trying to make sure that two sets of changes in the
> same area don't end up with one set getting lost.
> 
Yes, this was against the 2.6.5-based SH tree, not current BK. Attached
is a patch against current BK that seems to reflect your changes.

Please CC me on any future SH-related issues, NIIBE-san is no longer
active in the SH community.

===== arch/sh/mm/tlb-sh4.c 1.2 vs edited =====
--- 1.2/arch/sh/mm/tlb-sh4.c	Tue Mar 23 05:05:26 2004
+++ edited/arch/sh/mm/tlb-sh4.c	Tue Apr 20 12:16:08 2004
@@ -24,7 +24,6 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
@@ -93,5 +92,25 @@
 	jump_to_P2();
 	ctrl_outl(data, addr);
 	back_to_P1();
+}
+
+/*
+ * For SH-4, we have our own implementation for ptep_get_and_clear
+ */
+inline pte_t ptep_get_and_clear(pte_t *ptep)
+{
+	pte_t pte = *ptep;
+
+	pte_clear(ptep);
+	if (!pte_not_present(pte)) {
+		unsigned long pfn = pte_pfn(pte);
+		if (pfn_valid(pfn)) {
+			struct page *page = pfn_to_page(pfn);
+			struct address_space *mapping = page_mapping(page);
+			if (!mapping || !mapping_writably_mapped(mapping))
+				__clear_bit(PG_mapped, &page->flags);
+		}
+	}
+	return pte;
 }
 
===== include/asm-sh/pgalloc.h 1.12 vs edited =====
--- 1.12/include/asm-sh/pgalloc.h	Sun Apr 18 12:13:10 2004
+++ edited/include/asm-sh/pgalloc.h	Tue Apr 20 12:17:20 2004
@@ -85,69 +85,9 @@
 #define __pmd_free_tlb(tlb,x)		do { } while (0)
 #define pgd_populate(mm, pmd, pte)	BUG()
 
-#if defined(CONFIG_CPU_SH4)
+#ifdef CONFIG_CPU_SH4
 #define PG_mapped	PG_arch_1
-
-/*
- * For SH-4, we have our own implementation for ptep_get_and_clear
- */
-static inline pte_t ptep_get_and_clear(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-
-	pte_clear(ptep);
-	if (!pte_not_present(pte)) {
-		unsigned long pfn = pte_pfn(pte);
-		if (pfn_valid(pfn)) {
-			struct page *page = pfn_to_page(pfn);
-			struct address_space *mapping = page_mapping(page);
-			if (!mapping || !mapping_writably_mapped(mapping))
-				__clear_bit(PG_mapped, &page->flags);
-		}
-	}
-	return pte;
-}
-#else
-static inline pte_t ptep_get_and_clear(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	pte_clear(ptep);
-	return pte;
-}
 #endif
-
-/*
- * Following functions are same as generic ones.
- */
-static inline int ptep_test_and_clear_young(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	if (!pte_young(pte))
-		return 0;
-	set_pte(ptep, pte_mkold(pte));
-	return 1;
-}
-
-static inline int ptep_test_and_clear_dirty(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	if (!pte_dirty(pte))
-		return 0;
-	set_pte(ptep, pte_mkclean(pte));
-	return 1;
-}
-
-static inline void ptep_set_wrprotect(pte_t *ptep)
-{
-	pte_t old_pte = *ptep;
-	set_pte(ptep, pte_wrprotect(old_pte));
-}
-
-static inline void ptep_mkdirty(pte_t *ptep)
-{
-	pte_t old_pte = *ptep;
-	set_pte(ptep, pte_mkdirty(old_pte));
-}
 
 #define check_pgt_cache()	do { } while (0)
 
===== include/asm-sh/pgtable.h 1.22 vs edited =====
--- 1.22/include/asm-sh/pgtable.h	Tue Mar 23 05:05:27 2004
+++ edited/include/asm-sh/pgtable.h	Tue Apr 20 12:13:49 2004
@@ -264,16 +264,6 @@
 #define pte_to_pgoff(pte)	(pte_val(pte))
 #define pgoff_to_pte(off)	((pte_t) { (off) | _PAGE_FILE })
 
-/*
- * Routines for update of PTE 
- *
- * We just can use generic implementation, as SuperH has no SMP feature.
- * (We needed atomic implementation for SMP)
- *
- */
-
-#define pte_same(A,B)	(pte_val(A) == pte_val(B))
-
 typedef pte_t *pte_addr_t;
 
 #endif /* !__ASSEMBLY__ */
@@ -291,12 +281,11 @@
 extern unsigned int kobjsize(const void *objp);
 #endif /* !CONFIG_MMU */
 
-#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#ifdef CONFIG_CPU_SH4
 #define __HAVE_ARCH_PTEP_GET_AND_CLEAR
-#define __HAVE_ARCH_PTEP_SET_WRPROTECT
-#define __HAVE_ARCH_PTEP_MKDIRTY
-#define __HAVE_ARCH_PTE_SAME
+extern inline pte_t ptep_get_and_clear(pte_t *ptep);
+#endif
+
 #include <asm-generic/pgtable.h>
 
 #endif /* __ASM_SH_PAGE_H */

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-04-20 16:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-18 22:17 [PATCH 1/2] Clean up asm/pgalloc.h include Russell King
2004-04-18 22:23 ` [PATCH 2/2] " Russell King
2004-04-18 22:48   ` [PATCH 3/2] " Russell King
2004-04-19 13:20   ` [PATCH] Clean up asm/pgalloc.h include (alpha) Russell King
2004-04-19 20:55     ` Ivan Kokshaysky
2004-04-19 13:20   ` [PATCH] Clean up asm/pgalloc.h include (arm26) Russell King
2004-04-19 13:20   ` [PATCH] Clean up asm/pgalloc.h include (cris) Russell King
2004-04-19 13:21   ` [PATCH] Clean up asm/pgalloc.h include (H8300) Russell King
2004-04-19 13:21   ` [PATCH] Clean up asm/pgalloc.h include (ia64) Russell King
2004-04-19 20:56     ` Alex Williamson
2004-04-19 13:21   ` [PATCH] Clean up asm/pgalloc.h include (m68k) Russell King
2004-04-19 16:18     ` Geert Uytterhoeven
2004-04-19 16:30       ` Russell King
2004-04-19 16:39         ` Geert Uytterhoeven
2004-04-19 16:38       ` Russell King
2004-04-19 13:21   ` [PATCH] Clean up asm/pgalloc.h include (m68knommu) Russell King
2004-04-19 13:21   ` [PATCH] Clean up asm/pgalloc.h include (mips) Russell King
2004-04-19 16:36     ` Ralf Baechle
2004-04-19 13:21   ` [PATCH] Clean up asm/pgalloc.h include (parisc) Russell King
2004-04-19 13:22   ` [PATCH] Clean up asm/pgalloc.h include (ppc) Russell King
2004-04-29 22:08     ` Tom Rini
2004-04-19 13:22   ` [PATCH] Clean up asm/pgalloc.h include (ppc64) Russell King
2004-04-19 13:22   ` [PATCH] Clean up asm/pgalloc.h include (s390) Russell King
2004-04-19 13:22   ` [PATCH] Clean up asm/pgalloc.h include (sh) Russell King
2004-04-20 14:46     ` Paul Mundt
2004-04-20 16:01       ` Hugh Dickins
2004-04-20 16:19         ` Paul Mundt [this message]
2004-04-19 13:22   ` [PATCH] Clean up asm/pgalloc.h include (sparc) Russell King
2004-04-19 13:23   ` [PATCH] Clean up asm/pgalloc.h include (sparc64) Russell King
2004-04-19 13:23   ` [PATCH] Clean up asm/pgalloc.h include (v850) Russell King
2004-04-19 13:23   ` [PATCH] Clean up asm/pgalloc.h include (x86_64) Russell King
2004-04-19 14:03     ` [discuss] " Andi Kleen

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=20040420161940.GA20353@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox