Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aba06b68 authored by Elliot Berman's avatar Elliot Berman
Browse files

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: default avatarElliot Berman <eberman@codeaurora.org>
parent 73eacbb2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
+2 −3
Original line number Diff line number Diff line
@@ -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)
{