]> rtime.felk.cvut.cz Git - mcf548x/linux.git/commitdiff
PGtable fixes
authorMartin <meloumar@cmp.felk.cvut.cz>
Fri, 27 May 2011 01:02:59 +0000 (03:02 +0200)
committerMartin <meloumar@cmp.felk.cvut.cz>
Fri, 27 May 2011 01:02:59 +0000 (03:02 +0200)
Checksum marked to be fixed.

arch/m68k/include/asm/checksum.h
arch/m68k/include/asm/mcf_pgalloc.h
arch/m68k/include/asm/mcf_pgtable.h
arch/m68k/include/asm/pgtable_mm.h

index ec514485c8b6557bc18804c8f53589d4ed6eaefe..bfd09bcaa102936e06bc38f9cd8a6cb2107ceb3c 100644 (file)
@@ -66,7 +66,9 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
 {
        unsigned int sum = 0;
        unsigned long tmp;
-
+#ifdef CONFIG_COLDFIRE
+       #error need to do this in CF asm 
+#else
        __asm__ ("subqw #1,%2\n"
                 "1:\t"
                 "movel %1@+,%3\n\t"
@@ -80,12 +82,19 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
                 : "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp)
                 : "0" (sum), "1" (iph), "2" (ihl)
                 : "memory");
+#endif
        return (__force __sum16)~sum;
 }
 
 static inline __sum16 csum_fold(__wsum sum)
 {
        unsigned int tmp = (__force u32)sum;
+#ifdef CONFIG_COLDFIRE
+       #error need to do this in CF asm 
+       /*tmp = (tmp & 0xffff) + (tmp >> 16);
+       tmp = (tmp & 0xffff) + (tmp >> 16);
+       return (__force __sum16) ~tmp;*/
+#else
 
        __asm__("swap %1\n\t"
                "addw %1, %0\n\t"
@@ -93,7 +102,7 @@ static inline __sum16 csum_fold(__wsum sum)
                "addxw %1, %0"
                : "=&d" (sum), "=&d" (tmp)
                : "0" (sum), "1" (tmp));
-
+#endif
        return (__force __sum16)~sum;
 }
 
index 0932ecf5538a748d7d80d319b01340e1231072f6..1ddc2a6eaf2fca001a582e9c1714495f41d71ba4 100644 (file)
@@ -42,12 +42,12 @@ extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
 
 #define pmd_pgtable(pmd) pmd_page(pmd)
 
-static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *page)
+static inline void __pte_free_tlb(struct mmu_gather *tlb, struct pte_t *pte, unsigned long address)
 {
-       __free_page(page);
+       free_page((unsigned long) pte);
 }
 
-#define __pmd_free_tlb(tlb, pmd) do { } while (0)
+#define __pmd_free_tlb(tlb, pmd, address) do { } while (0)
 
 static inline struct page *pte_alloc_one(struct mm_struct *mm,
        unsigned long address)
index 0b63fb5b3f6ecd134e6b73892c4505853494313a..2145080cf0de2c4b82e7a4d43b11c494ce628fef 100644 (file)
@@ -214,6 +214,9 @@ extern inline int pgd_bad(pgd_t pgd) { return 0; }
 extern inline int pgd_present(pgd_t pgd) { return 1; }
 extern inline void pgd_clear(pgd_t *pgdp) {}
 
+//FIXME: maybe support with a fakebit?
+static inline int pte_special(pte_t pte)       { return 0; }
+static inline pte_t pte_mkspecial(pte_t pte)   { return pte; }
 
 #define pte_ERROR(e) \
        printk(KERN_ERR "%s:%d: bad pte %08lx.\n",      \
index 82878af9f45e706c34d11677a171366592fc8c04..07a54ae256df47925e0764984695f1b53881e67d 100644 (file)
@@ -40,6 +40,8 @@
 /* PGDIR_SHIFT determines what a third-level page table entry can map */
 #ifdef CONFIG_SUN3
 #define PGDIR_SHIFT     17
+#elif defined(CONFIG_COLDFIRE)
+#define PGDIR_SHIFT    22
 #else
 #define PGDIR_SHIFT    25
 #endif
 #define PTRS_PER_PTE   16
 #define PTRS_PER_PMD   1
 #define PTRS_PER_PGD   2048
+#elif defined(CONFIG_COLDFIRE)
+#define PTRS_PER_PTE    512
+#define PTRS_PER_PMD    1
+#define PTRS_PER_PGD    1024
 #else
 #define PTRS_PER_PTE   1024
 #define PTRS_PER_PMD   8
@@ -147,8 +153,9 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
  * Macro to mark a page protection value as "uncacheable".
  */
 #ifdef CONFIG_COLDFIRE
-# define define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | CF_PAGE_NOCACHE))
-#elif defined(SUN3_PAGE_NOCACHE)
+# define pgprot_noncached(prot)        (__pgprot(pgprot_val(prot) | CF_PAGE_NOCACHE))
+#else /* CONFIG_COLDFIRE */
+#if defined(SUN3_PAGE_NOCACHE)
 # define __SUN3_PAGE_NOCACHE   SUN3_PAGE_NOCACHE
 #else
 # define __SUN3_PAGE_NOCACHE   0
@@ -163,6 +170,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
            ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S))  \
            : (prot)))
 
+#endif /* CONFIG_COLDFIRE */
 #include <asm-generic/pgtable.h>
 #endif /* !__ASSEMBLY__ */