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

TOMOYO Linux Cross Reference
Linux/arch/nios2/mm/init.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/nios2/mm/init.c (Version linux-6.12-rc7) and /arch/ppc/mm/init.c (Version linux-4.15.18)


  1 /*                                                  1 
  2  * Copyright (C) 2013 Altera Corporation          
  3  * Copyright (C) 2010 Tobias Klauser <tklauser    
  4  * Copyright (C) 2009 Wind River Systems Inc      
  5  *   Implemented by fredrik.markstrom@gmail.co    
  6  * Copyright (C) 2004 Microtronix Datacom Ltd     
  7  *                                                
  8  * based on arch/m68k/mm/init.c                   
  9  *                                                
 10  * This file is subject to the terms and condi    
 11  * License. See the file "COPYING" in the main    
 12  * for more details.                              
 13  */                                               
 14                                                   
 15 #include <linux/signal.h>                         
 16 #include <linux/sched.h>                          
 17 #include <linux/kernel.h>                         
 18 #include <linux/errno.h>                          
 19 #include <linux/string.h>                         
 20 #include <linux/types.h>                          
 21 #include <linux/ptrace.h>                         
 22 #include <linux/mman.h>                           
 23 #include <linux/mm.h>                             
 24 #include <linux/init.h>                           
 25 #include <linux/pagemap.h>                        
 26 #include <linux/memblock.h>                       
 27 #include <linux/slab.h>                           
 28 #include <linux/binfmts.h>                        
 29 #include <linux/execmem.h>                        
 30                                                   
 31 #include <asm/setup.h>                            
 32 #include <asm/page.h>                             
 33 #include <asm/sections.h>                         
 34 #include <asm/tlb.h>                              
 35 #include <asm/mmu_context.h>                      
 36 #include <asm/cpuinfo.h>                          
 37 #include <asm/processor.h>                        
 38                                                   
 39 pgd_t *pgd_current;                               
 40                                                   
 41 /*                                                
 42  * paging_init() continues the virtual memory     
 43  * was begun by the code in arch/head.S.          
 44  * The parameters are pointers to where to sti    
 45  * addresses of available kernel virtual memor    
 46  */                                               
 47 void __init paging_init(void)                     
 48 {                                                 
 49         unsigned long max_zone_pfn[MAX_NR_ZONE    
 50                                                   
 51         pagetable_init();                         
 52         pgd_current = swapper_pg_dir;             
 53                                                   
 54         max_zone_pfn[ZONE_NORMAL] = max_mapnr;    
 55                                                   
 56         /* pass the memory from the bootmem al    
 57         free_area_init(max_zone_pfn);             
 58                                                   
 59         flush_dcache_range((unsigned long)empt    
 60                         (unsigned long)empty_z    
 61 }                                                 
 62                                                   
 63 void __init mem_init(void)                        
 64 {                                                 
 65         unsigned long end_mem   = memory_end;     
 66                                                   
 67                                                   
 68         pr_debug("mem_init: start=%lx, end=%lx    
 69                                                   
 70         end_mem &= PAGE_MASK;                     
 71         high_memory = __va(end_mem);              
 72                                                   
 73         /* this will put all memory onto the f    
 74         memblock_free_all();                      
 75 }                                                 
 76                                                   
 77 void __init mmu_init(void)                        
 78 {                                                 
 79         flush_tlb_all();                          
 80 }                                                 
 81                                                   
 82 pgd_t swapper_pg_dir[PTRS_PER_PGD] __aligned(P    
 83 pte_t invalid_pte_table[PTRS_PER_PTE] __aligne    
 84 static struct page *kuser_page[1];                
 85 static struct vm_special_mapping vdso_mapping     
 86         .name = "[vdso]",                         
 87         .pages = kuser_page,                      
 88 };                                                
 89                                                   
 90 static int alloc_kuser_page(void)                 
 91 {                                                 
 92         extern char __kuser_helper_start[], __    
 93         int kuser_sz = __kuser_helper_end - __    
 94         unsigned long vpage;                      
 95                                                   
 96         vpage = get_zeroed_page(GFP_ATOMIC);      
 97         if (!vpage)                               
 98                 return -ENOMEM;                   
 99                                                   
100         /* Copy kuser helpers */                  
101         memcpy((void *)vpage, __kuser_helper_s    
102                                                   
103         flush_icache_range(vpage, vpage + KUSE    
104         kuser_page[0] = virt_to_page(vpage);      
105                                                   
106         return 0;                                 
107 }                                                 
108 arch_initcall(alloc_kuser_page);                  
109                                                   
110 int arch_setup_additional_pages(struct linux_b    
111 {                                                 
112         struct mm_struct *mm = current->mm;       
113         struct vm_area_struct *vma;               
114                                                   
115         mmap_write_lock(mm);                      
116                                                   
117         /* Map kuser helpers to user space add    
118         vma = _install_special_mapping(mm, KUS    
119                                       VM_READ     
120                                       VM_MAYEX    
121                                                   
122         mmap_write_unlock(mm);                    
123                                                   
124         return IS_ERR(vma) ? PTR_ERR(vma) : 0;    
125 }                                                 
126                                                   
127 const char *arch_vma_name(struct vm_area_struc    
128 {                                                 
129         return (vma->vm_start == KUSER_BASE) ?    
130 }                                                 
131                                                   
132 static const pgprot_t protection_map[16] = {      
133         [VM_NONE]                                 
134         [VM_READ]                                 
135         [VM_WRITE]                                
136         [VM_WRITE | VM_READ]                      
137         [VM_EXEC]                                 
138         [VM_EXEC | VM_READ]                       
139         [VM_EXEC | VM_WRITE]                      
140         [VM_EXEC | VM_WRITE | VM_READ]            
141         [VM_SHARED]                               
142         [VM_SHARED | VM_READ]                     
143         [VM_SHARED | VM_WRITE]                    
144         [VM_SHARED | VM_WRITE | VM_READ]          
145         [VM_SHARED | VM_EXEC]                     
146         [VM_SHARED | VM_EXEC | VM_READ]           
147         [VM_SHARED | VM_EXEC | VM_WRITE]          
148         [VM_SHARED | VM_EXEC | VM_WRITE | VM_R    
149 };                                                
150 DECLARE_VM_GET_PAGE_PROT                          
151                                                   
152 #ifdef CONFIG_EXECMEM                             
153 static struct execmem_info execmem_info __ro_a    
154                                                   
155 struct execmem_info __init *execmem_arch_setup    
156 {                                                 
157         execmem_info = (struct execmem_info){     
158                 .ranges = {                       
159                         [EXECMEM_DEFAULT] = {     
160                                 .start  = MODU    
161                                 .end    = MODU    
162                                 .pgprot = PAGE    
163                                 .alignment = 1    
164                         },                        
165                 },                                
166         };                                        
167                                                   
168         return &execmem_info;                     
169 }                                                 
170 #endif /* CONFIG_EXECMEM */                       
171                                                   

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