Skip to content

Commit

Permalink
hw: add missing six-arguments syscall for riscv
Browse files Browse the repository at this point in the history
  • Loading branch information
skalk committed Aug 13, 2024
1 parent 8138188 commit 3325c38
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions repos/base-hw/src/core/spec/riscv/kernel/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ using namespace Kernel;
CALL_4_FILL_ARG_REGS \
register Call_arg arg_4_reg asm("a4") = arg_4;

#define CALL_6_FILL_ARG_REGS \
CALL_5_FILL_ARG_REGS \
register Call_arg arg_5_reg asm("a5") = arg_5;

extern Genode::addr_t _kernel_entry;

/*
Expand All @@ -75,6 +79,7 @@ extern Genode::addr_t _kernel_entry;
#define CALL_3_SWI CALL_2_SWI, "r" (arg_2_reg)
#define CALL_4_SWI CALL_3_SWI, "r" (arg_3_reg)
#define CALL_5_SWI CALL_4_SWI, "r" (arg_4_reg)
#define CALL_6_SWI CALL_5_SWI, "r" (arg_5_reg)


/******************
Expand Down Expand Up @@ -137,3 +142,16 @@ Call_ret Kernel::call(Call_arg arg_0,
asm volatile(CALL_5_SWI : "ra");
return arg_0_reg;
}


Call_ret Kernel::call(Call_arg arg_0,
Call_arg arg_1,
Call_arg arg_2,
Call_arg arg_3,
Call_arg arg_4,
Call_arg arg_5)
{
CALL_6_FILL_ARG_REGS
asm volatile(CALL_6_SWI : "ra");
return arg_0_reg;
}

0 comments on commit 3325c38

Please sign in to comment.