Search
lxdream.org :: lxdream/test/include/machine/setjmp.h
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/machine/setjmp.h
changeset 185:6755a04c447f
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (15 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
nkeynes@185
     1
#if defined(__arm__) || defined(__thumb__)
nkeynes@185
     2
/*
nkeynes@185
     3
 * All callee preserved registers:
nkeynes@185
     4
 * v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7
nkeynes@185
     5
 */
nkeynes@185
     6
#define _JBLEN 23
nkeynes@185
     7
#endif
nkeynes@185
     8
nkeynes@185
     9
#ifdef __sparc__
nkeynes@185
    10
/*
nkeynes@185
    11
 * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext).
nkeynes@185
    12
 * All else recovered by under/over(flow) handling.
nkeynes@185
    13
 */
nkeynes@185
    14
#define	_JBLEN	13
nkeynes@185
    15
#endif
nkeynes@185
    16
nkeynes@185
    17
/* necv70 was 9 as well. */
nkeynes@185
    18
nkeynes@185
    19
#ifdef __mc68000__
nkeynes@185
    20
/*
nkeynes@185
    21
 * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
nkeynes@185
    22
 * fp2-fp7	for 68881.
nkeynes@185
    23
 * All else recovered by under/over(flow) handling.
nkeynes@185
    24
 */
nkeynes@185
    25
#define	_JBLEN	34
nkeynes@185
    26
#endif
nkeynes@185
    27
nkeynes@185
    28
#if defined(__Z8001__) || defined(__Z8002__)
nkeynes@185
    29
/* 16 regs + pc */
nkeynes@185
    30
#define _JBLEN 20
nkeynes@185
    31
#endif
nkeynes@185
    32
nkeynes@185
    33
#ifdef _AM29K
nkeynes@185
    34
/*
nkeynes@185
    35
 * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext).
nkeynes@185
    36
 * All else recovered by under/over(flow) handling.
nkeynes@185
    37
 */
nkeynes@185
    38
#define	_JBLEN	9
nkeynes@185
    39
#endif
nkeynes@185
    40
nkeynes@185
    41
#if defined(__CYGWIN__) && !defined (_JBLEN)
nkeynes@185
    42
#define _JBLEN (13 * 4)
nkeynes@185
    43
#elif defined (__i386__)
nkeynes@185
    44
#ifdef __unix__
nkeynes@185
    45
# define _JBLEN	36
nkeynes@185
    46
#else
nkeynes@185
    47
#include "setjmp-dj.h"
nkeynes@185
    48
#endif
nkeynes@185
    49
#endif
nkeynes@185
    50
nkeynes@185
    51
#ifdef __i960__
nkeynes@185
    52
#define _JBLEN 35
nkeynes@185
    53
#endif
nkeynes@185
    54
nkeynes@185
    55
#ifdef __M32R__
nkeynes@185
    56
/* Only 8 words are currently needed.  10 gives us some slop if we need
nkeynes@185
    57
   to expand.  */
nkeynes@185
    58
#define _JBLEN 10
nkeynes@185
    59
#endif
nkeynes@185
    60
nkeynes@185
    61
#ifdef __mips__
nkeynes@185
    62
#define _JBLEN 11
nkeynes@185
    63
#endif
nkeynes@185
    64
nkeynes@185
    65
#ifdef __m88000__
nkeynes@185
    66
#define _JBLEN 21
nkeynes@185
    67
#endif
nkeynes@185
    68
nkeynes@185
    69
#ifdef __H8300__
nkeynes@185
    70
#define _JBLEN 5
nkeynes@185
    71
typedef int jmp_buf[_JBLEN];
nkeynes@185
    72
#endif
nkeynes@185
    73
nkeynes@185
    74
#ifdef __H8300H__
nkeynes@185
    75
/* same as H8/300 but registers are twice as big */
nkeynes@185
    76
#define _JBLEN 5
nkeynes@185
    77
#define _JBTYPE long
nkeynes@185
    78
#endif
nkeynes@185
    79
nkeynes@185
    80
#ifdef __H8300S__
nkeynes@185
    81
/* same as H8/300 but registers are twice as big */
nkeynes@185
    82
#define _JBLEN 5
nkeynes@185
    83
#define _JBTYPE long
nkeynes@185
    84
#endif
nkeynes@185
    85
nkeynes@185
    86
#ifdef __H8500__
nkeynes@185
    87
#define _JBLEN 4
nkeynes@185
    88
#endif
nkeynes@185
    89
nkeynes@185
    90
#ifdef  __sh__
nkeynes@185
    91
#define _JBLEN 20
nkeynes@185
    92
#endif
nkeynes@185
    93
nkeynes@185
    94
#ifdef  __v800
nkeynes@185
    95
#define _JBLEN 28
nkeynes@185
    96
#endif
nkeynes@185
    97
nkeynes@185
    98
#ifdef __PPC__
nkeynes@185
    99
#define _JBLEN 32
nkeynes@185
   100
#define _JBTYPE double
nkeynes@185
   101
#endif
nkeynes@185
   102
nkeynes@185
   103
#ifdef __hppa__
nkeynes@185
   104
/* %r30, %r2-%r18, %r27, pad, %fr12-%fr15.
nkeynes@185
   105
   Note space exists for the FP registers, but they are not
nkeynes@185
   106
   saved.  */
nkeynes@185
   107
#define _JBLEN 28
nkeynes@185
   108
#endif
nkeynes@185
   109
nkeynes@185
   110
#if defined(__mn10300__) || defined(__mn10200__)
nkeynes@185
   111
/* A guess */
nkeynes@185
   112
#define _JBLEN 10
nkeynes@185
   113
#endif
nkeynes@185
   114
nkeynes@185
   115
#ifdef __v850
nkeynes@185
   116
/* I think our setjmp is saving 15 regs at the moment.  Gives us one word
nkeynes@185
   117
   slop if we need to expand.  */
nkeynes@185
   118
#define _JBLEN 16
nkeynes@185
   119
#endif
nkeynes@185
   120
nkeynes@185
   121
#ifdef __TIC80__
nkeynes@185
   122
#define _JBLEN 13
nkeynes@185
   123
#endif
nkeynes@185
   124
nkeynes@185
   125
#ifdef __D10V__
nkeynes@185
   126
#define _JBLEN 8
nkeynes@185
   127
#endif
nkeynes@185
   128
nkeynes@185
   129
#ifdef __D30V__
nkeynes@185
   130
#define _JBLEN ((64 /* GPR */ + (2*2) /* ACs */ + 18 /* CRs */) / 2)
nkeynes@185
   131
#define _JBTYPE double
nkeynes@185
   132
#endif
nkeynes@185
   133
nkeynes@185
   134
nkeynes@185
   135
#ifdef __fr30__
nkeynes@185
   136
#define _JBLEN 10
nkeynes@185
   137
#endif
nkeynes@185
   138
nkeynes@185
   139
#ifdef __mcore__
nkeynes@185
   140
#define _JBLEN 16
nkeynes@185
   141
#endif
nkeynes@185
   142
nkeynes@185
   143
#ifdef _JBLEN
nkeynes@185
   144
#ifdef _JBTYPE
nkeynes@185
   145
typedef	_JBTYPE jmp_buf[_JBLEN];
nkeynes@185
   146
#else
nkeynes@185
   147
typedef	int jmp_buf[_JBLEN];
nkeynes@185
   148
#endif
nkeynes@185
   149
nkeynes@185
   150
#if defined(__CYGWIN32__) || defined(__rtems__)
nkeynes@185
   151
#include <signal.h>
nkeynes@185
   152
nkeynes@185
   153
/* POSIX sigsetjmp/siglongjmp macros */
nkeynes@185
   154
typedef int sigjmp_buf[_JBLEN+2];
nkeynes@185
   155
nkeynes@185
   156
#define _SAVEMASK	_JBLEN
nkeynes@185
   157
#define _SIGMASK	(_JBLEN+1)
nkeynes@185
   158
nkeynes@185
   159
#define sigsetjmp(env, savemask) (env[_SAVEMASK] = savemask,\
nkeynes@185
   160
               sigprocmask (SIG_SETMASK, 0, (sigset_t *) &env[_SIGMASK]),\
nkeynes@185
   161
               setjmp (env))
nkeynes@185
   162
nkeynes@185
   163
#define siglongjmp(env, val) (((env[_SAVEMASK])?\
nkeynes@185
   164
               sigprocmask (SIG_SETMASK, (sigset_t *) &env[_SIGMASK], 0):0),\
nkeynes@185
   165
               longjmp (env, val))
nkeynes@185
   166
nkeynes@185
   167
#endif /* __CYGWIN32__ or __rtems__ */
nkeynes@185
   168
#endif
.