/* Given a virtual address retrieve the original memory region that the mapping is belonging to.  */
static struct region_map* get_region_map(void *v_addr)
/* Given a virtual address retrieve the original memory region that the mapping is belonging to.  */
static struct region_map* get_region_map(void *v_addr)
{
	for (size_t reg = 0; reg < ARRAY_SIZE(map); reg++) {
		if ((uintptr_t) v_addr >= map[reg].region.addr &&
		    (uintptr_t) v_addr < map[reg].region.addr + map[reg].region.size) {
			return &map[reg];
		}
	}
	return NULL;
}