kernel/address_arbiter: Pass in system instance to constructor

Allows getting rid of reliance on the global accessor functions and
instead operating on the provided system instance.
This commit is contained in:
Lioncash 2019-03-05 12:28:10 -05:00
parent 9d9676f620
commit c161389a0f
6 changed files with 45 additions and 26 deletions

View file

@ -13,11 +13,11 @@
namespace ArmTests {
TestEnvironment::TestEnvironment(bool mutable_memory_)
: mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) {
: mutable_memory(mutable_memory_),
test_memory(std::make_shared<TestMemory>(this)), kernel{Core::System::GetInstance()} {
auto process = Kernel::Process::Create(kernel, "");
kernel.MakeCurrentProcess(process.get());
page_table = &Core::CurrentProcess()->VMManager().page_table;
page_table = &process->VMManager().page_table;
std::fill(page_table->pointers.begin(), page_table->pointers.end(), nullptr);
page_table->special_regions.clear();