add NDS32 support into signal.c

Signed-off-by: Macpaul Lin <[email protected]>
---
 signal.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/signal.c b/signal.c
index eb658d7..e8bc418 100644
--- a/signal.c
+++ b/signal.c
@@ -1559,6 +1559,28 @@ sys_sigreturn(struct tcb *tcp)
                return RVAL_NONE | RVAL_STR;
        }
        return 0;
+#elif defined(NDS32)
+       long sp;
+       struct sigcontext sc;
+
+       if (entering(tcp)) {
+               tcp->u_arg[0] = 0;
+
+               /* Read r1, the stack pointer.  */
+               if (upeek(tcp, 4 * 3, &sp) < 0)
+                       return 0;
+               if (umove(tcp, sp, &sc) < 0)
+                       return 0;
+               tcp->u_arg[0] = 1;
+               tcp->u_arg[1] = sc.oldmask;
+       } else {
+               tcp->u_rval = tcp->u_error = 0;
+               if (tcp->u_arg[0] == 0)
+                       return 0;
+               tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0);
+               return RVAL_NONE | RVAL_STR;
+       }
+       return 0;
 #else
 #warning No sys_sigreturn() for this architecture
 #warning         (no problem, just a reminder :-)
-- 
1.7.3.5


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to