aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/main.c
blob: 245fc9ee92817bd8c5e45ac25b676dde0cf9d104 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <apos/utils.h>
#include <arch/arch.h>
#include <csr.h>

stat_t setup_arch(void *fdt)
{
	UNUSED(fdt);
	/* allow supervisor code to touch user pages */
	csr_set(CSR_SSTATUS, SSTATUS_SUM);
	/* mark that we want to eventually jump to userspace */
	csr_clear(CSR_SSTATUS, SSTATUS_SPP);

	return OK;
}