src/worker.cc
// Set a region of memory or MMIO to be tested.
// Return false if region could not be mapped.
Set a region of memory or MMIO to be tested.
Return false if region could not be mapped.
Set a region of memory or MMIO to be tested . Return false if region could not be mapped .
bool MemoryRegionThread::SetRegion(void *region, int64 size) {
  int plength = sat_->page_length();
  int npages = size / plength;
  if (size % plength) {
    logprintf(0, "Process Error: region size is not a multiple of SAT "
              "page length\n");
    return false;
  } else {
    if (pages_ != NULL)
      delete pages_;
    pages_ = new PageEntryQueue(npages);
    char *base_addr = reinterpret_cast<char*>(region);
    region_ = base_addr;
    for (int i = 0; i < npages; i++) {
      struct page_entry pe;
      init_pe(&pe);
      pe.addr = reinterpret_cast<void*>(base_addr + i * plength);
      pe.offset = i * plength;
      pages_->Push(&pe);
    }
    return true;
  }
}
bool MemoryRegionThread :: SetRegion ( void * region , int64 size ) { int plength = sat_ -> page_length ( ) ; int npages = size / plength ; if ( size % plength ) { logprintf ( 0 , " " " \n " ) ; return false ; } else { if ( pages_ != NULL ) delete pages_ ; pages_ = new PageEntryQueue ( npages ) ; char * base_addr = reinterpret_cast < char * > ( region ) ; region_ = base_addr ; for ( int i = 0 ; i < npages ; i ++ ) { struct page_entry pe ; init_pe ( & pe ) ; pe . addr = reinterpret_cast < void * > ( base_addr + i * plength ) ; pe . offset = i * plength ; pages_ -> Push ( & pe ) ; } return true ; } }
Set a region of memory or MMIO to be tested.
Set a region of memory or MMIO to be tested .