Skip to content

Commit

Permalink
Fixes cap_ipc.c reply.cap getting the wrong value.
Browse files Browse the repository at this point in the history
  • Loading branch information
HAKarlsson committed May 15, 2024
1 parent 57e4f88 commit ea04c31
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kernel/src/cap_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ static err_t do_send(cap_t cap, const ipc_msg_t *msg, proc_t **next)
if (proc_ipc_acquire(recv, cap.sock.chan)) {
recv->regs[REG_T0] = SUCCESS;
recv->regs[REG_A0] = cap.sock.tag;
recv->regs[REG_A1] = msg->send_cap ? cte_cap(cap_buf).raw : 0;
recv->regs[REG_A2] = msg->data[0];
recv->regs[REG_A3] = msg->data[1];
recv->regs[REG_A4] = msg->data[2];
recv->regs[REG_A5] = msg->data[3];
if (msg->send_cap)

if (msg->send_cap) {
recv->regs[REG_A1] = cte_cap(msg->cap_buf).raw;
cap_move(msg->cap_buf, cap_buf);
} else {
recv->regs[REG_A1] = 0;
}

if (cap.sock.mode == IPC_YIELD) {
recv->timeout = (*next)->timeout;
Expand Down

0 comments on commit ea04c31

Please sign in to comment.