riscv: Use generic CSR macros for writing SATP

Instead of having the one-off load_satp(), just use csr_write().  No
functional change intended.

Reviewed by:	alc, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34271
This commit is contained in:
Mark Johnston 2022-03-01 09:03:44 -05:00
parent 82f4e0d0f0
commit 2e956c30ca
2 changed files with 1 additions and 8 deletions

View File

@ -120,13 +120,6 @@ extern int64_t icache_line_size;
#define cpu_icache_sync_range(a, s)
#define cpu_icache_sync_range_checked(a, s)
static __inline void
load_satp(uint64_t val)
{
__asm __volatile("csrw satp, %0" :: "r"(val));
}
#define cpufunc_nullop() riscv_nullop()
void riscv_nullop(void);

View File

@ -4402,7 +4402,7 @@ pmap_activate_sw(struct thread *td)
pmap = vmspace_pmap(td->td_proc->p_vmspace);
if (pmap == oldpmap)
return;
load_satp(pmap->pm_satp);
csr_write(satp, pmap->pm_satp);
hart = PCPU_GET(hart);
#ifdef SMP