diff --git a/src/sys/mpi/message.c b/src/sys/mpi/message.c index ab28fdf..ec58c28 100644 --- a/src/sys/mpi/message.c +++ b/src/sys/mpi/message.c @@ -35,6 +35,38 @@ static mpiMbox_t *mboxList = 0x0; static spinLock_t mpiSpinLock = SPIN_LOCK_INITIALIZER; +/***************************************************************************************** + + Function: static mpiMbox_t * mpiFindMbox(char *name) + + Description: This function will find a mail box that matches the supplied name + + Notes: + +*****************************************************************************************/ +static mpiMbox_t * mpiFindMbox(char *name) { + mpiMbox_t *mbox = 0x0; + + for (mbox = mboxList;mbox;mbox = mbox->next) { + if (!kstrcmp(mbox->name,name)) { + spinUnlock(&mpiSpinLock); + return(mbox); + } + } + + return(0x0); + } + +/***************************************************************************************** + + Function: int mpiCreateMbox(char *name) + + Description: This function will create a new mailbox if it fails it will return -1 + otherwise it returns 0x0 + + Notes: + +*****************************************************************************************/ int mpiCreateMbox(char *name) { mpiMbox_t *mbox = 0x0; @@ -65,19 +97,15 @@ return(0x0); } -mpiMbox_t * mpiFindMbox(char *name) { - mpiMbox_t *mbox = 0x0; +/***************************************************************************************** - for (mbox = mboxList;mbox;mbox = mbox->next) { - if (!kstrcmp(mbox->name,name)) { - spinUnlock(&mpiSpinLock); - return(mbox); - } - } - - return(0x0); - } + Function: int mpiSpam(uInt32 type,void *data) + Description: This function will send a message to every mailbox + + Notes: + +*****************************************************************************************/ int mpiSpam(uInt32 type,void *data) { mpiMbox_t *mbox = 0x0; mpiMessage_t *message = 0x0; @@ -104,6 +132,15 @@ return(0x0); } +/***************************************************************************************** + + Function: int mpiPostMessage(char *name,uInt32 type,void *data) + + Description: This function will post a message to specified mailbox + + Notes: + +*****************************************************************************************/ int mpiPostMessage(char *name,uInt32 type,void *data) { mpiMbox_t *mbox = 0x0; mpiMessage_t *message = 0x0; @@ -135,6 +172,15 @@ return(0x0); } +/***************************************************************************************** + + Function: int mpiFetchMessage(char *name,mpiMessage_t *msg) + + Description: This function will fetch the next message out of the specified mailbox + + Notes: + +*****************************************************************************************/ int mpiFetchMessage(char *name,mpiMessage_t *msg) { mpiMbox_t *mbox = 0x0; mpiMessage_t *tmpMsg = 0x0; @@ -167,6 +213,9 @@ /*** $Log$ + Revision 1.2 2004/05/25 15:42:18 reddawg + Enabled mpiSpam(); + Revision 1.1 2004/05/25 14:03:22 reddawg First insertion of the MPI into our kernel