/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1987, 1991 by John E. Lloyd.			    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

/*---------------------------------------------------------------------------
 *		
 * MODULE NAME:	auxShare
 *
 * DESCRIPTION:	This file contains hard-wired shared variables used
 *		for communicating between low level RCI modules executing
 *		on different CPUs. In particular, this is how the
 *		RCI planning level system code communicates with the
 *		monitors.
 * 
 * CAVEATS:	This information should be placed in a global structure
 *		for which tasks on different CPUs can obtain a pointer.
 *
 * AUTHOR/DATE:	John Lloyd, Fall 1987
 *
 * MODIFICATION HISTORY:
 *
 *--------------------------------------------------------------------------*/

#include "../h/rciTask.h"
#include "../h/robot_jls.h"
#include "../h/mutex.h"

#include "../rci/create.h"
#include "../h/rciConfig.h"
#include "../rci/abort.h"
#include "../rci/loadRobot.h"
#include "../rci/monitorCom.h"
#include "../rci/sharedMemory.h"

#define MAXPAGESIZE	1024

char moncomMemBegin[MAXPAGESIZE];

int  auxDebug = 0;

MUTEX mutexTestAndSet;

ABORT_DESC rciAbortDesc;
MUTEX rciAbortMutex;
int rciAbortFlag = 0;

ABORT_DESC rciFatalDesc;
MUTEX rciFatalMutex;
char rciFatalFlag = 0;
int rciSimOnly = 0;		/* only run RCI simulator tasks */

void *auxMessagePools[MAX_CPUS][MAX_CPUS];

TASK_SPEC moncomTaskSpec;
char moncomCmd[MAX_CPUS];
char moncomKynBuf[MAX_KYNSIZE];
JLS  moncomJlsBuf;
int moncomClockNum;
float moncomClockRes;
int moncomClockExport[MAX_CPUS];
int moncomStartTime;
int moncomActivateReq[MAX_CPUS];

char moncomMsgBuf[MAX_CPUS][MON_MSGBUF_SIZE];
char moncomReadBuf[MON_READBUF_SIZE];

int moncomClockOffset;
unsigned long rciOptionFlags = 0;/* hack ... put this here quickly */

char *hashTableTask0Addr = NULL;
SECTION_DESC sharedMemTable[MAX_CPUS][MAX_CPUS];
int moncomPhysmem;

char moncomMemEnd[MAXPAGESIZE];
