xref: /aosp_15_r20/external/strace/linux/tile/get_scno.c (revision cf84ac9a129d8ea9952db616b4e9b904c4bdde56)
1*cf84ac9aSAndroid Build Coastguard Worker /* Return codes: 1 - ok, 0 - ignore, other - error. */
2*cf84ac9aSAndroid Build Coastguard Worker static int
arch_get_scno(struct tcb * tcp)3*cf84ac9aSAndroid Build Coastguard Worker arch_get_scno(struct tcb *tcp)
4*cf84ac9aSAndroid Build Coastguard Worker {
5*cf84ac9aSAndroid Build Coastguard Worker 	unsigned int currpers;
6*cf84ac9aSAndroid Build Coastguard Worker 
7*cf84ac9aSAndroid Build Coastguard Worker #ifdef __tilepro__
8*cf84ac9aSAndroid Build Coastguard Worker 	currpers = 1;
9*cf84ac9aSAndroid Build Coastguard Worker #else
10*cf84ac9aSAndroid Build Coastguard Worker # ifndef PT_FLAGS_COMPAT
11*cf84ac9aSAndroid Build Coastguard Worker #  define PT_FLAGS_COMPAT 0x10000  /* from Linux 3.8 on */
12*cf84ac9aSAndroid Build Coastguard Worker # endif
13*cf84ac9aSAndroid Build Coastguard Worker 	if (tile_regs.flags & PT_FLAGS_COMPAT)
14*cf84ac9aSAndroid Build Coastguard Worker 		currpers = 1;
15*cf84ac9aSAndroid Build Coastguard Worker 	else
16*cf84ac9aSAndroid Build Coastguard Worker 		currpers = 0;
17*cf84ac9aSAndroid Build Coastguard Worker #endif
18*cf84ac9aSAndroid Build Coastguard Worker 	update_personality(tcp, currpers);
19*cf84ac9aSAndroid Build Coastguard Worker 	tcp->scno = tile_regs.regs[10];
20*cf84ac9aSAndroid Build Coastguard Worker 
21*cf84ac9aSAndroid Build Coastguard Worker 	return 1;
22*cf84ac9aSAndroid Build Coastguard Worker }
23