devm_memremap_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

devm_memremap_pages β€” bestie, this one remaps stuff and hooks you up with memmap backing for the given resource ✨

(also hi, welcome to the Kernel API Manual πŸŽ€)


✨ SYNOPSIS ✨

void * devm_memremap_pages (struct device *dev , struct dev_pagemap *pgmap );

🫢 ARGUMENTS

  • dev β€” the hosting device for res, no cap πŸ¦‹
  • pgmap β€” a pointer to a struct dev_pagemap, that's literally the whole vibe

πŸ”₯ NOTES πŸ”₯

Okay so there are like four things you absolutely have to know before you go in, and I'm gonna say them in order because that's just how I am πŸ’…

  1. Minimum effort is not it here, bestie β€” the caller has to initialize the range and type members of pgmap before passing it to this function. Like, before. Not later. 😭
  2. The altmap field is optional, you may initialize it β€” but if you do, PGMAP_ALTMAP_VALID must be set in pgmap->flags. It's giving package deal. πŸŽ€
  3. The ref field is also optional, in which pgmap->ref must be devm_memremap_pages_release time, or if this routine fails. (that's exactly how the manual says it, I'm not editing the queen's words πŸ‘‘)
  4. range is expected to be a host memory range that could feasibly be treated as a "System RAM" range β€” i.e. not a device mmio range. But real talk: this is not enforced. So like… no one's gonna stop you, but also, choices. πŸ’€

🌈 SEE ALSO


okay that's the whole page, mwah 🫢 this little gem lives in ./mm, it's dated October 2026, and it's filed under devm_memremap_pages(9) in the Kernel API Manual β€” go forth and remap responsibly βœ¨πŸ’–

πŸ“¦ where this page comes from