Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #885 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

__jmp_buf decl missing in setjmp for SPARC

Reported by: larsivi Assigned to: sean
Priority: major Milestone: 0.99.5
Component: Core Functionality Version: 0.99.4 Frank
Keywords: sparc, linux Cc:

Description

Could this be looked over and possibly added for some more arches? like PPC etc

setjmp.h on this SPARC box (which is 64 bit but uses 32 bit userspace, thus no SPARC64 identifier, however I expect that SPARC64 may be needed for Solaris on Sparc).

#include <bits/wordsize.h>

#if __WORDSIZE == 64

#ifndef _ASM
typedef struct __sparc64_jmp_buf
  {
    struct __sparc64_jmp_buf    *uc_link;
    unsigned long               uc_flags;
    unsigned long               uc_sigmask;
    struct __sparc64_jmp_buf_mcontext
      {
        unsigned long           mc_gregs[19];
        unsigned long           mc_fp;
        unsigned long           mc_i7;
        struct __sparc64_jmp_buf_fpu
          {
            union
              {
                unsigned int    sregs[32];
                unsigned long   dregs[32];
                long double     qregs[16];
              }                 mcfpu_fpregs;
            unsigned long       mcfpu_fprs;
            unsigned long       mcfpu_gsr;
            void                *mcfpu_fq;
            unsigned char       mcfpu_qcnt;
            unsigned char       mcfpu_qentsz;
            unsigned char       mcfpu_enab;
          }                     mc_fpregs;
      }                         uc_mcontext;
  } __jmp_buf[1];
#endif

#else

#ifndef _ASM
typedef int __jmp_buf[3];
#endif

#endif

wordsize.h is

/* Determine the wordsize from the preprocessor defines.  */

#if defined __arch64__ || defined __sparcv9
# define __WORDSIZE     64
#else
# define __WORDSIZE     32
#endif

#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL

# if __WORDSIZE == 32
/* Signal that in 32bit ABI we didn't used to have a `long double'.
   The changes all the `long double' function variants to be redirects
   to the double functions.  */
#  define __LONG_DOUBLE_MATH_OPTIONAL   1
#  ifndef __LONG_DOUBLE_128__
#   define __NO_LONG_DOUBLE_MATH        1
#  endif
# endif
#endif

Change History

02/14/08 07:00:37 changed by larsivi

  • status changed from new to closed.
  • resolution set to fixed.

(In [3182]) Add jmp_buf definition for SPARC. closes #885

02/14/08 07:01:28 changed by larsivi

Review this in case the solution is too simple, or not correct.