~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/pgalloc-32.h

Version: ~ [ linux-5.12 ] ~ [ linux-5.11.16 ] ~ [ linux-5.10.32 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.114 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.188 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.231 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.267 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.267 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _ASM_POWERPC_PGALLOC_32_H
  2 #define _ASM_POWERPC_PGALLOC_32_H
  3 
  4 #include <linux/threads.h>
  5 
  6 /* For 32-bit, all levels of page tables are just drawn from get_free_page() */
  7 #define MAX_PGTABLE_INDEX_SIZE  0
  8 
  9 extern void __bad_pte(pmd_t *pmd);
 10 
 11 extern pgd_t *pgd_alloc(struct mm_struct *mm);
 12 extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
 13 
 14 /*
 15  * We don't have any real pmd's, and this code never triggers because
 16  * the pgd will always be present..
 17  */
 18 /* #define pmd_alloc_one(mm,address)       ({ BUG(); ((pmd_t *)2); }) */
 19 #define pmd_free(mm, x)                 do { } while (0)
 20 #define __pmd_free_tlb(tlb,x,a)         do { } while (0)
 21 /* #define pgd_populate(mm, pmd, pte)      BUG() */
 22 
 23 #ifndef CONFIG_BOOKE
 24 
 25 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp,
 26                                        pte_t *pte)
 27 {
 28         *pmdp = __pmd(__pa(pte) | _PMD_PRESENT);
 29 }
 30 
 31 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
 32                                 pgtable_t pte_page)
 33 {
 34         *pmdp = __pmd((page_to_pfn(pte_page) << PAGE_SHIFT) | _PMD_PRESENT);
 35 }
 36 
 37 #define pmd_pgtable(pmd) pmd_page(pmd)
 38 #else
 39 
 40 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp,
 41                                        pte_t *pte)
 42 {
 43         *pmdp = __pmd((unsigned long)pte | _PMD_PRESENT);
 44 }
 45 
 46 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
 47                                 pgtable_t pte_page)
 48 {
 49         *pmdp = __pmd((unsigned long)lowmem_page_address(pte_page) | _PMD_PRESENT);
 50 }
 51 
 52 #define pmd_pgtable(pmd) pmd_page(pmd)
 53 #endif
 54 
 55 extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
 56 extern pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addr);
 57 
 58 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 59 {
 60         free_page((unsigned long)pte);
 61 }
 62 
 63 static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
 64 {
 65         pgtable_page_dtor(ptepage);
 66         __free_page(ptepage);
 67 }
 68 
 69 static inline void pgtable_free(void *table, unsigned index_size)
 70 {
 71         BUG_ON(index_size); /* 32-bit doesn't use this */
 72         free_page((unsigned long)table);
 73 }
 74 
 75 #define check_pgt_cache()       do { } while (0)
 76 
 77 #ifdef CONFIG_SMP
 78 static inline void pgtable_free_tlb(struct mmu_gather *tlb,
 79                                     void *table, int shift)
 80 {
 81         unsigned long pgf = (unsigned long)table;
 82         BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE);
 83         pgf |= shift;
 84         tlb_remove_table(tlb, (void *)pgf);
 85 }
 86 
 87 static inline void __tlb_remove_table(void *_table)
 88 {
 89         void *table = (void *)((unsigned long)_table & ~MAX_PGTABLE_INDEX_SIZE);
 90         unsigned shift = (unsigned long)_table & MAX_PGTABLE_INDEX_SIZE;
 91 
 92         pgtable_free(table, shift);
 93 }
 94 #else
 95 static inline void pgtable_free_tlb(struct mmu_gather *tlb,
 96                                     void *table, int shift)
 97 {
 98         pgtable_free(table, shift);
 99 }
100 #endif
101 
102 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
103                                   unsigned long address)
104 {
105         tlb_flush_pgtable(tlb, address);
106         pgtable_page_dtor(table);
107         pgtable_free_tlb(tlb, page_address(table), 0);
108 }
109 #endif /* _ASM_POWERPC_PGALLOC_32_H */
110 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp