sigcontext.c 921 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright 2003 PathScale, Inc.
  3. *
  4. * Licensed under the GPL
  5. */
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <signal.h>
  9. #include "user.h"
  10. void sc_to_sc(void *to_ptr, void *from_ptr)
  11. {
  12. struct sigcontext *to = to_ptr, *from = from_ptr;
  13. int size = sizeof(*to); /* + sizeof(struct _fpstate); */
  14. memcpy(to, from, size);
  15. if(from->fpstate != NULL)
  16. to->fpstate = (struct _fpstate *) (to + 1);
  17. to->fpstate = NULL;
  18. }
  19. unsigned long *sc_sigmask(void *sc_ptr)
  20. {
  21. struct sigcontext *sc = sc_ptr;
  22. return(&sc->oldmask);
  23. }
  24. /* Overrides for Emacs so that we follow Linus's tabbing style.
  25. * Emacs will notice this stuff at the end of the file and automatically
  26. * adjust the settings for this buffer only. This must remain at the end
  27. * of the file.
  28. * ---------------------------------------------------------------------------
  29. * Local variables:
  30. * c-file-style: "linux"
  31. * End:
  32. */