/*
Copyright (c) 1993 Xerox Corporation.  All rights reserved.
*/
/*
$Id$

$Date$
 */
/* Chauser, October 28, 1993 3:30 pm PDT */


#ifndef	←←PCR←setjmp←h
#define ←←PCR←setjmp←h 1

#include <config/PCR←Arch.h>

/*
    This is one of the few PCR posix headers than can't just include
      the corresponding host header, but the setjmp implementation
      sometimes must be different inside threads.
    Some compilers (notably old gcc) recognize the identifiers setjmp
      and longjmp and process them specially, so the usual PCR renaming
      is not viable.  This means the PCR implementation itself
      is unable to use setjmp/longjmp.
*/

#if defined(PCR←Arch←SPARC)

#   define PCR←setjmp←JBLEN	2
#   define PCR←setjmp←SIGJBLEN	(PCR←setjmp←JBLEN+2)

#   define PCR←setjmp←jmp←buf←spIndex		0
#   define PCR←setjmp←jmp←buf←pcIndex		1
#   define PCR←setjmp←sigjmp←buf←maskSavedIndex	2
#   define PCR←setjmp←sigjmp←buf←maskIndex	3

#elif defined(PCR←Arch←MIPS)

#   define PCR←setjmp←JBLEN	28
#   define PCR←setjmp←SIGJBLEN	PCR←setjmp←JBLEN

#   define PCR←setjmp←jmp←buf←spIndex		2
#   define PCR←setjmp←jmp←buf←pcIndex		3
#   define PCR←setjmp←sigjmp←buf←maskSavedIndex	0
#   define PCR←setjmp←sigjmp←buf←maskIndex	1

#   define PCR←setjmp←sigjmp←buf←v0Index	4
#   define PCR←setjmp←sigjmp←buf←s0Index	5
#   define PCR←setjmp←sigjmp←buf←s1Index	6
#   define PCR←setjmp←sigjmp←buf←s2Index	7
#   define PCR←setjmp←sigjmp←buf←s3Index	8
#   define PCR←setjmp←sigjmp←buf←s4Index	9
#   define PCR←setjmp←sigjmp←buf←s5Index	10
#   define PCR←setjmp←sigjmp←buf←s6Index	11
#   define PCR←setjmp←sigjmp←buf←s7Index	12
#   define PCR←setjmp←sigjmp←buf←s8Index	13
#   define PCR←setjmp←sigjmp←buf←f20Index	14
#   define PCR←setjmp←sigjmp←buf←f21Index	15
#   define PCR←setjmp←sigjmp←buf←f22Index	16
#   define PCR←setjmp←sigjmp←buf←f23Index	17
#   define PCR←setjmp←sigjmp←buf←f24Index	18
#   define PCR←setjmp←sigjmp←buf←f25Index	19
#   define PCR←setjmp←sigjmp←buf←f26Index	20
#   define PCR←setjmp←sigjmp←buf←f27Index	21
#   define PCR←setjmp←sigjmp←buf←f28Index	22
#   define PCR←setjmp←sigjmp←buf←f29Index	23
#   define PCR←setjmp←sigjmp←buf←f30Index	24
#   define PCR←setjmp←sigjmp←buf←f31Index	25
#   define PCR←setjmp←sigjmp←buf←fpcsrIndex	26
#   define PCR←setjmp←sigjmp←buf←magicIndex	27

#else

#   error PCR←Host←arch NYI

#endif

#undef jmp←buf
#undef sigjmp←buf
#undef setjmp
#undef sigsetjmp
#undef longjmp
#undef siglongjmp


typedef long jmp←buf[PCR←setjmp←JBLEN];
#define PCR←jmp←buf jmp←buf

typedef long * jmp←buf←ptr;
#define PCR←jmp←buf←ptr jmp←buf←ptr


typedef long sigjmp←buf[PCR←setjmp←SIGJBLEN];
#define PCR←sigjmp←buf sigjmp←buf

typedef long * sigjmp←buf←ptr;
#define PCR←sigjmp←buf←ptr sigjmp←buf←ptr


extern int setjmp(jmp←buf env);
#define PCR←setjmp setjmp

extern int
PCR←←sigsetjmpInit(sigjmp←buf env, int savemask);

extern int sigsetjmp(sigjmp←buf env, int savemask);
#define sigsetjmp(env,save) (\
	PCR←←sigsetjmpInit((env),(save)), setjmp(env) )
#define PCR←sigsetjmp sigsetjmp


extern void
PCR←←longjmpInner(PCR←jmp←buf env, int val);

extern void longjmp(PCR←jmp←buf env, int val);
#define PCR←longjmp longjmp

extern void siglongjmp(PCR←sigjmp←buf env, int val);
#define PCR←siglongjmp siglongjmp


#endif /* !←←PCR←setjmp←h */

/*
$Log$
*/