map_range(9)
π map_range(9) β like, the Kernel API Manual entry, bestie β¨
Okay so real talk, this is one of those pages from the Kernel API Manual that sounds scary but honestly? It's giving "I map things, that's my whole personality." Let's get into it π«Ά
πΈ NAME πΈ
map_range β maps a contiguous range of physical pages into virtual memory. Yes bestie, physical β virtual, that's the whole vibe. No cap.
β¨ SYNOPSIS β¨
void map_range (phys_addr_t *pte , u64 start , u64 end , phys_addr_t pa
, pgprot_t prot , int level , pte_t *tbl , bool may_use_cont , u64
va_offset );
Nine arguments. Nine. She's high-maintenance and honestly? Iconic for it π
π ARGUMENTS π
pteβ Address of physical pointer to array of pages to allocate page tables from. That's where the page-table pages come from, bestie πstartβ Virtual address of the start of the range. The beginning of the era, if you will.endβ Virtual address of the end of the range, and it's exclusive β so like,endis not invited to the party, it's just the door πpaβ Physical address of the start of the range. This is the physical side of the situationship.protβ Access permissions of the range. Who gets to touch it, who doesn't. Boundaries are healthy πlevelβ Translation level for the mapping. Which floor of the page-table building we're on, iykyk.tblβ Thelevellevel page table to create the mappings in. Yes, it literally says "thelevellevel page table" β she said it twice and she meant it πmay_use_contβ Whether the use of the contiguous attribute is allowed. Basically a permission slip for contiguity, and you literally pass aboolabout it πva_offsetβ Offset between a physical page and its current mapping in the VA space. The little gap between where a page is and where it's hanging out. Math, but make it flirty β¨
π¦ SEE ALSO π¦
Kernel file ./arch/arm64/kernel/pi/map_range.cβ go read the source, bestie, it's right there and it's literally the main character of this whole page π₯
Fr fr, the important bit: end is exclusive. Do not come for me later saying I didn't warn you π
Cute lil sign-off: this absolute gem lives under ./arch/arm64/kernel/pi and the page is dated October 2026 β so yeah, technically future-dated, we don't ask questions, we just slay ππ§ββοΈβ
π¦ 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