git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogblamecommitdiffstats
path: root/include/linux/mm.h
blob: d8738a464b94a71822f191bdd45bcac29b01814c (plain) (tree)
1
2
3
4
5
6
7
8
9


                   



                        
                      
                      



                            
                         
                              
                           
                        
                      
                               
                           


                 
                     
                   
                         





                                                                           
                                    
                          










                                   
 

                                                               


                                                      








                                                              

                                         
                  

                                            




                                               
                                              





                                                                    
                                                                             





                                                                         
                                                         
                                  

                                  
                                                                             
      
                                                                                                      











                                                                                       
                                                                          
                                                                      
                                                                               

                                                                              
                                   
                                                                                   


                                                                           
                                                                                           
                                                                             
 
                                                                                
                                                                                          
                                                                              
                                                                                          
                                                                           
 


                                                                    
















                                                                            

                                                               



                                                                    




                                                                  

                                                                               
                                                                               
                                                                     
                                                                                        
                                                                                          
 







                                                                              

                                                                   
                                                  



                                                            
                                             
 
 
  
                                                                          

                                                                             
  


                                                                              
   





                                                                              
                                                                            
                                                                           
                                                           
                                           
  








                                                                         
                                                                       


                                                                           
                                                                              





                                                                              
                  






                                                                              
                                                                             










                                                                              

                                                                   

                                                                          





                  

                                                               
 




                                                        
                          











                                                                        


   
                                                                               
   

                                                      
                                                   
                                                  
 

  

                                                                            
   

                                                         
                                                  
 
 

                                          
                                        

                                               
 





                                                                        

                                                
                 


                                                           

                 
      
 


                                                    
                                                          



                 
 
































                                                                    

                                                           
                                     



                                        














                                                                   
                                               
 
                                                         

 










                                                        

                                               

                                              


                                                  

                                                               
                                                             
           
                                                   


                                  





                                                           








                                                                      


                                                                     




                                                                      
   

                                        

                                              
                                                                          




                                                       
                                                                







                                                      
                                 
                                             
 
                                                       
                                       
 
  
















                                                                           

                                                   
                            



                                               













                                                         




                                                                             
                 
  










                                                                         
      

  





                                                                          

                                                                         
                                                         
  




                                                                            
  








                                                                             


                                                                   



                                                                             
  


                                                                               
  


                                                                               
  


                                                                             
  



                                                                              
  
                                             

                                                                     



                                                                             




                                                              
   
 










                                                          


                                                                             
   
                                                                   






                                              
                                                                          

                                           


                                                        



                                                             
                                                                            






                                                                            


                                          
 
  
                                                                  


                                                                


                                                                        
 

                                                                            
                                                              

                                                                             
     
                                                           

                                                                          

      
                                                                    
 

                                                                            

      


                                                             
                                                           
 
                                                                  
 
                                                           
 
 







                                                                      

                                                 
                                                             

 
                                                
 




                          

 
                             
                                                
     
                                                      
 
                                                           
 

      
                                                             



                                                                             
                                                                   





                                                                             
                                                                    


                                                                 
      
 
                                                                        



                                                            
 



                                                                       
 
 
                                                                         
                                              
 

                                  
                                                                   
                                                       
      

 




                                                          
                                                                         
 
                                                 















                                                          
                                            












                                                                       







                                                                            





                                                                      

                                                                      





                                                                   
                                  

                                          
                                                            



                               





                                                                            











                                                                          
                                          



                           







                                                      



                                                               
 
                                                                        
 



                                                                     

                                                                                                  
 

                                                                                
                                                                 
 







                                                                                        
 




                                                                      

                                                                 
  
                                                                         



                                                                             

                                                              
 
                                                                      
                                                                                  

                                              
                              










                                                                                  

  


                                                                           

                                                                   
                                                                      
                                                          
                                       


                                                                           





                                                                      


                                                                   

                                                                      
                                                        

                                                                               



                                         




                                                                                  

                                                                             

                             

  

                                                          
                                                               
                                                                               

                                                                 

                                                                             

                                                                 

                                                                                

                                                                       






                                                                            
                                                                            
                                                                  

                                                                            
                                                                              
                                                                          
                                                                                
 

                                             
                 
                                                                            
                                                                   

                                                                             


                                                                          
                                           




                                                   







                                                            
      
 

                                                                                                         

                                                                     
 



                                                                           
                                                                 
                                                                                


                                                                           
                                               
 


                                                                       
                                                  
                                                     

                                                             
                                                                            
                                               
                                      


                                               
                                                          
                                                                               



                                                                              





















                                                                              


                                                                                


                                                                       


                                                                            


                                                                             
 
  



                                                                       


                                         

                                                                            








                                                                         
      

                                  


                                                                               
                                                            



                                                                   
                                                     



                                                                   
                                                     

 






































                                                                    
                               
                                       
     
                                                    


      
 
                                                      
 








                                                                             
 






                                                                      
                                                                         








                                                                      
                                                                         

      

                                                                 

                                                          



                                                                       
                                                           

                                                                                       

                                                                           



                                                                                       

                                                                           
 

                                                  
                     





                                                                        
                                              




                                                                                
                                





                                                                        
                              
 











                                                       

                                                         
                                                         










                                                         



                                                                         
 
                                                         

                                                                         

                                                                  
                                                         
                                                                            
                                                      

                                                       

                                                                          

                               
                                    
  
                                                                             





                                                                             
                                                            





                                                                          
                                          

                                       



                                                                         

                                                                       
                                 

                                                              
                                           

                                                                       




                                                                          


                                                                           
 
                                          
 
                                                













                                                           
                                                           

                                                                    
                                        
                                                   
                           
                                   
                                         

                                                          
                         
 

                                                                        
 
                                        
 

                                               
             
                                          
                                                                       
 


















                                                                            
                                                                                   
                                                                      










                                                                           
                                                     


                                                                
 


                                                    


                                                                         

                                                                             
 
                                                                     


                                                                             





                                                                                                                  

                                                                       
                                                  

















                                                                                       
                
                                                                 

                                                                   

                                                             
                                                                     


                                                
                                             



                                                                            
 
                                                                                
                                                                  













                                                              
                                                   


                                                      
 
                                                                            
                                                                           



                                                                          
              
                                                                             

                                                       
      





















                                                                                                                                    











                                                                                
                 
                                                  






                                                               
                                                                               

                                                                         
                                                                               

                                                                 

                                                                   
 
                                                                        



                                                           
                                                                            
                                                                              

                                                                             
                                                          
                                                                              
                                                              
 
                                                                        



                                                                            
                     
                                                                             
     
                                                        




                                                                           
                             
                                                                          


                                                   
     
                  
                                                                


                                                                          

      
                                                                 
                             
                                           
                                                           
     

                                                                      

                                   
                                                       
                                                                           
                                                        

                                                         
 


                            
                              
      
 
                                                       
                                                     
 





                                                            
                                                                  



                                                                      
                                                        
                                                            
                                                                


                                                                               
                                       
 
 

                                    
                                    
  
                                                                    
                                                                           
                                              

                                            
                                                   
                                   
                                                           
 

                                         








                                                                               
















                                                                       

                        
#ifndef _LINUX_MM_H
#define _LINUX_MM_H

