UbixOS V2 2.0

mpi.h
Go to the documentation of this file.
1 /*-
2 * Copyright (c) 2002-2018 The UbixOS Project.
3 * All rights reserved.
4 *
5 * This was developed by Christopher W. Olsen for the UbixOS Project.
6 *
7 * Redistribution and use in source and binary forms, with or without modification, are permitted
8 * provided that the following conditions are met:
9 *
10 * 1) Redistributions of source code must retain the above copyright notice, this list of
11 * conditions, the following disclaimer and the list of authors.
12 * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13 * conditions, the following disclaimer and the list of authors in the documentation and/or
14 * other materials provided with the distribution.
15 * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16 * endorse or promote products derived from this software without specific prior written
17 * permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #ifndef _MPI_MPI_H
30 #define _MPI_MPI_H
31
32 #include <sys/types.h>
33 #include <ubixos/sched.h>
34
35 #define MESSAGE_LENGTH 248
36
37 struct mpi_message {
38 char data[MESSAGE_LENGTH];
39 uInt32 header;
40 pidType pid;
41 struct mpi_message *next;
42 };
43
44 struct mpi_mbox {
45 struct mpi_mbox *next;
46 struct mpi_mbox *prev;
47 struct mpi_message *msg;
48 struct mpi_message *msgLast;
49 char name[64];
50 pidType pid;
51 };
52
53 typedef struct mpi_mbox mpi_mbox_t;
54 typedef struct mpi_message mpi_message_t;
55
56 int mpi_createMbox(char *);
57 int mpi_destroyMbox(char *);
58 int mpi_postMessage(char *, uInt32, mpi_message_t *);
59 int mpi_fetchMessage(char *, mpi_message_t *);
60 int mpi_spam(uInt32, void *);
61
62 #endif
mpi_fetchMessage
int mpi_fetchMessage(char *, mpi_message_t *)
Definition: system.c:187
mpi_mbox
Definition: mpi.h:44
mpi_postMessage
int mpi_postMessage(char *, uInt32, mpi_message_t *)
mpi_mbox::msg
struct mpi_message * msg
Definition: mpi.h:47
uInt32
unsigned long int uInt32
Definition: objgfx30.h:49
mpi_mbox::msgLast
struct mpi_message * msgLast
Definition: mpi.h:48
mpi_message::header
uInt32 header
Definition: mpi.h:39
sched.h
types.h
mpi_message::next
struct mpi_message * next
Definition: mpi.h:41
pidType
int pidType
Definition: types.h:75
mpi_mbox::prev
struct mpi_mbox * prev
Definition: mpi.h:46
mpi_destroyMbox
int mpi_destroyMbox(char *)
Definition: system.c:231
mpi_message::pid
pidType pid
Definition: mpi.h:40
mpi_message::data
char data[248]
Definition: mpi.h:38
mpi_mbox::pid
pidType pid
Definition: mpi.h:50
mpi_mbox::next
struct mpi_mbox * next
Definition: mpi.h:45
MESSAGE_LENGTH
#define MESSAGE_LENGTH
Definition: mpi.h:35
mpi_spam
int mpi_spam(uInt32, void *)
Definition: system.c:107
mpi_message
Definition: mpi.h:37
mpi_mbox::name
char name[64]
Definition: mpi.h:49
mpi_createMbox
int mpi_createMbox(char *)
Definition: system.c:68