The Linux Kernel

6.7.0

Quick search

Contents

  • A guide to the Kernel Development Process
  • Submitting patches: the essential guide to getting your code into the kernel
  • Code of conduct
  • Kernel Maintainer Handbook
  • All development-process docs
  • Core API Documentation
  • Driver implementer's API guide
  • Kernel subsystem documentation
    • Core subsystems
    • Human interfaces
    • Networking interfaces
    • Storage interfaces
      • Filesystems in the Linux kernel
      • Block
      • CD-ROM
      • SCSI Subsystem
      • TCM Virtual Device
      • Accounting
      • CPUFreq - CPU frequency and voltage scaling code in the Linux(TM) kernel
      • FPGA
      • I2C/SMBus Subsystem
      • Industrial I/O
      • PCMCIA
      • Serial Peripheral Interface (SPI)
      • 1-Wire Subsystem
      • Watchdog Support
      • Virtualization Support
      • Hardware Monitoring
      • Compute Accelerators
      • Security Documentation
      • Crypto API
      • BPF Documentation
      • USB support
      • PCI Bus Subsystem
      • Assorted Miscellaneous Devices Documentation
      • PECI Subsystem
      • WMI Subsystem
  • Locking in the kernel
  • Linux kernel licensing rules
  • How to write kernel documentation
  • Development tools for the kernel
  • Kernel Testing Guide
  • Kernel Hacking Guides
  • Linux Tracing Technologies
  • fault-injection
  • Kernel Livepatching
  • Rust
  • The Linux kernel user's and administrator's guide
  • The kernel build system
  • Reporting issues
  • User-space tools
  • The Linux kernel user-space API guide
  • The Linux kernel firmware guide
  • Open Firmware and Devicetree
  • CPU Architectures
  • Unsorted Documentation
  • Translations

This Page

  • Show Source

Contents

  • 1 BPF ABI Recommended Conventions and Guidelines v1.0

    • 1.1 Registers and calling convention

1 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.

1.1 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.

©The kernel development community. | Powered by Sphinx 5.0.1 & Alabaster 0.7.12 | Page source