System registers

As well as general purpose registers, the architecture defines system registers. System registers are used to configure the processor and to control systems such as the MMU and exception handling.

System registers cannot be used directly by data processing or load/store instructions. Instead, the contents of a system register need to be read into an X register, operated on, and then written back to the system register. There are two specialist instructions for accessing system registers:

MRS	Xd, <system register>

reads the system register into Xd.

MSR	<system register>, Xn

write Xn to the system register.

System registers are specified by name, for example SCTLR_EL1:

MRS	X0, SCTLR_EL1

reads SCTLR_EL1 into X0.

System register names end with _ELx. The _ELx specifies the minimum privilege necessary to access the register. For example:

SCTLR_EL1

requires EL1 or higher privilege.

SCTLR_EL2

requires EL2 or higher privilege.

SCTLR_EL3

requires EL3 privilege

Attempting to access the register with insufficient privilege results in an exception.

Note: Sometimes you will see _EL12 or _EL01. These are used as part of virtualization. Refer to the guide on virtualization for more information.

Previous Next