Add DataCache and InstructionCache Interfaces which when implemented take either the SVC path or direct to supervisor calls.
if constexpr (not run_in_privileged_mode_only) {
// call supervisor svc<X>
} else {
// manipulate the hardware directly
}
Then in SVC
switch(imm) {
case X:
// manipulate hardware directly
break;
}
The existing API in the cortex layer is can and should be updated as well to a better interface to be similar to jarnax