riscv: pmp: Add helper to write PMP configuration CSRs

Introduce `z_riscv_pmp_write_config` to abstract writing to pmpcfg
registers. This function handles the differing register layouts and slot
counts between RV32 and RV64 architectures, writing to the appropriate
pmpcfg0, pmpcfg1, pmpcfg2, or pmpcfg3 CSRs as needed based on
CONFIG_PMP_SLOTS.

Signed-off-by: Firas Sammoura <fsammoura@google.com>
1 file changed