2012-03-05 04:49:27 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 ARM Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef __ASM_MMU_H
|
|
|
|
#define __ASM_MMU_H
|
|
|
|
|
2017-08-20 04:20:47 -06:00
|
|
|
#define MMCF_AARCH32 0x1 /* mm context flag for AArch32 executables */
|
2017-08-10 07:10:28 -06:00
|
|
|
#define USER_ASID_FLAG (UL(1) << 48)
|
2017-08-20 04:20:47 -06:00
|
|
|
|
2017-11-14 06:58:08 -07:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
2012-03-05 04:49:27 -07:00
|
|
|
typedef struct {
|
2015-10-06 11:46:24 -06:00
|
|
|
atomic64_t id;
|
|
|
|
void *vdso;
|
2016-11-02 03:10:45 -06:00
|
|
|
unsigned long flags;
|
2012-03-05 04:49:27 -07:00
|
|
|
} mm_context_t;
|
|
|
|
|
2015-10-06 11:46:24 -06:00
|
|
|
/*
|
|
|
|
* This macro is only used by the TLBI code, which cannot race with an
|
|
|
|
* ASID change and therefore doesn't need to reload the counter using
|
|
|
|
* atomic64_read.
|
|
|
|
*/
|
|
|
|
#define ASID(mm) ((mm)->context.id.counter & 0xffff)
|
2012-03-05 04:49:27 -07:00
|
|
|
|
2017-11-14 06:58:08 -07:00
|
|
|
static inline bool arm64_kernel_unmapped_at_el0(void)
|
|
|
|
{
|
2017-11-14 07:38:19 -07:00
|
|
|
return IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0) &&
|
|
|
|
cpus_have_const_cap(ARM64_UNMAP_KERNEL_AT_EL0);
|
2017-11-14 06:58:08 -07:00
|
|
|
}
|
|
|
|
|
2012-03-05 04:49:27 -07:00
|
|
|
extern void paging_init(void);
|
2016-04-08 16:50:26 -06:00
|
|
|
extern void bootmem_init(void);
|
2012-10-23 07:55:08 -06:00
|
|
|
extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt);
|
2014-04-07 16:39:51 -06:00
|
|
|
extern void init_mem_pgprot(void);
|
2014-10-20 07:42:07 -06:00
|
|
|
extern void create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys,
|
|
|
|
unsigned long virt, phys_addr_t size,
|
2016-10-21 05:22:57 -06:00
|
|
|
pgprot_t prot, bool page_mappings_only);
|
2015-06-01 05:40:32 -06:00
|
|
|
extern void *fixmap_remap_fdt(phys_addr_t dt_phys);
|
2017-03-09 13:52:01 -07:00
|
|
|
extern void mark_linear_text_alias_ro(void);
|
2012-03-05 04:49:27 -07:00
|
|
|
|
2017-11-14 06:58:08 -07:00
|
|
|
#endif /* !__ASSEMBLY__ */
|
2012-03-05 04:49:27 -07:00
|
|
|
#endif
|