Commit 4652072e authored by Dave Thaler's avatar Dave Thaler Committed by Alexei Starovoitov

bpf, docs: Move sentence about returning R0 to abi.rst

As discussed at LSF/MM/BPF, the sentence about using R0 for returning
values from calls is part of the calling convention and belongs in
abi.rst.  Any further additions or clarifications to this text are left
for future patches on abi.rst.  The current patch is simply to unblock
progression of instruction-set.rst to a standard.

In contrast, the restriction of register numbers to the range 0-10
is untouched, left in the instruction-set.rst definition of the
src_reg and dst_reg fields.
Signed-off-by: default avatarDave Thaler <dthaler1968@googlemail.com>
Link: https://lore.kernel.org/r/20240517153445.3914-1-dthaler1968@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 2c1713a8
...@@ -23,3 +23,6 @@ The BPF calling convention is defined as: ...@@ -23,3 +23,6 @@ The BPF calling convention is defined as:
R0 - R5 are scratch registers and BPF programs needs to spill/fill them if R0 - R5 are scratch registers and BPF programs needs to spill/fill them if
necessary across calls. necessary across calls.
The BPF program needs to store the return value into register R0 before doing an
``EXIT``.
...@@ -476,9 +476,6 @@ the jump instruction. Thus 'PC += 1' skips execution of the next ...@@ -476,9 +476,6 @@ the jump instruction. Thus 'PC += 1' skips execution of the next
instruction if it's a basic instruction or results in undefined behavior instruction if it's a basic instruction or results in undefined behavior
if the next instruction is a 128-bit wide instruction. if the next instruction is a 128-bit wide instruction.
The BPF program needs to store the return value into register R0 before doing an
``EXIT``.
Example: Example:
``{JSGE, X, JMP32}`` means:: ``{JSGE, X, JMP32}`` means::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment