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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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 ] ~

Diff markup

Differences between /arch/mips/mm/pgtable-64.c (Architecture i386) and /arch/mips/mm/pgtable-64.c (Architecture mips)


  1 /*                                                  1 /*
  2  * This file is subject to the terms and condi      2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the mai      3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.                                4  * for more details.
  5  *                                                  5  *
  6  * Copyright (C) 1999, 2000 by Silicon Graphic      6  * Copyright (C) 1999, 2000 by Silicon Graphics
  7  * Copyright (C) 2003 by Ralf Baechle               7  * Copyright (C) 2003 by Ralf Baechle
  8  */                                                 8  */
  9 #include <linux/export.h>                           9 #include <linux/export.h>
 10 #include <linux/init.h>                            10 #include <linux/init.h>
 11 #include <linux/mm.h>                              11 #include <linux/mm.h>
 12 #include <asm/fixmap.h>                            12 #include <asm/fixmap.h>
 13 #include <asm/pgalloc.h>                           13 #include <asm/pgalloc.h>
 14 #include <asm/tlbflush.h>                          14 #include <asm/tlbflush.h>
 15                                                    15 
 16 void pgd_init(void *addr)                          16 void pgd_init(void *addr)
 17 {                                                  17 {
 18         unsigned long *p, *end;                    18         unsigned long *p, *end;
 19         unsigned long entry;                       19         unsigned long entry;
 20                                                    20 
 21 #if !defined(__PAGETABLE_PUD_FOLDED)               21 #if !defined(__PAGETABLE_PUD_FOLDED)
 22         entry = (unsigned long)invalid_pud_tab     22         entry = (unsigned long)invalid_pud_table;
 23 #elif !defined(__PAGETABLE_PMD_FOLDED)             23 #elif !defined(__PAGETABLE_PMD_FOLDED)
 24         entry = (unsigned long)invalid_pmd_tab     24         entry = (unsigned long)invalid_pmd_table;
 25 #else                                              25 #else
 26         entry = (unsigned long)invalid_pte_tab     26         entry = (unsigned long)invalid_pte_table;
 27 #endif                                             27 #endif
 28                                                    28 
 29         p = (unsigned long *) addr;                29         p = (unsigned long *) addr;
 30         end = p + PTRS_PER_PGD;                    30         end = p + PTRS_PER_PGD;
 31                                                    31 
 32         do {                                       32         do {
 33                 p[0] = entry;                      33                 p[0] = entry;
 34                 p[1] = entry;                      34                 p[1] = entry;
 35                 p[2] = entry;                      35                 p[2] = entry;
 36                 p[3] = entry;                      36                 p[3] = entry;
 37                 p[4] = entry;                      37                 p[4] = entry;
 38                 p += 8;                            38                 p += 8;
 39                 p[-3] = entry;                     39                 p[-3] = entry;
 40                 p[-2] = entry;                     40                 p[-2] = entry;
 41                 p[-1] = entry;                     41                 p[-1] = entry;
 42         } while (p != end);                        42         } while (p != end);
 43 }                                                  43 }
 44                                                    44 
 45 #ifndef __PAGETABLE_PMD_FOLDED                     45 #ifndef __PAGETABLE_PMD_FOLDED
 46 void pmd_init(void *addr)                          46 void pmd_init(void *addr)
 47 {                                                  47 {
 48         unsigned long *p, *end;                    48         unsigned long *p, *end;
 49         unsigned long pagetable = (unsigned lo     49         unsigned long pagetable = (unsigned long)invalid_pte_table;
 50                                                    50 
 51         p = (unsigned long *)addr;                 51         p = (unsigned long *)addr;
 52         end = p + PTRS_PER_PMD;                    52         end = p + PTRS_PER_PMD;
 53                                                    53 
 54         do {                                       54         do {
 55                 p[0] = pagetable;                  55                 p[0] = pagetable;
 56                 p[1] = pagetable;                  56                 p[1] = pagetable;
 57                 p[2] = pagetable;                  57                 p[2] = pagetable;
 58                 p[3] = pagetable;                  58                 p[3] = pagetable;
 59                 p[4] = pagetable;                  59                 p[4] = pagetable;
 60                 p += 8;                            60                 p += 8;
 61                 p[-3] = pagetable;                 61                 p[-3] = pagetable;
 62                 p[-2] = pagetable;                 62                 p[-2] = pagetable;
 63                 p[-1] = pagetable;                 63                 p[-1] = pagetable;
 64         } while (p != end);                        64         } while (p != end);
 65 }                                                  65 }
 66 EXPORT_SYMBOL_GPL(pmd_init);                       66 EXPORT_SYMBOL_GPL(pmd_init);
 67 #endif                                             67 #endif
 68                                                    68 
 69 #ifndef __PAGETABLE_PUD_FOLDED                     69 #ifndef __PAGETABLE_PUD_FOLDED
 70 void pud_init(void *addr)                          70 void pud_init(void *addr)
 71 {                                                  71 {
 72         unsigned long *p, *end;                    72         unsigned long *p, *end;
 73         unsigned long pagetable = (unsigned lo     73         unsigned long pagetable = (unsigned long)invalid_pmd_table;
 74                                                    74 
 75         p = (unsigned long *)addr;                 75         p = (unsigned long *)addr;
 76         end = p + PTRS_PER_PUD;                    76         end = p + PTRS_PER_PUD;
 77                                                    77 
 78         do {                                       78         do {
 79                 p[0] = pagetable;                  79                 p[0] = pagetable;
 80                 p[1] = pagetable;                  80                 p[1] = pagetable;
 81                 p[2] = pagetable;                  81                 p[2] = pagetable;
 82                 p[3] = pagetable;                  82                 p[3] = pagetable;
 83                 p[4] = pagetable;                  83                 p[4] = pagetable;
 84                 p += 8;                            84                 p += 8;
 85                 p[-3] = pagetable;                 85                 p[-3] = pagetable;
 86                 p[-2] = pagetable;                 86                 p[-2] = pagetable;
 87                 p[-1] = pagetable;                 87                 p[-1] = pagetable;
 88         } while (p != end);                        88         } while (p != end);
 89 }                                                  89 }
 90 #endif                                             90 #endif
 91                                                    91 
 92 #ifdef CONFIG_TRANSPARENT_HUGEPAGE                 92 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 93 pmd_t mk_pmd(struct page *page, pgprot_t prot)     93 pmd_t mk_pmd(struct page *page, pgprot_t prot)
 94 {                                                  94 {
 95         pmd_t pmd;                                 95         pmd_t pmd;
 96                                                    96 
 97         pmd_val(pmd) = (page_to_pfn(page) << P     97         pmd_val(pmd) = (page_to_pfn(page) << PFN_PTE_SHIFT) | pgprot_val(prot);
 98                                                    98 
 99         return pmd;                                99         return pmd;
100 }                                                 100 }
101                                                   101 
102 void set_pmd_at(struct mm_struct *mm, unsigned    102 void set_pmd_at(struct mm_struct *mm, unsigned long addr,
103                 pmd_t *pmdp, pmd_t pmd)           103                 pmd_t *pmdp, pmd_t pmd)
104 {                                                 104 {
105         *pmdp = pmd;                              105         *pmdp = pmd;
106 }                                                 106 }
107 #endif                                            107 #endif
108                                                   108 
109 void __init pagetable_init(void)                  109 void __init pagetable_init(void)
110 {                                                 110 {
111         unsigned long vaddr;                      111         unsigned long vaddr;
112         pgd_t *pgd_base;                          112         pgd_t *pgd_base;
113                                                   113 
114         /* Initialize the entire pgd.  */         114         /* Initialize the entire pgd.  */
115         pgd_init(swapper_pg_dir);                 115         pgd_init(swapper_pg_dir);
116 #ifndef __PAGETABLE_PUD_FOLDED                    116 #ifndef __PAGETABLE_PUD_FOLDED
117         pud_init(invalid_pud_table);              117         pud_init(invalid_pud_table);
118 #endif                                            118 #endif
119 #ifndef __PAGETABLE_PMD_FOLDED                    119 #ifndef __PAGETABLE_PMD_FOLDED
120         pmd_init(invalid_pmd_table);              120         pmd_init(invalid_pmd_table);
121 #endif                                            121 #endif
122         pgd_base = swapper_pg_dir;                122         pgd_base = swapper_pg_dir;
123         /*                                        123         /*
124          * Fixed mappings:                        124          * Fixed mappings:
125          */                                       125          */
126         vaddr = __fix_to_virt(__end_of_fixed_a    126         vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
127         fixrange_init(vaddr, vaddr + FIXADDR_S    127         fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base);
128 }                                                 128 }
129                                                   129 

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