return it->second->store(addr - -it->first, len, bytes);
}
-char* bus_t::page(reg_t paddr)
+bus_t::descriptor bus_t::find_device(reg_t addr)
{
- auto it = devices.lower_bound(-paddr);
- if (it == devices.end())
- return NULL;
- return it->second->page(paddr);
+ auto it = devices.lower_bound(-addr);
+ if (it == devices.end()) {
+ bus_t::descriptor desc = {0, 0};
+ return desc;
+ }
+ bus_t::descriptor desc = {-it->first, it->second};
+ return desc;
}