Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - kcc-5/include/sys/usysig.h
There are 4 other files named usysig.h in the archive. Click here to see a list.
/* USYSIG.H - USYS signal support definitions
**	Copyright (c) 1987 by Ken Harrenstien, SRI International
*/

#ifndef _USYSIG_INCLUDED	/* Include only once */
#define _USYSIG_INCLUDED

/* USYS_BEG should be invoked at start of every USYS routine. */
#define USYS_BEG() ++_sigusys

/* USYS_END should be invoked at end of every USYS routine.
**	It returns 0 if nothing happened, -1 if an interrupt went off,
**	and +1 if an interrupt happened but the handler allows restarting.
*/
#define USYS_END() ((--_sigusys <= 0 && _sigpendmask) ? \
			_sigtrigpend() : 0)

/* Useful auxiliaries for returning from USYS calls */
#define USYS_RET(val)      return((void)USYS_END(), val)
#define USYS_RETVOLATILE(var) if(1){ int tmpret = (var); \
		   return((void)USYS_END(), tmpret); } else /* null stmt */
#define USYS_RETERR(err)   return((void)USYS_END(), errno = err, -1)
#define USYS_RETINT()      USYS_RETERR(EINTR)

extern int _sigusys;
extern unsigned _sigpendmask, _sigblockmask;
extern struct sigstack _sigstk;
extern struct sigcontext *_sigframe;
extern int _sigtrigpend();
extern int _intlev;		/* Nonzero if at interrupt level */

/* Assembler versions of macros.
** These are strings suitable for giving to the asm() construct.
*/
#define USYS_BEG_ASM "	aos .sigusys\n"
#define USYS_END_ASM "\
	sosg .sigusys\n\
	 skipn .sigpendmask\n\
	  caia\n\
	   pushj 17,.sigtrigpend\n"

/* Assembler offsets into sigcontext structure. */
#define SIGCONTEXT_ASM "\
	sc.pc==0	\n\
	sc.pcflgs==1	\n\
	sc.osinf==2	\n\
	sc.sig==3	\n\
	sc.prev==4	\n\
	sc.stkflg==5	\n\
	sc.mask==6	\n\
	sc.acs==7	\n\
	scsiz==027	\n"


#endif /* ifndef _USYSIG_INCLUDED */