System Control Coprocessor
ARM DDI 0363E Copyright ©2009 ARM Limited. All rights reserved. 4-61
ID013010 Non-Confidential, Unrestricted Access
The Context ID Register, bits [31:0] contain the process ID number.
To use the Context ID Register, read or write CP15 with:
MRC p15, 0, <Rd>, c13, c0, 1 ; Read Context ID Register
MCR p15, 0, <Rd>, c13, c0, 1 ; Write Context ID Register
4.2.27 c13, Thread and Process ID Registers
The Thread and Process ID Registers provide locations to store the IDs of software threads and
processes for Operating System (OS) management purposes.
The Thread and Process ID Registers are:
three read/write registers:
User read/write Thread and Process ID Register
User read-only Thread and Process ID Register
Privileged-only Thread and Process ID Register.
each accessible in different modes:
The User read/write register can be read and written in User and Privileged modes.
The User read-only register can only be read in User mode, but can be read and
written in Privileged modes.
The Privileged-only register can be read and written in Privileged modes only.
To access the Thread and Process ID registers, read or write CP15 with:
MRC p15, 0, <Rd>, c13, c0, 2 ; Read User read/write Thread and Proc. ID Register
MCR p15, 0, <Rd>, c13, c0, 2 ; Write User read/write Thread and Proc. ID Register
MRC p15, 0, <Rd>, c13, c0, 3 ; Read User Read Only Thread and Proc. ID Register
MCR p15, 0, <Rd>, c13, c0, 3 ; Write User Read Only Thread and Proc. ID Register
MRC p15, 0, <Rd>, c13, c0, 4 ; Read Privileged Only Thread and Proc. ID Register
MCR p15, 0, <Rd>, c13, c0, 4 ; Write Privileged Only Thread and Proc. ID Register
Reading or writing the Thread and Process ID registers has no effect on processor state or
operation. These registers provide OS support, and the OS must manage them.
You must clear the contents of all Thread and Process ID registers on process switches to
prevent data leaking from one process to another. This is important to ensure the security of data.
The reset value of these registers is 0.