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

TOMOYO Linux Cross Reference
Linux/arch/mips/mm/pgtable-64.c

Version: ~ [ linux-5.18-rc6 ] ~ [ linux-5.17.6 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.38 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.114 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.192 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.241 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.277 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.312 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (C) 1999, 2000 by Silicon Graphics
  7  * Copyright (C) 2003 by Ralf Baechle
  8  */
  9 #include <linux/init.h>
 10 #include <linux/mm.h>
 11 #include <asm/fixmap.h>
 12 #include <asm/pgtable.h>
 13 #include <asm/pgalloc.h>
 14 #include <asm/tlbflush.h>
 15 
 16 void pgd_init(unsigned long page)
 17 {
 18         unsigned long *p, *end;
 19         unsigned long entry;
 20 
 21 #ifdef __PAGETABLE_PMD_FOLDED
 22         entry = (unsigned long)invalid_pte_table;
 23 #else
 24         entry = (unsigned long)invalid_pmd_table;
 25 #endif
 26 
 27         p = (unsigned long *) page;
 28         end = p + PTRS_PER_PGD;
 29 
 30         do {
 31                 p[0] = entry;
 32                 p[1] = entry;
 33                 p[2] = entry;
 34                 p[3] = entry;
 35                 p[4] = entry;
 36                 p += 8;
 37                 p[-3] = entry;
 38                 p[-2] = entry;
 39                 p[-1] = entry;
 40         } while (p != end);
 41 }
 42 
 43 #ifndef __PAGETABLE_PMD_FOLDED
 44 void pmd_init(unsigned long addr, unsigned long pagetable)
 45 {
 46         unsigned long *p, *end;
 47 
 48         p = (unsigned long *) addr;
 49         end = p + PTRS_PER_PMD;
 50 
 51         do {
 52                 p[0] = pagetable;
 53                 p[1] = pagetable;
 54                 p[2] = pagetable;
 55                 p[3] = pagetable;
 56                 p[4] = pagetable;
 57                 p += 8;
 58                 p[-3] = pagetable;
 59                 p[-2] = pagetable;
 60                 p[-1] = pagetable;
 61         } while (p != end);
 62 }
 63 #endif
 64 
 65 pmd_t mk_pmd(struct page *page, pgprot_t prot)
 66 {
 67         pmd_t pmd;
 68 
 69         pmd_val(pmd) = (page_to_pfn(page) << _PFN_SHIFT) | pgprot_val(prot);
 70 
 71         return pmd;
 72 }
 73 
 74 void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 75                 pmd_t *pmdp, pmd_t pmd)
 76 {
 77         *pmdp = pmd;
 78         flush_tlb_all();
 79 }
 80 
 81 void __init pagetable_init(void)
 82 {
 83         unsigned long vaddr;
 84         pgd_t *pgd_base;
 85 
 86         /* Initialize the entire pgd.  */
 87         pgd_init((unsigned long)swapper_pg_dir);
 88 #ifndef __PAGETABLE_PMD_FOLDED
 89         pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
 90 #endif
 91         pgd_base = swapper_pg_dir;
 92         /*
 93          * Fixed mappings:
 94          */
 95         vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
 96         fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base);
 97 }
 98 

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