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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/nohash/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_NOHASH_PGALLOC_H
  3 #define _ASM_POWERPC_NOHASH_PGALLOC_H
  4 
  5 #include <linux/mm.h>
  6 #include <linux/slab.h>
  7 
  8 extern void tlb_remove_table(struct mmu_gather *tlb, void *table);
  9 #ifdef CONFIG_PPC64
 10 extern void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address);
 11 #else
 12 /* 44x etc which is BOOKE not BOOK3E */
 13 static inline void tlb_flush_pgtable(struct mmu_gather *tlb,
 14                                      unsigned long address)
 15 {
 16 
 17 }
 18 #endif /* !CONFIG_PPC_BOOK3E_64 */
 19 
 20 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 21 {
 22         return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
 23                         pgtable_gfp_flags(mm, GFP_KERNEL));
 24 }
 25 
 26 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
 27 {
 28         kmem_cache_free(PGT_CACHE(PGD_INDEX_SIZE), pgd);
 29 }
 30 
 31 #ifdef CONFIG_PPC64
 32 #include <asm/nohash/64/pgalloc.h>
 33 #else
 34 #include <asm/nohash/32/pgalloc.h>
 35 #endif
 36 
 37 static inline void pgtable_free(void *table, int shift)
 38 {
 39         if (!shift) {
 40                 pte_fragment_free((unsigned long *)table, 0);
 41         } else {
 42                 BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE);
 43                 kmem_cache_free(PGT_CACHE(shift), table);
 44         }
 45 }
 46 
 47 static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift)
 48 {
 49         unsigned long pgf = (unsigned long)table;
 50 
 51         BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE);
 52         pgf |= shift;
 53         tlb_remove_table(tlb, (void *)pgf);
 54 }
 55 
 56 static inline void __tlb_remove_table(void *_table)
 57 {
 58         void *table = (void *)((unsigned long)_table & ~MAX_PGTABLE_INDEX_SIZE);
 59         unsigned shift = (unsigned long)_table & MAX_PGTABLE_INDEX_SIZE;
 60 
 61         pgtable_free(table, shift);
 62 }
 63 
 64 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
 65                                   unsigned long address)
 66 {
 67         tlb_flush_pgtable(tlb, address);
 68         pgtable_free_tlb(tlb, table, 0);
 69 }
 70 #endif /* _ASM_POWERPC_NOHASH_PGALLOC_H */
 71 

~ [ 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