devm_memremap_pages(9)
π 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 astruct 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 π
- Minimum effort is not it here, bestie β the caller has to initialize the
rangeandtypemembers ofpgmapbefore passing it to this function. Like, before. Not later. π - The
altmapfield is optional, you may initialize it β but if you do,PGMAP_ALTMAP_VALIDmust be set inpgmap->flags. It's giving package deal. π - The
reffield is also optional, in whichpgmap->refmust 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 π) rangeis 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
- Kernel file
./mm/memremap.c get_dev_pagemap(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms