2 * Copyright 2007-2009 Freescale Semiconductor, Inc. All Rights Reserved.
5 #ifndef M68K_CF_PGALLOC_H
6 #define M68K_CF_PGALLOC_H
7 #include <linux/highmem.h>
8 #include <asm/coldfire.h>
10 #include <asm/cf_tlbflush.h>
11 #include <asm/cf_cacheflush.h>
13 extern inline void pte_free_kernel(struct mm_struct
*mm
, pte_t
*pte
)
15 free_page((unsigned long) pte
);
18 extern const char bad_pmd_string
[];
20 extern inline pte_t
*pte_alloc_one_kernel(struct mm_struct
*mm
,
21 unsigned long address
)
23 unsigned long page
= __get_free_page(GFP_KERNEL
|__GFP_REPEAT
);
28 memset((void *)page
, 0, PAGE_SIZE
);
29 return (pte_t
*) (page
);
32 extern inline pmd_t
*pmd_alloc_kernel(pgd_t
*pgd
, unsigned long address
)
37 #define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
38 #define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
40 #define pte_alloc_one_fast(mm, addr) pte_alloc_one(mm, addr)
42 #define pmd_populate(mm, pmd, page) (pmd_val(*pmd) = \
43 (unsigned long)(page_address(page)))
45 #define pmd_populate_kernel(mm, pmd, pte) (pmd_val(*pmd) = (unsigned long)(pte))
47 #define pmd_pgtable(pmd) pmd_page(pmd)
49 static inline void __pte_free_tlb(struct mmu_gather
*tlb
, struct page
*page
, unsigned long address
)
54 #define __pmd_free_tlb(tlb, pmd, addr) do { } while (0)
56 static inline struct page
*pte_alloc_one(struct mm_struct
*mm
,
57 unsigned long address
)
59 struct page
*page
= alloc_pages(GFP_KERNEL
|__GFP_REPEAT
, 0);
68 __flush_page_to_ram(pte
);
69 flush_tlb_kernel_page(pte
);
77 extern inline void pte_free(struct mm_struct
*mm
, struct page
*page
)
83 * In our implementation, each pgd entry contains 1 pmd that is never allocated
84 * or freed. pgd_present is always 1, so this should never be called. -NL
86 #define pmd_free(mm, pmd) BUG()
88 extern inline void pgd_free(struct mm_struct
*mm
, pgd_t
*pgd
)
90 free_page((unsigned long) pgd
);
93 extern inline pgd_t
*pgd_alloc(struct mm_struct
*mm
)
97 new_pgd
= (pgd_t
*)__get_free_page(GFP_KERNEL
| __GFP_NOWARN
);
100 memcpy(new_pgd
, swapper_pg_dir
, PAGE_SIZE
);
101 memset(new_pgd
, 0, PAGE_OFFSET
>> PGDIR_SHIFT
);
105 #define pgd_populate(mm, pmd, pte) BUG()
107 #endif /* M68K_CF_PGALLOC_H */
This page took 0.048831 seconds and 5 git commands to generate.