pcie_capabil...and_set_word(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pcie_capability_clear_and_set_word β€” from the Kernel API Manual ✨

okay so bestie, we're in the Kernel API Manual today and the star of the show is pcie_capability_clear_and_set_word(9). yes it's a long name. yes it's worth it. sit down, hydrate, let's go 🫢


🌸 NAME 🌸

pcie_capability_clear_and_set_word β€” the RMW accessor for PCI Express Capability Registers, and honestly? she's iconic. πŸ’…


✨ SYNOPSIS ✨

int pcie_capability_clear_and_set_word (struct pci_dev *dev , int pos ,
u16 clear , u16 set );

that's the whole vibe. four args, one int coming back at you. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the PCI device structure of your PCI Express device. like, the actual device you're doing stuff to. main character energy fr. πŸ‘‘
  • pos β€” the PCI Express Capability Register. which register we're messing with. πŸ“
  • clear β€” the Clear bitmask. bits in here get yeeted to 0. πŸ”₯
  • set β€” the Set bitmask. bits in here get boosted up to 1. ⭐

πŸ’œ DESCRIPTION πŸ’œ

so what actually happens? this function does a Read-Modify-Write (that's RMW, iykyk) operation on the PCI Express Capability Register sitting at pos, using the clear and set bitmasks to figure out which bits flip which way. 🧚

and here's the part where it gets good: certain PCI Express Capability Registers get accessed concurrently in RMW fashion, so they genuinely need locking. and this function? handles all that locking for you. transparently. to the caller. you don't have to think about it, bestie. you just call, and it slays on your behalf. 😭🫢


🌈 SEE ALSO 🌈

the whole extended friend group, no cap β€” all from the Kernel file ./include/linux/pci.h:


πŸ’€ reminder bestie: this lives in ./include/linux, dated October 2026, and it's page pcie_capabil...and_set_word(9) of the Kernel API Manual. go read the source, it's giving scholarly. πŸ“šβœ¨

k bye, love u, happy hacking πŸŽ€πŸ’–πŸ“

πŸ“¦ where this page comes from