sigcontextinfo.h 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (C) 2017 Hangzhou C-SKY Microsystems co.,ltd.
  3. *
  4. * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
  5. * in this tarball.
  6. */
  7. /* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
  8. This file is part of the GNU C Library.
  9. Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998.
  10. The GNU C Library is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU Lesser General Public
  12. License as published by the Free Software Foundation; either
  13. version 2.1 of the License, or (at your option) any later version.
  14. The GNU C Library is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. Lesser General Public License for more details.
  18. You should have received a copy of the GNU Lesser General Public
  19. License along with the GNU C Library; if not, write to the Free
  20. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  21. 02111-1307 USA. */
  22. #define SIGCONTEXT int _code, struct sigcontext *
  23. #define SIGCONTEXT_EXTRA_ARGS _code,
  24. #define GET_PC(ctx) ((void *) (ctx)->sc_pc)
  25. #define GET_FRAME(ctx) ((void *) __builtin_frame_address (1))
  26. #define GET_STACK(ctx) ((void *) (ctx)->sc_usp)
  27. #define CALL_SIGHANDLER(handler, signo, ctx) \
  28. (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))