-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf, docs: Add abi.rst document to standardization subdirectory
As specified in the IETF BPF charter, the BPF working group has plans to add one or more informational documents that recommend conventions and guidelines for producing portable BPF program binaries. The instruction-set.rst document currently contains a "Registers and calling convention" subsection which dictates a calling convention that belongs in an ABI document, rather than an instruction set document. Let's move it to a new abi.rst document so we can clean it up. The abi.rst document will of course be significantly changed and expanded upon over time. For now, it's really just a placeholder which will contain ABI-specific language that doesn't belong in other documents. Signed-off-by: David Vernet <void@manifault.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20230828155948.123405-3-void@manifault.com
- Loading branch information
David Vernet
authored and
Daniel Borkmann
committed
Aug 30, 2023
1 parent
aee1720
commit deb8840
Showing
3 changed files
with
26 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.. contents:: | ||
.. sectnum:: | ||
|
||
=================================================== | ||
BPF ABI Recommended Conventions and Guidelines v1.0 | ||
=================================================== | ||
|
||
This is version 1.0 of an informational document containing recommended | ||
conventions and guidelines for producing portable BPF program binaries. | ||
|
||
Registers and calling convention | ||
================================ | ||
|
||
BPF has 10 general purpose registers and a read-only frame pointer register, | ||
all of which are 64-bits wide. | ||
|
||
The BPF calling convention is defined as: | ||
|
||
* R0: return value from function calls, and exit value for BPF programs | ||
* R1 - R5: arguments for function calls | ||
* R6 - R9: callee saved registers that function calls will preserve | ||
* R10: read-only frame pointer to access stack | ||
|
||
R0 - R5 are scratch registers and BPF programs needs to spill/fill them if | ||
necessary across calls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters