igd_opregion_shift_copy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… igd_opregion_shift_copy β€” a little kernel API glow-up

okay so welcome to the Kernel API Manual bestie, today's main character is igd_opregion_shift_copy(9) and honestly the name alone is giving "senior engineer who names variables after their emotional state" 😭 but we love her, no cap πŸ’–


✨ NAME ✨

igd_opregion_shift_copy β€” Copy OpRegion to user buffer and shift position.

like... that's it, that's the whole pitch. she copies, she shifts, she leaves ✨


🌸 SYNOPSIS 🌸

unsigned long igd_opregion_shift_copy (char __user *dst , loff_t *off ,
void *src , loff_t *pos , size_t *remaining , size_t bytes );

literally six arguments. six. she's high-maintenance and honestly? iconic for it πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

okay let's do a vibe check on every single one of these bad boys, nobody gets left behind 🫢

  • dst β€” the User buffer ptr you're copying to. that's the destination, the final boss, the place where the data ends up πŸ’…
  • off β€” Offset into the user buffer ptr. she gets increased by bytes on return β€” so she goes up, she doesn't come back down, she's on her growth arc πŸ“ˆ
  • src β€” the Source buffer you're copying from. the origin story, the parent, the one who gave everything 🌈
  • pos β€” gets increased by bytes on return. yes bestie, another one that levels up on return, we stan consistency πŸ’œ
  • remaining β€” gets decreased by bytes on return. she's shrinking, she's humbled, she's not okay but she's trying 😭
  • bytes β€” the number of Bytes to copy, and also the amount used to adjust off, pos and remaining. she's the one pulling the strings fr fr πŸ‘‘

🧚 DESCRIPTION 🧚

Copy OpRegion to offset from that specific source ptr, and then shift the offset. that's the whole job. copy β†’ shift β†’ done. clean, simple, slay ✨


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰ (the good ending)
  • -EFAULT otherwise πŸ’€ (the not-good ending, no further comment)

πŸ‘‘ SEE ALSO πŸ‘‘

one thing and one thing only, and she's serving:

  • Kernel file ./drivers/vfio/pci/vfio_pci_igd.c πŸ“

ngl if you're messing with off, pos, or remaining after this call, remember: they've already been shifted, bestie. don't double-count. that's the whole warning, I'm just being dramatic πŸ™ˆ

and that's the page! mwah πŸ’‹ this little number lives in ./drivers/vfio/pci, dated October 2026 β€” go forth and copy responsibly, iykyk πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from