Adding MAILBOX_STATE_UNINITIALIZED in mailbox_state

7 views
Skip to first unread message

Hong-Seok Kim

unread,
Nov 14, 2019, 12:05:08 AM11/14/19
to Hafnium
Hi Hafnium developers,

Just some thoughts. Since a VM needs to call  SPCI_RXTX_MAP_32 to set up rx/tx buffers, we can consider a mailbox is "uninitialized" before this call is made. In that sense, I was thinking if adding MAILBOX_STATE_UNINITIALIZED would make sense.

enum mailbox_state {
        /** There is no message in the mailbox. */
        MAILBOX_STATE_EMPTY,

        /** There is a message in the mailbox that is waiting for a reader. */
        MAILBOX_STATE_RECEIVED,

        /** There is a message in the mailbox that has been read. */
        MAILBOX_STATE_READ,
};

Thanks,
Hong-Seok

Andrew Scull

unread,
Nov 14, 2019, 5:34:51 AM11/14/19
to Hong-Seok Kim, Hafnium
That is currently an implicit state if recv / send are NULL. It could be made into an explicit state fairly easily If that is something that would prove helpful?

--
You received this message because you are subscribed to the Google Groups "Hafnium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hafnium-discu...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hafnium-discuss/CAHvD%3DH-08nVSNuMfjNsunjvDO9P8mZFowAMLcLCdf0tvF2Tv3Q%40mail.gmail.com.

Hong-Seok Kim

unread,
Nov 14, 2019, 6:09:32 AM11/14/19
to Andrew Scull, Hafnium
As long as it doesn't add complexity in C code, it might be a useful thing because in an abstract specification, having an explicit t"UNINITIALIZED" state appears more natural. How about this? I can take a look at the code and send out a proposal as a PR.
Reply all
Reply to author
Forward
0 new messages