#include <linux/errno.h>

#ifdef __KERNEL__

#include <linux/gfp.h>
#include <linux/bug.h>
#include <linux/list.h>
#include <linux/mmzone.h>
#include <linux/rbtree.h>
#include <linux/prio_tree.h>
#include <linux/atomic.h>
#include <linux/debug_locks.h>
#include <linux/mm_types.h>
#include <linux/range.h>
#include <linux/pfn.h>
#include <linux/bit_spinlock.h>
#include <linux/shrinker.h>

struct mempolicy;
struct anon_vma;
struct file_ra_state;
struct user_struct;
struct writeback_control;

#ifndef CONFIG_DISCONTIGMEM          /* Don't use mapnrs, do it properly */
extern unsigned long max_mapnr;
#endif

extern unsigned long num_physpages;
extern unsigned long totalram_pages;
extern void * high_memory;
extern int page_cluster;

#ifdef CONFIG_SYSCTL
extern int sysctl_legacy_va_layout;
#else
#define sysctl_legacy_va_layout 0
#endif

#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/processor.h>

#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))

/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)

/*
 * Linux kernel virtual memory manager primitives.
 * The idea being to have a "virtual" mm in the same way
 * we have a virtual fs - giving a cleaner interface to the
 * mm details, and allowing different kinds of memory mappings
 * (from shared memory to executable loading to arbitrary
 * mmap() functions).
 */

extern struct kmem_cache *vm_area_cachep;

#ifndef CONFIG_MMU
extern struct rb_root nommu_region_tree;
extern struct rw_semaphore nommu_region_sem;

extern unsigned int kobjsize(const void *objp);
#endif

/*
 * vm_flags in vm_area_struct, see mm_types.h.
 */
#define VM_READ		0x00000001	/* currently active flags */
#define VM_WRITE	0x00000002
#define VM_EXEC		0x00000004
#define VM_SHARED	0x00000008

/* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
#define VM_MAYREAD	0x00000010	/* limits for mprotect() etc */
#define VM_MAYWRITE	0x00000020
#define VM_MAYEXEC	0x00000040
#define VM_MAYSHARE	0x00000080