1 /*---------------------------------------------------------------------------*
2   Project:  Dolphin OS Message API
3   File:     OSMessage.h
4 
5   Copyright 1998, 1999 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Log: OSMessage.h,v $
14   Revision 1.2  2006/02/04 11:56:47  hashida
15   (none)
16 
17   Revision 1.1.1.1  2005/12/29 06:53:28  hiratsu
18   Initial import.
19 
20   Revision 1.1.1.1  2005/05/12 02:41:07  yasuh-to
21   Ported from dolphin source tree.
22 
23 
24     4     2000/02/08 3:32p Shiki
25     Fixed OSSendMessage/OSJamMessage interface.
26 
27     2     2000/01/25 6:29p Shiki
28     Renamed flag defines.
29 
30     1     2000/01/18 3:25p Shiki
31     Initial check-in.
32   $NoKeywords: $
33  *---------------------------------------------------------------------------*/
34 
35 #ifndef __OSMESSAGE_H__
36 #define __OSMESSAGE_H__
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #include <revolution/os/OSThread.h>
43 
44 typedef struct OSMessageQueue   OSMessageQueue;
45 typedef void*                   OSMessage;
46 
47 struct OSMessageQueue
48 {
49     OSThreadQueue   queueSend;
50     OSThreadQueue   queueReceive;
51     OSMessage*      msgArray;
52     s32             msgCount;
53     s32             firstIndex;
54     s32             usedCount;
55 };
56 
57 // Flags to turn blocking on/off when sending/receiving message
58 #define OS_MESSAGE_NOBLOCK  0
59 #define OS_MESSAGE_BLOCK    1
60 
61 void OSInitMessageQueue( OSMessageQueue* mq, OSMessage* msgArray, s32 msgCount );
62 BOOL OSSendMessage     ( OSMessageQueue* mq, OSMessage msg, s32 flags );
63 BOOL OSJamMessage      ( OSMessageQueue* mq, OSMessage msg, s32 flags );
64 BOOL OSReceiveMessage  ( OSMessageQueue* mq, OSMessage* msg, s32 flags );
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif  // __OSMESSAGE_H__
71