• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef NT_ARM_SYSTEM_CALL
2 # define NT_ARM_SYSTEM_CALL 0x404
3 #endif
4 /*
5  * NT_ARM_SYSTEM_CALL regset is supported by linux kernel
6  * starting with commit v3.19-rc1~59^2~16.
7  */
8 
9 static int
arch_set_scno(struct tcb * tcp,kernel_ulong_t scno)10 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
11 {
12 	unsigned int n = (uint16_t) scno;
13 	const struct iovec io = {
14 		.iov_base = &n,
15 		.iov_len = sizeof(n)
16 	};
17 	int rc = ptrace(PTRACE_SETREGSET, tcp->pid, NT_ARM_SYSTEM_CALL, &io);
18 	if (rc && errno != ESRCH)
19 		perror_msg("arch_set_scno: NT_ARM_SYSTEM_CALL pid:%d scno:%#x",
20 			   tcp->pid, n);
21 	return rc;
22 }
23