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 
6 /* Copyright (C) 1999-2013 Free Software Foundation, Inc.
7    Contributed by Philip Blundell <philb@gnu.org>, 1999.
8 
9    The GNU C Library is free software; you can redistribute it and/or
10    modify it under the terms of the GNU Lesser General Public
11    License as published by the Free Software Foundation; either
12    version 2.1 of the License, or (at your option) any later version.
13 
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 
19    You should have received a copy of the GNU Lesser General Public
20    License along with the GNU C Library.  If not, see
21    <http://www.gnu.org/licenses/>.  */
22 
23 #include <sys/ucontext.h>
24 
25 #define SIGCONTEXT siginfo_t *_si, struct ucontext *
26 #define SIGCONTEXT_EXTRA_ARGS _si,
27 
28 #define GET_PC(ctx)	((void *) (ctx)->uc_mcontext.nds32_ipc)
29 #define GET_FRAME(ctx)	ADVANCE_STACK_FRAME ((void *) ctx->uc_mcontext.nds32_fp)
30 #define GET_STACK(ctx)	((void *) (ctx)->uc_mcontext.nds32_sp)
31 
32 
33 #define CALL_SIGHANDLER(handler, signo, ctx) \
34   (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
35 
36