Skip to content

Commit 93e0e01

Browse files
committed
fix(core/remio): output pending_requests through other out register
Signed-off-by: João Peixoto <[email protected]>
1 parent 4e6a971 commit 93e0e01

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/core/remio.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,24 +506,25 @@ void remio_assign_vm_cpus(struct vm* vm)
506506
static long int remio_handle_ask(unsigned long addr, unsigned long value,
507507
struct remio_device* device)
508508
{
509-
long int ret = -HC_E_FAILURE;
509+
long int ret = -HC_E_SUCCESS;
510+
long unsigned int pending_requests = 0;
510511

511512
/** By convention, the addr and value fields must be zero */
512513
if (addr != 0 || value != 0) {
513-
return ret;
514+
return HC_E_FAILURE;
514515
}
515516

516517
struct remio_request_event* event = remio_pop_request_event(device);
517518
if (event == NULL) {
518-
return ret;
519+
return HC_E_FAILURE;
519520
}
520521

521522
if (remio_get_request_state(device, event->id) != REMIO_STATE_PENDING) {
522-
return ret;
523+
return HC_E_FAILURE;
523524
}
524525

525526
/** Calculate the remaining number of pending I/O requests */
526-
ret = (long int)remio_get_request_event_count(device);
527+
pending_requests = (long unsigned int)remio_get_request_event_count(device);
527528

528529
remio_set_request_state(device, event->id, REMIO_STATE_PROCESSING);
529530

@@ -535,6 +536,7 @@ static long int remio_handle_ask(unsigned long addr, unsigned long value,
535536
vcpu_writereg(cpu()->vcpu, HYPCALL_OUT_ARG_REG(2), request->value);
536537
vcpu_writereg(cpu()->vcpu, HYPCALL_OUT_ARG_REG(3), request->access_width);
537538
vcpu_writereg(cpu()->vcpu, HYPCALL_OUT_ARG_REG(4), event->id);
539+
vcpu_writereg(cpu()->vcpu, HYPCALL_OUT_ARG_REG(5), pending_requests);
538540

539541
return ret;
540542
}

0 commit comments

Comments
 (0)