Use g_fxo for page_fault_event_entries

This commit is contained in:
Nekotekina 2019-08-21 20:30:58 +03:00
parent 606601441d
commit a85a8796d3
3 changed files with 4 additions and 4 deletions

View File

@ -1346,7 +1346,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
// Now, place the page fault event onto table so that other functions [sys_mmapper_free_address and pagefault recovery funcs etc] // Now, place the page fault event onto table so that other functions [sys_mmapper_free_address and pagefault recovery funcs etc]
// know that this thread is page faulted and where. // know that this thread is page faulted and where.
auto pf_events = fxm::get_always<page_fault_event_entries>(); auto pf_events = g_fxo->get<page_fault_event_entries>();
{ {
std::lock_guard pf_lock(pf_events->pf_mutex); std::lock_guard pf_lock(pf_events->pf_mutex);
pf_events->events.emplace(static_cast<u32>(data2), addr); pf_events->events.emplace(static_cast<u32>(data2), addr);

View File

@ -210,7 +210,7 @@ error_code sys_mmapper_free_address(ppu_thread& ppu, u32 addr)
} }
// If page fault notify exists and an address in this area is faulted, we can't free the memory. // If page fault notify exists and an address in this area is faulted, we can't free the memory.
auto pf_events = fxm::get_always<page_fault_event_entries>(); auto pf_events = g_fxo->get<page_fault_event_entries>();
std::lock_guard pf_lock(pf_events->pf_mutex); std::lock_guard pf_lock(pf_events->pf_mutex);
for (const auto& ev : pf_events->events) for (const auto& ev : pf_events->events)
@ -489,7 +489,7 @@ error_code sys_mmapper_enable_page_fault_notification(ppu_thread& ppu, u32 start
error_code mmapper_thread_recover_page_fault(u32 id) error_code mmapper_thread_recover_page_fault(u32 id)
{ {
// We can only wake a thread if it is being suspended for a page fault. // We can only wake a thread if it is being suspended for a page fault.
auto pf_events = fxm::get_always<page_fault_event_entries>(); auto pf_events = g_fxo->get<page_fault_event_entries>();
{ {
std::lock_guard pf_lock(pf_events->pf_mutex); std::lock_guard pf_lock(pf_events->pf_mutex);
auto pf_event_ind = pf_events->events.find(id); auto pf_event_ind = pf_events->events.find(id);

View File

@ -452,7 +452,7 @@ error_code sys_ppu_thread_get_page_fault_context(u32 thread_id, vm::ptr<sys_ppu_
} }
// We can only get a context if the thread is being suspended for a page fault. // We can only get a context if the thread is being suspended for a page fault.
auto pf_events = fxm::get_always<page_fault_event_entries>(); auto pf_events = g_fxo->get<page_fault_event_entries>();
std::shared_lock lock(pf_events->pf_mutex); std::shared_lock lock(pf_events->pf_mutex);
const auto evt = pf_events->events.find(thread_id); const auto evt = pf_events->events.find(thread_id);