rustix::backend

Module reg

Source
Expand description

Encapsulation for system call arguments and return values.

The inline-asm code paths do some amount of reordering of arguments; to ensure that we don’t accidentally misroute an argument or return value, we use distinct types for each argument index and return value.

§Safety

The ToAsm and FromAsm traits are unsafe to use; they should only be used by the syscall code which executes actual syscall machine instructions.

Modules§

  • private 🔒
    Seal our various traits using the technique documented here.

Structs§

  • A0 🔒
  • A1 🔒
  • A2 🔒
  • A3 🔒
  • A4 🔒
  • A5 🔒
  • ArgReg 🔒
    Syscall arguments use register-sized types. We use a newtype to discourage accidental misuse of the raw integer values.
  • Opaque 🔒
    To preserve provenance, syscall arguments and return values are passed as pointer types. They need a type to point to, so we define a custom private type, to prevent it from being used for anything else.
  • R0 🔒
  • RetReg 🔒
    Syscall return values use register-sized types. We use a newtype to discourage accidental misuse of the raw integer values.

Traits§

Functions§

  • nr 🔒
    Encode a system call number (a __NR_* constant) as a SyscallNumber.
  • raw_arg 🔒
    Encode a system call argument as an ArgReg.