00001 #ifndef MYRINET_HH
00002 #define MYRINET_HH
00003
00004 #include "iccp.h"
00005 #include <stdio.h>
00006 #include "platform.h"
00007
00008
00009
00010 #ifdef unix
00011 typedef int INT32;
00012 typedef short int INT16;
00013 typedef unsigned int UINT32;
00014 typedef unsigned short int UINT16;
00015 #define OK 0
00016 #define ERROR 1
00017 #define IMPORT
00018 typedef int STATUS;
00019 #endif
00020
00021 #if defined(unix) && defined(THREADS)
00022 #include <UNIX/ThreadsMsgQueue.hh>
00023 #endif
00024
00025 #ifndef unix // Provide these functions to vxWorks only
00026 #include <msgQLib.h>
00027 int myriReadFile(char *filename, void *buffer, int size);
00028 int myriWriteFile(char *filename, void *buffer, int size);
00029 int myriReadFile(char *filename, void *buffer, int size, int node);
00030 int myriWriteFile(char *filename, void *buffer, int size, int node);
00031 #endif
00032
00033 #ifdef linux
00034
00035 extern void *vxFileRequestServer(void *pnode=NULL);
00036 #endif
00037
00038 int myriInit(pMSGQARRAY_PROTO(msgQueArray), int multinodeSupport=0);
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 STATUS raw_myriMsgSend(UINT16 targetId, ic_msg *pMsg, int override_source_id);
00058 STATUS myriMsgSend(UINT16 targetId, ic_msg *pMsg, int board=0);
00059
00060
00061 STATUS myriMsgSend(UINT16 *targetList, ic_msg *pMsg, int board=0);
00062 STATUS myriMsgSend(UINT16 targetId, ic_msg *msgList[], int board=0);
00063 STATUS myriMsgSend(UINT16 *targetList, ic_msg *msgList[], int board=0);
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 STATUS
00082 myriMemcpy(UINT32 pTargetBuff_hi,
00083 UINT32 pTargetBuff_lo,
00084 UINT32 *pLocalBuff,
00085 UINT32 len,
00086 UINT16 targetId,
00087 SEM_ID sem=NULL);
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 STATUS
00099 myriMemcpy2(UINT32 *pLocalBuff,
00100 UINT32 len,
00101 UINT16 targetId,
00102 SEM_ID sem=NULL);
00103
00104
00105 STATUS myriAddAuxMem(void *start, unsigned long int size);
00106
00107
00108
00109
00110
00111
00112
00113 void setMyriLogLevel(int);
00114
00115 UINT16 getDaqNodeId(char *nodename=NULL, int board=0);
00116
00117 int myriStart();
00118
00119 extern void *(*directMsgCallback)(void *,int,UINT16);
00120 extern pTASKID myriRcvTaskId;
00121 extern int myriErrorTask;
00122
00123 void myriFreeMemcpy2Buff(char *buff);
00124 int myriSetMemcpy2Buffs(char *start, int n, int size);
00125
00126 #endif
00127
00128