The eBPF processor provides ten general-purpose 64-bit registers, which are read-write, and a read-only frame pointer register:
In normal syntax:
General-purpose registers.
Read-only frame pointer register.
All BPF registers are 64-bit long. However, in the Pseudo-C syntax registers can be referred using different names, which actually reflect the kind of instruction they appear on:
In pseudoc syntax:
General-purpose register in an instruction that operates on its value as if it was a 64-bit value.
General-purpose register in an instruction that operates on its value as if it was a 32-bit value.
Read-only frame pointer register.
Note that in the Pseudo-C syntax register names are not preceded by
%
characters. A consequence of that is that in contexts like
instruction operands, where both register names and expressions
involving symbols are expected, there is no way to disambiguate
between them. In order to keep things simple, this assembler does not
allow to refer to symbols whose names collide with register names in
instruction operands.