Back to index

glibc  2.9
longjmp-ts.c File Reference
#include <hurd/signal.h>
#include <setjmp.h>
#include <jmpbuf-offsets.h>
#include <mach/thread_status.h>

Go to the source code of this file.


void _hurd_longjmp_thread_state (void *state, jmp_buf env, int val)

Function Documentation

void _hurd_longjmp_thread_state ( void *  state,
jmp_buf  env,
int  val 

Definition at line 29 of file longjmp-ts.c.

  struct alpha_thread_state *const ts = state;

  ts->r9 = env[0].__jmpbuf[JB_S0];
  ts->r10 = env[0].__jmpbuf[JB_S1];
  ts->r11 = env[0].__jmpbuf[JB_S2];
  ts->r12 = env[0].__jmpbuf[JB_S3];
  ts->r13 = env[0].__jmpbuf[JB_S4];
  ts->r13 = env[0].__jmpbuf[JB_S5];
  ts->pc = env[0].__jmpbuf[JB_PC];
  ts->r15 = env[0].__jmpbuf[JB_FP];
  ts->r30 = env[0].__jmpbuf[JB_SP];
  ts->r0 = val ?: 1;

  /* XXX
     To mimic longjmp we ought to restore some fp registers too.
     But those registers are in struct alpha_float_state.
     The only use of this is in fork, and it probably won't matter.