2019-05-29 07:18:00 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2017-07-10 18:07:09 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Regents of the University of California
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _ASM_RISCV_MMU_H
|
|
|
|
#define _ASM_RISCV_MMU_H
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
typedef struct {
|
2019-10-28 13:10:41 +01:00
|
|
|
#ifndef CONFIG_MMU
|
|
|
|
unsigned long end_brk;
|
2021-02-03 15:19:07 +05:30
|
|
|
#else
|
|
|
|
atomic_long_t id;
|
2019-10-28 13:10:41 +01:00
|
|
|
#endif
|
2017-07-10 18:07:09 -07:00
|
|
|
void *vdso;
|
2017-10-25 14:30:32 -07:00
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
/* A local icache flush is needed before user execution can resume. */
|
|
|
|
cpumask_t icache_stale_mask;
|
2024-03-12 16:53:41 -07:00
|
|
|
/* Force local icache flush on all migrations. */
|
|
|
|
bool force_icache_flush;
|
2017-10-25 14:30:32 -07:00
|
|
|
#endif
|
2023-07-11 23:07:54 +10:00
|
|
|
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
|
|
|
unsigned long exec_fdpic_loadmap;
|
|
|
|
unsigned long interp_fdpic_loadmap;
|
2024-10-16 13:27:46 -07:00
|
|
|
#endif
|
|
|
|
unsigned long flags;
|
|
|
|
#ifdef CONFIG_RISCV_ISA_SUPM
|
|
|
|
u8 pmlen;
|
2023-07-11 23:07:54 +10:00
|
|
|
#endif
|
2017-07-10 18:07:09 -07:00
|
|
|
} mm_context_t;
|
|
|
|
|
2024-10-16 13:27:46 -07:00
|
|
|
/* Lock the pointer masking mode because this mm is multithreaded */
|
|
|
|
#define MM_CONTEXT_LOCK_PMLEN 0
|
|
|
|
|
2024-03-26 21:49:51 -07:00
|
|
|
#define cntx2asid(cntx) ((cntx) & SATP_ASID_MASK)
|
|
|
|
#define cntx2version(cntx) ((cntx) & ~SATP_ASID_MASK)
|
2024-03-26 21:49:50 -07:00
|
|
|
|
2024-06-05 13:40:46 +02:00
|
|
|
void __meminit create_pgd_mapping(pgd_t *pgdp, uintptr_t va, phys_addr_t pa, phys_addr_t sz,
|
|
|
|
pgprot_t prot);
|
2017-07-10 18:07:09 -07:00
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
|
|
|
|
#endif /* _ASM_RISCV_MMU_H */
|