1 static void
arch_sigreturn(struct tcb * tcp)2 arch_sigreturn(struct tcb *tcp)
3 {
4 	long addr;
5 
6 	if (upeek(tcp->pid, 4*PT_USP, &addr) < 0)
7 		return;
8 	/* Fetch pointer to struct sigcontext.  */
9 	if (umove(tcp, addr + 2 * sizeof(int), &addr) < 0)
10 		return;
11 
12 	unsigned long mask[NSIG / 8 / sizeof(long)];
13 	/* Fetch first word of signal mask.  */
14 	if (umove(tcp, addr, &mask[0]) < 0)
15 		return;
16 
17 	/* Fetch remaining words of signal mask, located immediately before.  */
18 	addr -= sizeof(mask) - sizeof(long);
19 	if (umoven(tcp, addr, sizeof(mask) - sizeof(long), &mask[1]) < 0)
20 		return;
21 
22 	tprintsigmask_addr("{mask=", mask);
23 	tprints("}");
24 }
25