aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/irq.c
blob: 15fa750981f0aeebc3e8451aedb1ee0cca08f913 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
 * @file irq.c
 * riscv64 implementation of irq handling.
 */

#include <apos/attrs.h>
#include <apos/debug.h>
#include <arch/irq.h>
#include "csr.h"

extern void handle_irq(void);

void init_irq(void *fdt)
{
	UNUSED(fdt);
	csr_write(CSR_STVEC, &handle_irq);

	long s = 0;
	csr_read(CSR_SIE, s);
	info("CSR_SIE: %lx\n", s);
}

void handle_sys_irq()
{
}

/* very simple for now */
void enable_irq()
{
	csr_set(CSR_SSTATUS, CSR_SIE);
}

void disable_irq()
{
	csr_clear(CSR_SSTATUS, CSR_SIE);
}