#ifdef CONFIG_MMU relocate: /* Relocate return address */ li a1, PAGE_OFFSET la a2, _start sub a1, a1, a2 add ra, ra, a1 add gp, gp, a1 /* Compute satp for kernel page tables */ srl a2, a0, PAGE_SHIFT li a1, SATP_MODE or a2, a2, a1 /* * Switch to kernel page tables. */ csrw CSR_SATP, a2 sfence.vma ret // switch to kernel addressing occurs here #endif /* CONFIG_MMU */