#ifndef _MASKINTERRUPTS_H_
#define _MASKINTERRUPTS_H_

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

/*---------------------------------------------------------------------------
 *
 * DESCRIPTION:	Macros to mask interrupts from within an RCI task.
 *
 *		At the moment, these only have an effect on the 
 *		auxiliary CPUs, where about the only thing they
 *		really block are RCI ASTs (since the control tasks
 *		themselves cannot interrupt one another). Control tasks 
 *		on the ARBITER do not need these primitives, since they
 *		are running uninterruptably anyway.
 *
 *		Where we REALLY need to make these primitives work is
 *		from within the planning task, so we can momentarily
 *		block execution of RCI control tasks. Stay tuned ... !
 * 
 * AUTHOR/DATE:	John Lloyd, Fall 1987
 *
 * MODIFICATION HISTORY:
 *
 *--------------------------------------------------------------------------*/

extern int *_rciMaskAsts;
extern int *_rciAstsPending;
extern int (*_rciRestartAstsFxn)();

#define MASK_INTERRUPTS		*_rciMaskAsts = 1;
#define UNMASK_INTERRUPTS	*_rciMaskAsts = 0; \
				if (*_rciAstsPending > 0) (*_rciRestartAstsFxn)();

#endif
