summaryrefslogtreecommitdiff
path: root/include/asm-m32r/pgtable.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.davemloft.net>2005-02-22 23:42:56 -0800
committerDavid S. Miller <davem@nuts.davemloft.net>2005-02-22 23:42:56 -0800
commitae3d0a847f4b38812241e4a5dc3371965c752a8c (patch)
tree41ba29cfb3f0085b0f82a9387c6e492274678a37 /include/asm-m32r/pgtable.h
parent75be0272cb9b49ee7cb753b008844b89c2269585 (diff)
[MM]: Add set_pte_at() which takes 'mm' and 'addr' args.
I'm taking a slightly different approach this time around so things are easier to integrate. Here is the first patch which builds the infrastructure. Basically: 1) Add set_pte_at() which is set_pte() with 'mm' and 'addr' arguments added. All generic code uses set_pte_at(). Most platforms simply get this define: #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) I chose this method over simply changing all set_pte() call sites because many platforms implement this in assembler and it would take forever to preserve the build and stabilize things if modifying that was necessary. Soon, with platform maintainer's help, we can kill of set_pte() entirely. To be honest, there are only a handful of set_pte() call sites in the arch specific code. Actually, in this patch ppc64 is completely set_pte() free and does not define it. 2) pte_clear() gets 'mm' and 'addr' arguments now. This had a cascading effect on many ptep_test_and_*() routines. Specifically: a) ptep_test_and_clear_{young,dirty}() now take 'vma' and 'address' args. b) ptep_get_and_clear now take 'mm' and 'address' args. c) ptep_mkdirty was deleted, unused by any code. d) ptep_set_wrprotect now takes 'mm' and 'address' args. I've tested this patch as follows: 1) compile and run tested on sparc64/SMP 2) compile tested on: a) ppc64/SMP b) i386 both with and without PAE enabled Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-m32r/pgtable.h')
-rw-r--r--include/asm-m32r/pgtable.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h
index d2b67741e381..1710d91d4e56 100644
--- a/include/asm-m32r/pgtable.h
+++ b/include/asm-m32r/pgtable.h
@@ -176,7 +176,7 @@ extern unsigned long empty_zero_page[1024];
/* page table for 0-4MB for everybody */
#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE))
-#define pte_clear(xp) do { set_pte(xp, __pte(0)); } while (0)
+#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
#define pmd_none(x) (!pmd_val(x))
#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
@@ -282,26 +282,21 @@ static inline pte_t pte_mkwrite(pte_t pte)
return pte;
}
-static inline int ptep_test_and_clear_dirty(pte_t *ptep)
+static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
{
return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep);
}
-static inline int ptep_test_and_clear_young(pte_t *ptep)
+static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
{
return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep);
}
-static inline void ptep_set_wrprotect(pte_t *ptep)
+static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
clear_bit(_PAGE_BIT_WRITE, ptep);
}
-static inline void ptep_mkdirty(pte_t *ptep)
-{
- set_bit(_PAGE_BIT_DIRTY, ptep);
-}
-
/*
* Macro and implementation to make a page protection as uncachable.
*/
@@ -390,7 +385,6 @@ static inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
#define __HAVE_ARCH_PTEP_SET_WRPROTECT
-#define __HAVE_ARCH_PTEP_MKDIRTY
#define __HAVE_ARCH_PTE_SAME
#include <asm-generic/pgtable.h>