Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifdef CONFIG_MMU
0003 #include <linux/list.h>
0004 #include <linux/vmalloc.h>
0005 #include <linux/pgtable.h>
0006 
0007 /* the upper-most page table pointer */
0008 extern pmd_t *top_pmd;
0009 
0010 extern int icache_size;
0011 
0012 /*
0013  * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
0014  * specific hacks for copying pages efficiently, while 0xffff4000
0015  * is reserved for VIPT aliasing flushing by generic code.
0016  *
0017  * Note that we don't allow VIPT aliasing caches with SMP.
0018  */
0019 #define COPYPAGE_MINICACHE  0xffff8000
0020 #define COPYPAGE_V6_FROM    0xffff8000
0021 #define COPYPAGE_V6_TO      0xffffc000
0022 /* PFN alias flushing, for VIPT caches */
0023 #define FLUSH_ALIAS_START   0xffff4000
0024 
0025 static inline void set_top_pte(unsigned long va, pte_t pte)
0026 {
0027     pte_t *ptep = pte_offset_kernel(top_pmd, va);
0028     set_pte_ext(ptep, pte, 0);
0029     local_flush_tlb_kernel_page(va);
0030 }
0031 
0032 static inline pte_t get_top_pte(unsigned long va)
0033 {
0034     pte_t *ptep = pte_offset_kernel(top_pmd, va);
0035     return *ptep;
0036 }
0037 
0038 struct mem_type {
0039     pteval_t prot_pte;
0040     pteval_t prot_pte_s2;
0041     pmdval_t prot_l1;
0042     pmdval_t prot_sect;
0043     unsigned int domain;
0044 };
0045 
0046 const struct mem_type *get_mem_type(unsigned int type);
0047 
0048 extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
0049 
0050 /*
0051  * ARM specific vm_struct->flags bits.
0052  */
0053 
0054 /* (super)section-mapped I/O regions used by ioremap()/iounmap() */
0055 #define VM_ARM_SECTION_MAPPING  0x80000000
0056 
0057 /* permanent static mappings from iotable_init() */
0058 #define VM_ARM_STATIC_MAPPING   0x40000000
0059 
0060 /* empty mapping */
0061 #define VM_ARM_EMPTY_MAPPING    0x20000000
0062 
0063 /* mapping type (attributes) for permanent static mappings */
0064 #define VM_ARM_MTYPE(mt)        ((mt) << 20)
0065 #define VM_ARM_MTYPE_MASK   (0x1f << 20)
0066 
0067 
0068 struct static_vm {
0069     struct vm_struct vm;
0070     struct list_head list;
0071 };
0072 
0073 extern struct list_head static_vmlist;
0074 extern struct static_vm *find_static_vm_vaddr(void *vaddr);
0075 extern __init void add_static_vm_early(struct static_vm *svm);
0076 
0077 #endif
0078 
0079 #ifdef CONFIG_ZONE_DMA
0080 extern phys_addr_t arm_dma_limit;
0081 extern unsigned long arm_dma_pfn_limit;
0082 #else
0083 #define arm_dma_limit ((phys_addr_t)~0)
0084 #define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT)
0085 #endif
0086 
0087 extern phys_addr_t arm_lowmem_limit;
0088 
0089 void __init bootmem_init(void);
0090 void arm_mm_memblock_reserve(void);
0091 #ifdef CONFIG_CMA_AREAS
0092 void dma_contiguous_remap(void);
0093 #else
0094 static inline void dma_contiguous_remap(void) { }
0095 #endif
0096 
0097 unsigned long __clear_cr(unsigned long mask);