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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_POWERPC_BOOK3S_32_PGALLOC_H
  3 #define _ASM_POWERPC_BOOK3S_32_PGALLOC_H
  4 
  5 #include <linux/threads.h>
  6 #include <linux/slab.h>
  7 
  8 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
  9 {
 10         return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
 11                         pgtable_gfp_flags(mm, GFP_KERNEL));
 12 }
 13 
 14 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 15 {
 16         kmem_cache_free(PGT_CACHE(PGD_INDEX_SIZE), pgd);
 17 }
 18 
 19 /*
 20  * We don't have any real pmd's, and this code never triggers because
 21  * the pgd will always be present..
 22  */
 23 /* #define pmd_alloc_one(mm,address)       ({ BUG(); ((pmd_t *)2); }) */
 24 #define pmd_free(mm, x)                 do { } while (0)
 25 #define __pmd_free_tlb(tlb,x,a)         do { } while (0)
 26 /* #define pgd_populate(mm, pmd, pte)      BUG() */
 27 
 28 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp,
 29                                        pte_t *pte)
 30 {
 31         *pmdp = __pmd(__pa(pte) | _PMD_PRESENT);
 32 }
 33 
 34 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
 35                                 pgtable_t pte_page)
 36 {
 37         *pmdp = __pmd(__pa(pte_page) | _PMD_PRESENT);
 38 }
 39 
 40 static inline void pgtable_free(void *table, unsigned index_size)
 41 {
 42         if (!index_size) {
 43                 pte_fragment_free((unsigned long *)table, 0);
 44         } else {
 45                 BUG_ON(index_size > MAX_PGTABLE_INDEX_SIZE);
 46                 kmem_cache_free(PGT_CACHE(index_size), table);
 47         }
 48 }
 49 
 50 static inline void pgtable_free_tlb(struct mmu_gather *tlb,
 51                                     void *table, int shift)
 52 {
 53         unsigned long pgf = (unsigned long)table;
 54         BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE);
 55         pgf |= shift;
 56         tlb_remove_table(tlb, (void *)pgf);
 57 }
 58 
 59 static inline void __tlb_remove_table(void *_table)
 60 {
 61         void *table = (void *)((unsigned long)_table & ~MAX_PGTABLE_INDEX_SIZE);
 62         unsigned shift = (unsigned long)_table & MAX_PGTABLE_INDEX_SIZE;
 63 
 64         pgtable_free(table, shift);
 65 }
 66 
 67 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
 68                                   unsigned long address)
 69 {
 70         pgtable_free_tlb(tlb, table, 0);
 71 }
 72 #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */
 73 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php