# mpi.h

Go to the documentation of this file.

    00001 /*****************************************************************************************
    00002  Copyright (c) 2002-2004 The UbixOS Project
    00003  All rights reserved.
    00004
    00005  Redistribution and use in source and binary forms, with or without modification, are
    00006  permitted provided that the following conditions are met:
    00007
    00008  Redistributions of source code must retain the above copyright notice, this list of
    00009  conditions, the following disclaimer and the list of authors.  Redistributions in binary
    00010  form must reproduce the above copyright notice, this list of conditions, the following
    00011  disclaimer and the list of authors in the documentation and/or other materials provided
    00012  with the distribution. Neither the name of the UbixOS Project nor the names of its
    00013  contributors may be used to endorse or promote products derived from this software
    00014  without specific prior written permission.
    00015
    00016  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
    00017  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00018  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
    00019  THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    00020  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
    00021  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    00022  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
    00023  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    00024  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00025
    00026  $Id: mpi_8h-source.html 88 2016-01-12 00:11:29Z reddawg $
    00027
    00028 *****************************************************************************************/
    00029
    00030 #ifndef _MPI_H
    00031 #define _MPI_H
    00032
    00033 #include <ubixos/types.h>
    00034 #include <ubixos/sched.h>
    00035
    00036 #define MESSAGE_LENGTH 248
    00037
    00038 struct mpi_message {
    00039   char                 data[MESSAGE_LENGTH];
    00040   uInt32               header;
    00041   pidType              pid;
    00042   struct mpi_message  *next;
    00043   };
    00044
    00045 struct mpi_mbox {
    00046   struct mpi_mbox     *next;
    00047   struct mpi_mbox     *prev;
    00048   struct mpi_message  *msg;
    00049   struct mpi_message  *msgLast;
    00050   char                 name[64];
    00051   pidType              pid;
    00052   };
    00053
    00054 typedef struct mpi_mbox    mpi_mbox_t;
    00055 typedef struct mpi_message mpi_message_t;
    00056
    00057
    00058 int mpi_createMbox(char *);
    00059 int mpi_destroyMbox(char *);
    00060 int mpi_postMessage(char *,uInt32,mpi_message_t *);
    00061 int mpi_fetchMessage(char *,mpi_message_t *);
    00062 int mpi_spam(uInt32,void *);
    00063
    00064 #endif
    00065
    00066 /***
    00067  $Log: mpi_8h-source.html,v $
    00067  Revision 1.7  2006/12/15 17:47:06  reddawg
    00067  Updates
    00067
    00068  Revision 1.1.1.1  2006/06/01 12:46:14  reddawg
    00069  ubix2
    00070
    00071  Revision 1.2  2005/10/12 00:13:36  reddawg
    00072  Removed
    00073
    00074  Revision 1.1.1.1  2005/09/26 17:23:42  reddawg
    00075  no message
    00076
    00077  Revision 1.8  2004/08/14 11:23:02  reddawg
    00078  Changes
    00079
    00080  Revision 1.7  2004/05/28 03:52:56  reddawg
    00081  mpi: took a few suggestions from TCA
    00082
    00083  Revision 1.6  2004/05/25 18:33:11  reddawg
    00084  We now use 128byte messages I can increase later
    00085
    00086  Revision 1.5  2004/05/25 18:29:57  reddawg
    00087  We now lock onto a pid
    00088
    00089  Revision 1.4  2004/05/25 16:52:22  reddawg
    00090  We now have mpiDestroyMbox(char *) This will of course destroy a mail box
    00091
    00092  Revision 1.3  2004/05/25 16:28:21  reddawg
    00093  Made mpiFindMbox() static
    00094
    00095  Revision 1.2  2004/05/25 15:42:19  reddawg
    00096  Enabled mpiSpam();
    00097
    00098  Revision 1.1  2004/05/25 14:07:01  reddawg
    00099  Sorry we can't forget the headers files
    00100
    00101  END
    00102  ***/
    00103