Move log2ceil from riscv_pmp to libc. Also, implement log2floor for completeness. These are the run-time alternative to the compile-time macros.