haven: msgq: Update EMPTY/FULL signals

Update handling of msgq response to send/recv to update internal state of
rx_empty/tx_full.

Change-Id: I8c744b2ed1dafc9b89576eb216a790d4f59530f5
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
This commit is contained in:
Elliot Berman 2020-04-02 09:36:06 -07:00
commit aba06b68e5
2 changed files with 7 additions and 3 deletions

View file

@ -89,6 +89,7 @@ static int __hh_msgq_recv(struct hh_msgq_cap_table *cap_table_entry,
switch (hh_ret) {
case HH_ERROR_OK:
*recv_size = resp.recv_size;
cap_table_entry->rx_empty = !resp.not_empty;
ret = 0;
break;
case HH_ERROR_MSGQUEUE_EMPTY:
@ -213,6 +214,10 @@ static int __hh_msgq_send(struct hh_msgq_cap_table *cap_table_entry,
size, buff, tx_flags, &resp);
switch (hh_ret) {
case HH_ERROR_OK:
cap_table_entry->tx_full = !resp.not_full;
ret = 0;
break;
case HH_ERROR_MSGQUEUE_FULL:
cap_table_entry->tx_full = true;
ret = -EAGAIN;

View file

@ -35,9 +35,8 @@
#define HH_ERROR_CSPACE_INSUF_RIGHTS 53
#define HH_ERROR_CSPACE_FULL 54
/* TODO: Get the correct values for the MSGQ error codes */
#define HH_ERROR_MSGQUEUE_FULL 60
#define HH_ERROR_MSGQUEUE_EMPTY 61
#define HH_ERROR_MSGQUEUE_EMPTY 60
#define HH_ERROR_MSGQUEUE_FULL 61
static inline int hh_remap_error(int hh_error)
{