1 /* Return codes: 1 - ok, 0 - ignore, other - error. */ 2 static int arch_get_scno(struct tcb * tcp)3arch_get_scno(struct tcb *tcp) 4 { 5 long scno = 0; 6 7 if (upeek(tcp->pid, REG_A3, &alpha_a3) < 0) 8 return -1; 9 if (upeek(tcp->pid, REG_R0, &scno) < 0) 10 return -1; 11 12 /* 13 * Do some sanity checks to figure out if it's 14 * really a syscall entry 15 */ 16 if (!SCNO_IN_RANGE(scno)) { 17 if (alpha_a3 == 0 || alpha_a3 == -1) { 18 if (debug_flag) 19 error_msg("stray syscall exit: r0 = %ld", scno); 20 return 0; 21 } 22 } 23 24 tcp->scno = scno; 25 return 1; 26 } 27