Back to index

glibc  2.9
Functions
setjmp.h File Reference
#include <setjmp/setjmp.h>

Go to the source code of this file.

Functions

void __longjmp (__jmp_buf __env, int __val) __attribute__((__noreturn__))
int __sigjmp_save (jmp_buf __env, int __savemask)
void _longjmp_unwind (jmp_buf env, int val)
void __libc_siglongjmp (sigjmp_buf env, int val) __attribute__((noreturn))
void __libc_longjmp (sigjmp_buf env, int val) __attribute__((noreturn))

Function Documentation

void __libc_longjmp ( sigjmp_buf  env,
int  val 
)

Here is the caller graph for this function:

void __libc_siglongjmp ( sigjmp_buf  env,
int  val 
)

Definition at line 28 of file longjmp.c.

{
  /* Perform any cleanups needed by the frames being unwound.  */
  _longjmp_unwind (env, val);

  if (env[0].__mask_was_saved)
    /* Restore the saved signal mask.  */
    (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
                       (sigset_t *) NULL);

  /* Call the machine-dependent function to restore machine state.  */
  __longjmp (env[0].__jmpbuf, val ?: 1);
}

Here is the caller graph for this function:

void __longjmp ( __jmp_buf  __env,
int  __val 
)

Definition at line 25 of file __longjmp.c.

{
  /* This restores the FP and SP that setjmp's caller had,
     and puts the return address into A0 and VAL into D0. */

#if    defined(__HAVE_68881__) || defined(__HAVE_FPU__)
  /* Restore the floating-point registers.  */
  asm volatile("fmovem%.x %0, %/fp0-%/fp7" :
              /* No outputs.  */ : "g" (env[0].__fpregs[0]));
#elif defined (__mcffpu__)
  asm volatile("fmovem %0, %/fp0-%/fp7" :
              /* No outputs.  */ : "m" (env[0].__fpregs[0]));
#endif

  /* Put VAL in D0.  */
  asm volatile("move%.l %0, %/d0" : /* No outputs.  */ :
              "g" (val == 0 ? 1 : val) : "d0");

  asm volatile(/* Restore the data and address registers.  */
              "movem%.l %0, %/d1-%/d7/%/a0-%/a7\n"
              /* Return to setjmp's caller.  */
#ifdef __motorola__
              "jmp (%/a0)"
#else
              "jmp %/a0@"
#endif
              : /* No outputs.  */ : "g" (env[0].__dregs[0])
              /* We don't bother with the clobbers,
                because this code always jumps out anyway.  */
              );

  /* Avoid `volatile function does return' warnings.  */
  for (;;);
}

Here is the caller graph for this function:

int __sigjmp_save ( jmp_buf  __env,
int  __savemask 
)
void _longjmp_unwind ( jmp_buf  env,
int  val 
)

Definition at line 29 of file jmp-unwind.c.

{
  __libc_maybe_call2 (pthread_cleanup_upto,
                    (env->__jmpbuf, __builtin_frame_address (0)),
                    (void) 0);
}

Here is the call graph for this function:

Here is the caller graph for this function: