Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions arch/riscv/core/pmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,22 +383,8 @@ void z_riscv_pmp_init(void)
Z_RISCV_STACK_GUARD_SIZE,
pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));

/*
* This early, the kernel init code uses the IRQ stack and we want to
* safeguard it as soon as possible. But we need a temporary default
* "catch all" PMP entry for MPRV to work. Later on, this entry will
* be set for each thread by z_riscv_pmp_stackguard_prepare().
*/
set_pmp_mprv_catchall(&index, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));

/* Write those entries to PMP regs. */
write_pmp_entries(0, index, true, pmp_addr, pmp_cfg, ARRAY_SIZE(pmp_addr));

/* Activate our non-locked PMP entries for m-mode */
csr_set(mstatus, MSTATUS_MPRV);

/* And forget about that last entry as we won't need it later */
index--;
#else
/* Without multithreading setup stack guards for IRQ and main stacks */
set_pmp_entry(&index, PMP_NONE | PMP_L,
Expand Down