X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/00e79d1291f14583564ed0eba2d5e56ee30bf7d3..50753d5f8442a47c17c4035724201a18a7ff6146:/src/mc/sosp/Region.cpp diff --git a/src/mc/sosp/Region.cpp b/src/mc/sosp/Region.cpp index bb98737b73..2dca797e71 100644 --- a/src/mc/sosp/Region.cpp +++ b/src/mc/sosp/Region.cpp @@ -4,10 +4,9 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/mc/sosp/Region.hpp" -#include "src/mc/ModelChecker.hpp" #include "src/mc/mc_config.hpp" #include "src/mc/mc_forward.hpp" -#include "src/mc/remote/RemoteProcess.hpp" +#include "src/mc/sosp/RemoteProcessMemory.hpp" #include #include @@ -17,20 +16,20 @@ namespace simgrid::mc { -Region::Region(PageStore& store, RegionType region_type, void* start_addr, size_t size) +Region::Region(PageStore& store, const RemoteProcessMemory& memory, RegionType region_type, void* start_addr, + size_t size) : region_type_(region_type), start_addr_(start_addr), size_(size) { xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Start address not at the beginning of a page"); - chunks_ = - ChunkedData(store, mc_model_checker->get_remote_process(), RemotePtr(start_addr), mmu::chunk_count(size)); + chunks_ = ChunkedData(store, memory, RemotePtr(start_addr), mmu::chunk_count(size)); } /** @brief Restore a region from a snapshot * * @param region Target region */ -void Region::restore() const +void Region::restore(const RemoteProcessMemory& memory) const { xbt_assert(((start().address()) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page"); xbt_assert(simgrid::mc::mmu::chunk_count(size()) == get_chunks().page_count()); @@ -38,7 +37,7 @@ void Region::restore() const for (size_t i = 0; i != get_chunks().page_count(); ++i) { auto* target_page = (void*)simgrid::mc::mmu::join(i, (std::uintptr_t)(void*)start().address()); const void* source_page = get_chunks().page(i); - mc_model_checker->get_remote_process().write_bytes(source_page, xbt_pagesize, remote(target_page)); + memory.write_bytes(source_page, xbt_pagesize, remote(target_page)); } }