x86: sanitize pathes arch/x86/kernel/cpu/Makefile
[linux-2.6-block.git] / include / asm-i386 / pgtable.h
index 2394589786bae215942e38e80c940efee25cd1df..c7fefa6b12fd41bc5856908f9c869dfd3d8eecc1 100644 (file)
@@ -79,7 +79,7 @@ void paging_init(void);
  * area for the same reason. ;)
  */
 #define VMALLOC_OFFSET (8*1024*1024)
-#define VMALLOC_START  (((unsigned long) high_memory + vmalloc_earlyreserve + \
+#define VMALLOC_START  (((unsigned long) high_memory + \
                        2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))
 #ifdef CONFIG_HIGHMEM
 # define VMALLOC_END   (PKMAP_BASE-2*PAGE_SIZE)
@@ -218,8 +218,6 @@ extern unsigned long pg0[];
  * The following only work if pte_present() is true.
  * Undefined behaviour if not..
  */
-static inline int pte_user(pte_t pte)          { return (pte).pte_low & _PAGE_USER; }
-static inline int pte_read(pte_t pte)          { return (pte).pte_low & _PAGE_USER; }
 static inline int pte_dirty(pte_t pte)         { return (pte).pte_low & _PAGE_DIRTY; }
 static inline int pte_young(pte_t pte)         { return (pte).pte_low & _PAGE_ACCESSED; }
 static inline int pte_write(pte_t pte)         { return (pte).pte_low & _PAGE_RW; }
@@ -230,13 +228,9 @@ static inline int pte_huge(pte_t pte)              { return (pte).pte_low & _PAGE_PSE; }
  */
 static inline int pte_file(pte_t pte)          { return (pte).pte_low & _PAGE_FILE; }
 
-static inline pte_t pte_rdprotect(pte_t pte)   { (pte).pte_low &= ~_PAGE_USER; return pte; }
-static inline pte_t pte_exprotect(pte_t pte)   { (pte).pte_low &= ~_PAGE_USER; return pte; }
 static inline pte_t pte_mkclean(pte_t pte)     { (pte).pte_low &= ~_PAGE_DIRTY; return pte; }
 static inline pte_t pte_mkold(pte_t pte)       { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; }
 static inline pte_t pte_wrprotect(pte_t pte)   { (pte).pte_low &= ~_PAGE_RW; return pte; }
-static inline pte_t pte_mkread(pte_t pte)      { (pte).pte_low |= _PAGE_USER; return pte; }
-static inline pte_t pte_mkexec(pte_t pte)      { (pte).pte_low |= _PAGE_USER; return pte; }
 static inline pte_t pte_mkdirty(pte_t pte)     { (pte).pte_low |= _PAGE_DIRTY; return pte; }
 static inline pte_t pte_mkyoung(pte_t pte)     { (pte).pte_low |= _PAGE_ACCESSED; return pte; }
 static inline pte_t pte_mkwrite(pte_t pte)     { (pte).pte_low |= _PAGE_RW; return pte; }
@@ -285,53 +279,25 @@ static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
  */
 #define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 #define ptep_set_access_flags(vma, address, ptep, entry, dirty)                \
-do {                                                                   \
-       if (dirty) {                                                    \
+({                                                                     \
+       int __changed = !pte_same(*(ptep), entry);                      \
+       if (__changed && dirty) {                                       \
                (ptep)->pte_low = (entry).pte_low;                      \
                pte_update_defer((vma)->vm_mm, (address), (ptep));      \
                flush_tlb_page(vma, address);                           \
        }                                                               \
-} while (0)
-
-#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
-#define ptep_test_and_clear_dirty(vma, addr, ptep) ({                  \
-       int ret = 0;                                                    \
-       if (pte_dirty(*ptep))                                           \
-               ret = test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); \
-       if (ret)                                                        \
-               pte_update_defer(vma->vm_mm, addr, ptep);               \
-       ret;                                                            \
+       __changed;                                                      \
 })
 
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 #define ptep_test_and_clear_young(vma, addr, ptep) ({                  \
-       int ret = 0;                                                    \
-       if (pte_young(*ptep))                                           \
-               ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); \
-       if (ret)                                                        \
-               pte_update_defer(vma->vm_mm, addr, ptep);               \
-       ret;                                                            \
-})
-
-/*
- * Rules for using ptep_establish: the pte MUST be a user pte, and
- * must be a present->present transition.
- */
-#define __HAVE_ARCH_PTEP_ESTABLISH
-#define ptep_establish(vma, address, ptep, pteval)                     \
-do {                                                                   \
-       set_pte_present((vma)->vm_mm, address, ptep, pteval);           \
-       flush_tlb_page(vma, address);                                   \
-} while (0)
-
-#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
-#define ptep_clear_flush_dirty(vma, address, ptep)                     \
-({                                                                     \
-       int __dirty;                                                    \
-       __dirty = ptep_test_and_clear_dirty((vma), (address), (ptep));  \
-       if (__dirty)                                                    \
-               flush_tlb_page(vma, address);                           \
-       __dirty;                                                        \
+       int __ret = 0;                                                  \
+       if (pte_young(*(ptep)))                                         \
+               __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,          \
+                                               &(ptep)->pte_low);      \
+       if (__ret)                                                      \
+               pte_update((vma)->vm_mm, addr, ptep);                   \
+       __ret;                                                          \
 })
 
 #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH