brintos

brintos / linux-shallow public Read only

0
0
Text · 968 B · 4151413 Raw
29 lines · plain
1.. contents::2.. sectnum::3 4===================================================5BPF ABI Recommended Conventions and Guidelines v1.06===================================================7 8This is version 1.0 of an informational document containing recommended9conventions and guidelines for producing portable BPF program binaries.10 11Registers and calling convention12================================13 14BPF has 10 general purpose registers and a read-only frame pointer register,15all of which are 64-bits wide.16 17The BPF calling convention is defined as:18 19* R0: return value from function calls, and exit value for BPF programs20* R1 - R5: arguments for function calls21* R6 - R9: callee saved registers that function calls will preserve22* R10: read-only frame pointer to access stack23 24R0 - R5 are scratch registers and BPF programs needs to spill/fill them if25necessary across calls.26 27The BPF program needs to store the return value into register R0 before doing an28``EXIT``.29