sunriseos / SunriseOS

Horizon/NX kernel reimplementation
Apache License 2.0
232 stars 13 forks source link

Use svcGetInfo to get the address space in find_free_address #481

Open todo[bot] opened 5 years ago

todo[bot] commented 5 years ago

We should use svcGetInfo to get the address space in `find_free_address`. This is extremely important as the low addresses (from 0 to ADDRESS_SPACE_MIN) are not usable, but are marked as available by QueryMemory. Here's a sample implementation for when we'll have GetInfo impl'd. ```rust lazy_static! { static ref ADDRESS_SPACE: (usize, usize) = { let addr_space_base = syscalls::get_info(Process::current(), 12, 0).unwrap(); let addr_space_size = syscalls::get_info(Process::current(), 13, 0).unwrap(); (addr_space_base, addr_space_base + addr_space_size) }; } ```


https://github.com/sunriseos/SunriseOS/blob/27ab3e4f43aabfaf0a130c3f279aecc0b731a812/libuser/src/mem.rs#L25-L35


This issue was generated by todo based on a TODO comment in 27ab3e4f43aabfaf0a130c3f279aecc0b731a812 when #458 was merged. cc @roblabla.