I have following instructions in Android shared library:
MRC p15, 0, R3,c13,c0, 3
LDR R3, [R3,#4]
MOV R0, #0
STR R0, [R3,#0xC]
According to ARM documentation:
Reading or writing the Thread and Process ID Registers has no effect on the processor state or operation. These registers provide OS support and must be managed by the OS.
That's nice, but what is implementation of this register value in Android or ARM Linux?
From the code, it tries to read Thread and Process ID Register value as structure,and it reads some field with offset 4
. This field is pointer to structure itself, and it writes 0
to field with offset 12
.
So, the register value is for sure not pthread_t
, because, according to Android source codes, pthread_t
field with offset 4 is unsigned int
and not pointer to any structure.
Does anyone know where can I find definition of structure returned by MRC c13::c0::3
in Android ARM?