aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/main.c
blob: 3d36a222e8fb20f1672908d1f34ee1c31cde0f8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Copyright 2021 - 2022, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */

/**
 * @file main.c
 * riscv64 main
 */

#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;
}