sigcontextinfo.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) 2016-2017 Andes Technology, Inc.
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. /* Copyright (C) 1999-2013 Free Software Foundation, Inc.
  6. Contributed by Philip Blundell <philb@gnu.org>, 1999.
  7. The GNU C Library is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU Lesser General Public
  9. License as published by the Free Software Foundation; either
  10. version 2.1 of the License, or (at your option) any later version.
  11. The GNU C Library is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with the GNU C Library. If not, see
  17. <http://www.gnu.org/licenses/>. */
  18. #include <sys/ucontext.h>
  19. #define SIGCONTEXT siginfo_t *_si, struct ucontext *
  20. #define SIGCONTEXT_EXTRA_ARGS _si,
  21. #define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.nds32_ipc)
  22. #define GET_FRAME(ctx) ADVANCE_STACK_FRAME ((void *) ctx->uc_mcontext.nds32_fp)
  23. #define GET_STACK(ctx) ((void *) (ctx)->uc_mcontext.nds32_sp)
  24. #define CALL_SIGHANDLER(handler, signo, ctx) \
  25. (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))