src/worker.cc
// Fill this page with its pattern.
Fill this page with its pattern.
Fill this page with its pattern .
bool WorkerThread::FillPage(struct page_entry *pe) {
  if (pe == 0) {
    logprintf(0, "Process Error: Fill Page entry null\n");
    return 0;
  }
  uint64 *memwords = static_cast<uint64*>(pe->addr);
  int length = sat_->page_length();
  if (tag_mode_) {
    for (int i = 0; i < length / wordsize_; i++) {
      datacast_t data;
      if ((i & 0x7) == 0) {
        data.l64 = addr_to_tag(&memwords[i]);
      } else {
        data.l32.l = pe->pattern->pattern(i << 1);
        data.l32.h = pe->pattern->pattern((i << 1) + 1);
      }
      memwords[i] = data.l64;
    }
  } else {
    for (int i = 0; i < length / wordsize_; i++) {
      datacast_t data;
      data.l32.l = pe->pattern->pattern(i << 1);
      data.l32.h = pe->pattern->pattern((i << 1) + 1);
      memwords[i] = data.l64;
    }
  }
  return 1;
}
bool WorkerThread :: FillPage ( struct page_entry * pe ) { if ( pe == 0 ) { logprintf ( 0 , " \n " ) ; return 0 ; } uint64 * memwords = static_cast < uint64 * > ( pe -> addr ) ; int length = sat_ -> page_length ( ) ; if ( tag_mode_ ) { for ( int i = 0 ; i < length / wordsize_ ; i ++ ) { datacast_t data ; if ( ( i & 0x7 ) == 0 ) { data . l64 = addr_to_tag ( & memwords [ i ] ) ; } else { data . l32 . l = pe -> pattern -> pattern ( i << 1 ) ; data . l32 . h = pe -> pattern -> pattern ( ( i << 1 ) + 1 ) ; } memwords [ i ] = data . l64 ; } } else { for ( int i = 0 ; i < length / wordsize_ ; i ++ ) { datacast_t data ; data . l32 . l = pe -> pattern -> pattern ( i << 1 ) ; data . l32 . h = pe -> pattern -> pattern ( ( i << 1 ) + 1 ) ; memwords [ i ] = data . l64 ; } } return 1 ; }
Fill this page with its pattern.
Fill this page with its pattern .
// Error check arguments. // Mask is the bitmask of indexes used by the pattern. // It is the pattern size -1. Size is always a power of 2. // Select tag or data as appropriate. // Just fill in untagged data directly.