Kernel library crate for xous
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
xous-kernel/asm.S

30 lines
517 B

#if __riscv_xlen == 64
# define STORE sd
# define LOAD ld
# define LOG_REGBYTES 3
#else
# define STORE sw
# define LOAD lw
# define LOG_REGBYTES 2
#endif
#define REGBYTES (1 << LOG_REGBYTES)
.global enable_mmu
.global return_from_interrupt
.text
enable_mmu:
la sp, _estack // Trash the stack and start over
return_from_interrupt:
mret // Return to kmain
.global flush_mmu
flush_mmu:
sfence.vma
ret
.global my_fence
.global read_satp
.text
read_satp:
csrr a0, satp
ret