summaryrefslogtreecommitdiffstats
path: root/src/arch/riscv/include/arch/exception.h
blob: 3e8da6c0f482440afa07c7934ee47c74fa2fc60c (plain)
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
/* SPDX-License-Identifier: BSD-3-Clause */
/* This file is part of the coreboot project. */

#ifndef _ARCH_EXCEPTION_H
#define _ARCH_EXCEPTION_H

#include <stdint.h>

typedef struct {
	uintptr_t gpr[32];
	uintptr_t status;
	uintptr_t epc;
	uintptr_t badvaddr;
	uintptr_t cause;
	uintptr_t insn;
} trapframe;

typedef uint32_t insn_t;

typedef struct {
	uintptr_t error;
	insn_t insn;
} insn_fetch_t;

static inline void exception_init(void)
{
}

void redirect_trap(void);
void trap_handler(trapframe *tf);
void handle_supervisor_call(trapframe *tf);
void handle_misaligned(trapframe *tf);

#endif