Linux Audio

Check our new training course

Loading...
v4.17
  1/* SPDX-License-Identifier: GPL-2.0 */
  2#ifdef CONFIG_MMU
  3#include <linux/list.h>
  4#include <linux/vmalloc.h>
  5
  6#include <asm/pgtable.h>
  7
  8/* the upper-most page table pointer */
  9extern pmd_t *top_pmd;
 10
 11/*
 12 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
 13 * specific hacks for copying pages efficiently, while 0xffff4000
 14 * is reserved for VIPT aliasing flushing by generic code.
 15 *
 16 * Note that we don't allow VIPT aliasing caches with SMP.
 17 */
 18#define COPYPAGE_MINICACHE	0xffff8000
 19#define COPYPAGE_V6_FROM	0xffff8000
 20#define COPYPAGE_V6_TO		0xffffc000
 21/* PFN alias flushing, for VIPT caches */
 22#define FLUSH_ALIAS_START	0xffff4000
 23
 24static inline void set_top_pte(unsigned long va, pte_t pte)
 25{
 26	pte_t *ptep = pte_offset_kernel(top_pmd, va);
 27	set_pte_ext(ptep, pte, 0);
 28	local_flush_tlb_kernel_page(va);
 29}
 30
 31static inline pte_t get_top_pte(unsigned long va)
 32{
 33	pte_t *ptep = pte_offset_kernel(top_pmd, va);
 34	return *ptep;
 35}
 36
 37static inline pmd_t *pmd_off_k(unsigned long virt)
 38{
 39	return pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
 40}
 41
 42struct mem_type {
 43	pteval_t prot_pte;
 44	pteval_t prot_pte_s2;
 45	pmdval_t prot_l1;
 46	pmdval_t prot_sect;
 47	unsigned int domain;
 48};
 49
 50const struct mem_type *get_mem_type(unsigned int type);
 51
 52extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
 53
 54/*
 55 * ARM specific vm_struct->flags bits.
 56 */
 57
 58/* (super)section-mapped I/O regions used by ioremap()/iounmap() */
 59#define VM_ARM_SECTION_MAPPING	0x80000000
 60
 61/* permanent static mappings from iotable_init() */
 62#define VM_ARM_STATIC_MAPPING	0x40000000
 63
 64/* empty mapping */
 65#define VM_ARM_EMPTY_MAPPING	0x20000000
 66
 67/* mapping type (attributes) for permanent static mappings */
 68#define VM_ARM_MTYPE(mt)		((mt) << 20)
 69#define VM_ARM_MTYPE_MASK	(0x1f << 20)
 70
 71/* consistent regions used by dma_alloc_attrs() */
 72#define VM_ARM_DMA_CONSISTENT	0x20000000
 73
 74
 75struct static_vm {
 76	struct vm_struct vm;
 77	struct list_head list;
 78};
 79
 80extern struct list_head static_vmlist;
 81extern struct static_vm *find_static_vm_vaddr(void *vaddr);
 82extern __init void add_static_vm_early(struct static_vm *svm);
 83
 84#endif
 85
 86#ifdef CONFIG_ZONE_DMA
 87extern phys_addr_t arm_dma_limit;
 88extern unsigned long arm_dma_pfn_limit;
 89#else
 90#define arm_dma_limit ((phys_addr_t)~0)
 91#define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT)
 92#endif
 93
 94extern phys_addr_t arm_lowmem_limit;
 95
 96void __init bootmem_init(void);
 97void arm_mm_memblock_reserve(void);
 98void dma_contiguous_remap(void);
 99
100unsigned long __clear_cr(unsigned long mask);
v3.15
 
 1#ifdef CONFIG_MMU
 2#include <linux/list.h>
 3#include <linux/vmalloc.h>
 4
 
 
 5/* the upper-most page table pointer */
 6extern pmd_t *top_pmd;
 7
 8/*
 9 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
10 * specific hacks for copying pages efficiently, while 0xffff4000
11 * is reserved for VIPT aliasing flushing by generic code.
12 *
13 * Note that we don't allow VIPT aliasing caches with SMP.
14 */
15#define COPYPAGE_MINICACHE	0xffff8000
16#define COPYPAGE_V6_FROM	0xffff8000
17#define COPYPAGE_V6_TO		0xffffc000
18/* PFN alias flushing, for VIPT caches */
19#define FLUSH_ALIAS_START	0xffff4000
20
21static inline void set_top_pte(unsigned long va, pte_t pte)
22{
23	pte_t *ptep = pte_offset_kernel(top_pmd, va);
24	set_pte_ext(ptep, pte, 0);
25	local_flush_tlb_kernel_page(va);
26}
27
28static inline pte_t get_top_pte(unsigned long va)
29{
30	pte_t *ptep = pte_offset_kernel(top_pmd, va);
31	return *ptep;
32}
33
34static inline pmd_t *pmd_off_k(unsigned long virt)
35{
36	return pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
37}
38
39struct mem_type {
40	pteval_t prot_pte;
41	pteval_t prot_pte_s2;
42	pmdval_t prot_l1;
43	pmdval_t prot_sect;
44	unsigned int domain;
45};
46
47const struct mem_type *get_mem_type(unsigned int type);
48
49extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
50
51/*
52 * ARM specific vm_struct->flags bits.
53 */
54
55/* (super)section-mapped I/O regions used by ioremap()/iounmap() */
56#define VM_ARM_SECTION_MAPPING	0x80000000
57
58/* permanent static mappings from iotable_init() */
59#define VM_ARM_STATIC_MAPPING	0x40000000
60
61/* empty mapping */
62#define VM_ARM_EMPTY_MAPPING	0x20000000
63
64/* mapping type (attributes) for permanent static mappings */
65#define VM_ARM_MTYPE(mt)		((mt) << 20)
66#define VM_ARM_MTYPE_MASK	(0x1f << 20)
67
68/* consistent regions used by dma_alloc_attrs() */
69#define VM_ARM_DMA_CONSISTENT	0x20000000
70
71
72struct static_vm {
73	struct vm_struct vm;
74	struct list_head list;
75};
76
77extern struct list_head static_vmlist;
78extern struct static_vm *find_static_vm_vaddr(void *vaddr);
79extern __init void add_static_vm_early(struct static_vm *svm);
80
81#endif
82
83#ifdef CONFIG_ZONE_DMA
84extern phys_addr_t arm_dma_limit;
85extern unsigned long arm_dma_pfn_limit;
86#else
87#define arm_dma_limit ((phys_addr_t)~0)
88#define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT)
89#endif
90
91extern phys_addr_t arm_lowmem_limit;
92
93void __init bootmem_init(void);
94void arm_mm_memblock_reserve(void);
95void dma_contiguous_remap(void);