[PATCH 5/6] nds32: add NDS32 support into signal.c

Macpaul Lin macpaul at andestech.com
Fri Feb 11 09:38:00 UTC 2011


add NDS32 support into signal.c

Signed-off-by: Macpaul Lin <macpaul at andestech.com>
---
 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





More information about the Strace-devel mailing list