region_intersects(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… region_intersects ✨

okay so this is the Kernel API Manual page for region_intersects and honestly it's a whole vibe β€” it's the little function that asks "hey, does this chunk of memory overlap something important?" and it does it FAST. let's get into it 🫢


🌸 NAME 🌸

region_intersects β€” bestie, it literally figures out the intersection of a region with the known resources. that's the whole job. no cap πŸ’…


✨ SYNOPSIS ✨

int region_intersects (resource_size_t start , size_t size , unsigned
       long flags , unsigned long desc );

like, it takes four things and gives you back an int. periodt.


πŸŽ€ ARGUMENTS πŸŽ€

  • start β€” the region start address πŸ’– where the whole thing begins, fr fr
  • size β€” size of region. yes bestie, how big it is 🌸
  • flags β€” flags of resource (in iomem_resource) ⭐ these are the vibes you're matching against
  • desc β€” descriptor of resource (in iomem_resource) or IORES_DESC_NONE. the IORES_DESC_NONE option is the "I don't care, match anything" energy πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜• β€” it checks whether the specified region partially overlaps or fully eclipses a resource identified by flags and desc (and desc is optional, with IORES_DESC_NONE).

and then it returns one of these three icons:

  • returns REGION_DISJOINT if the region does not overlap flags/desc πŸ’€ like, nothing in common, they don't know each other
  • returns REGION_MIXED if the region overlaps flags/desc and another resource 🌈 it's complicated, it's seeing other resources
  • returns REGION_INTERSECTS if the region overlaps flags/desc and no other defined resource πŸ‘‘
⚠️ lowkey important caveat: REGION_INTERSECTS is also returned in the case when the specified region overlaps RAM and undefined memory holes. so don't come for this function when it says INTERSECTS about your RAM + holes situation β€” that's by design bestie 🫢

aaaand the main character detail: region_intersect is used by memory remapping functions to make sure the user is not remapping RAM, and it's a vast speed up over walking through the resource table page by page. like, it ATE and left no crumbs πŸ”₯ no more page-by-page suffering, we love efficiency πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

so many siblings, it's giving huge family group chat 😭 all these icons live in the kernel file ./kernel/resource.c:

go read those too, iykyk πŸ’…


mwah πŸ’‹ this page lives in ./kernel, dated October 2026 β€” stay hydrated, don't remap RAM, and slay your resource checks bestie 🧚✨

πŸ“¦ where this page comes from