Skip to content

Commit

Permalink
serial: signal after driver callback as well
Browse files Browse the repository at this point in the history
Signed-off-by: Courtney Darville <courtneydarville94@outlook.com>
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
  • Loading branch information
Ivan-Velickovic authored and Courtney3141 committed Aug 6, 2024
1 parent d44ba5e commit 6ed5141
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions serial/components/virt_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void tx_return(void)
}

uint32_t client;
bool notify_client[SERIAL_NUM_CLIENTS] = {false};
bool transferred = false;
for (uint32_t req = 0; req < num_pending_tx; req++) {
tx_pending_pop(&client);
Expand All @@ -151,12 +152,20 @@ void tx_return(void)
}
}
transferred |= client_transferred;
notify_client[client] = client_transferred;
}

if (transferred && serial_require_producer_signal(&tx_queue_handle_drv)) {
serial_cancel_producer_signal(&tx_queue_handle_drv);
microkit_deferred_notify(DRIVER_CH);
}

for (uint32_t client = 0; client < SERIAL_NUM_CLIENTS; client++) {
if (notify_client[client] && serial_require_consumer_signal(&tx_queue_handle_cli[client])) {
serial_cancel_consumer_signal(&tx_queue_handle_cli[client]);
microkit_notify(client + CLIENT_OFFSET);
}
}
}

void tx_provide(microkit_channel ch)
Expand Down

0 comments on commit 6ed5141

Please sign in to comment.