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

TOMOYO Linux Cross Reference
Linux/arch/alpha/include/asm/pgalloc.h

Version: ~ [ linux-5.12-rc7 ] ~ [ linux-5.11.13 ] ~ [ linux-5.10.29 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.111 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.186 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.230 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.266 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.266 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ALPHA_PGALLOC_H
  3 #define _ALPHA_PGALLOC_H
  4 
  5 #include <linux/mm.h>
  6 #include <linux/mmzone.h>
  7 
  8 /*      
  9  * Allocate and free page tables. The xxx_kernel() versions are
 10  * used to allocate a kernel page table - this turns on ASN bits
 11  * if any.
 12  */
 13 
 14 static inline void
 15 pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte)
 16 {
 17         pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET));
 18 }
 19 #define pmd_pgtable(pmd) pmd_page(pmd)
 20 
 21 static inline void
 22 pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
 23 {
 24         pmd_set(pmd, pte);
 25 }
 26 
 27 static inline void
 28 pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
 29 {
 30         pgd_set(pgd, pmd);
 31 }
 32 
 33 extern pgd_t *pgd_alloc(struct mm_struct *mm);
 34 
 35 static inline void
 36 pgd_free(struct mm_struct *mm, pgd_t *pgd)
 37 {
 38         free_page((unsigned long)pgd);
 39 }
 40 
 41 static inline pmd_t *
 42 pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 43 {
 44         pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
 45         return ret;
 46 }
 47 
 48 static inline void
 49 pmd_free(struct mm_struct *mm, pmd_t *pmd)
 50 {
 51         free_page((unsigned long)pmd);
 52 }
 53 
 54 static inline pte_t *
 55 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 56 {
 57         pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
 58         return pte;
 59 }
 60 
 61 static inline void
 62 pte_free_kernel(struct mm_struct *mm, pte_t *pte)
 63 {
 64         free_page((unsigned long)pte);
 65 }
 66 
 67 static inline pgtable_t
 68 pte_alloc_one(struct mm_struct *mm, unsigned long address)
 69 {
 70         pte_t *pte = pte_alloc_one_kernel(mm, address);
 71         struct page *page;
 72 
 73         if (!pte)
 74                 return NULL;
 75         page = virt_to_page(pte);
 76         if (!pgtable_page_ctor(page)) {
 77                 __free_page(page);
 78                 return NULL;
 79         }
 80         return page;
 81 }
 82 
 83 static inline void
 84 pte_free(struct mm_struct *mm, pgtable_t page)
 85 {
 86         pgtable_page_dtor(page);
 87         __free_page(page);
 88 }
 89 
 90 #define check_pgt_cache()       do { } while (0)
 91 
 92 #endif /* _ALPHA_PGALLOC_H */
 93 

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