summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/riscv/misaligned.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/arch/riscv/misaligned.c b/src/arch/riscv/misaligned.c
index a17b7dd454..9f144b89bc 100644
--- a/src/arch/riscv/misaligned.c
+++ b/src/arch/riscv/misaligned.c
@@ -1,9 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <stdint.h>
#include <vm.h>
#include <arch/exception.h>
#include <commonlib/helpers.h>
+#include <types.h>
/* these functions are defined in src/arch/riscv/fp_asm.S */
#if defined(__riscv_flen)
@@ -131,18 +131,18 @@ static struct memory_instruction_info *match_instruction(uintptr_t insn)
return NULL;
}
-static int fetch_16bit_instruction(uintptr_t vaddr, uintptr_t *insn, int *size)
+static enum cb_err fetch_16bit_instruction(uintptr_t vaddr, uintptr_t *insn, int *size)
{
uint16_t ins = mprv_read_mxr_u16((uint16_t *)vaddr);
if (EXTRACT_FIELD(ins, 0x3) != 3) {
*insn = ins;
*size = 2;
- return 0;
+ return CB_SUCCESS;
}
- return -1;
+ return CB_ERR;
}
-static int fetch_32bit_instruction(uintptr_t vaddr, uintptr_t *insn, int *size)
+static enum cb_err fetch_32bit_instruction(uintptr_t vaddr, uintptr_t *insn, int *size)
{
uint32_t l = (uint32_t)mprv_read_mxr_u16((uint16_t *)vaddr + 0);
uint32_t h = (uint32_t)mprv_read_mxr_u16((uint16_t *)vaddr + 1);
@@ -151,9 +151,9 @@ static int fetch_32bit_instruction(uintptr_t vaddr, uintptr_t *insn, int *size)
(EXTRACT_FIELD(ins, 0x1c) != 0x7)) {
*insn = ins;
*size = 4;
- return 0;
+ return CB_SUCCESS;
}
- return -1;
+ return CB_ERR;
}
void handle_misaligned(trapframe *tf)