vme_master_rmw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vme_master_rmw β€” the vme_master_rmw(9) glow-up

okay so bestie, gather round, because today we're learning about vme_master_rmw(9) from the Kernel API Manual and honestly? she's a lil baddie with a very specific job. no cap. πŸŽ€


✨ NAME ✨

vme_master_rmw β€” perform a read-modify-write cycle. that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

unsigned int vme_master_rmw (struct vme_resource *resource , unsigned
int mask , unsigned int compare , unsigned int swap , loff_t offset );

like, look at her. five arguments, one unsigned int coming back. main character energy fr fr. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • resource β€” pointer to the VME master resource. she's the one holding the keys, so pls make sure it's actually a VME master resource (more on that in RETURN, bestie 😭).
  • mask β€” the bits that get compared and swapped in this whole operation. think of it as the guest list: only these bits are even invited to the party.
  • compare β€” the bits that get compared against the data read from offset. this is the ~reference photo~ your bits have to match.
  • swap β€” the bits that get swapped in the data read from offset. this is the glow-up that actually happens.
  • offset β€” offset into the VME master window where we're doing the whole operation. yes, exactly there. no, not there. there. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the way this works is: it performs a read-modify-write cycle on the provided location. and the little four-step choreography is:

  • first, the location on the VME bus is read. ⭐
  • then, the bits selected by mask are compared with compare. vibe check on the bits.
  • then β€” and this is the iconic part β€” where a selected bit matches that in compare and those bits are selected in swap, the bit gets swapped. πŸ”₯
  • finally, the result is written back to the location on the VME bus. slay, we're done here. πŸ’–

like, it's giving read. compare. swap. write. in that order. every single time. periodt.


πŸ’œ RETURN πŸ’œ

  • Bytes written on success. we love a win. 🌈
  • -EINVAL if resource is not a VME master resource, or if the RMW operation is not supported. so like... check your resource first, bestie, or you're gonna have a bad time. πŸ™ˆ
  • Hardware specific errors may also be returned. yeah. those exist. not our department. πŸ’€

πŸ’€ SEE ALSO πŸ’€

kernel file ./drivers/staging/vme_user/vme.c β€” and yes, the whole friend group is here, say hi:


and that's the whole page, bestie πŸ’– this cutie lives under ./drivers/staging/vme_user, and the page dates to October 2026 β€” vme_master_rmw(9), forever and always. iykyk 🫢✨

πŸ“¦ where this page comes from