src/worker.cc
// Invert a block of memory quickly, traversing downwards.
Invert a block of memory quickly, traversing downwards.
Invert a block of memory quickly traversing downwards .
int InvertThread::InvertPageDown(struct page_entry *srcpe) {
  const int blocksize = 4096;
  const int blockwords = blocksize / wordsize_;
  int blocks = sat_->page_length() / blocksize;
  unsigned int *sourcemembase = static_cast<unsigned int *>(srcpe->addr);
  for (int currentblock = blocks-1; currentblock >= 0; currentblock--) {
    unsigned int *sourcemem = sourcemembase + currentblock * blockwords;
    for (int i = blockwords - 32; i >= 0; i -= 32) {
      for (int index = i + 31; index >= i; --index) {
        unsigned int actual = sourcemem[index];
        sourcemem[index] = ~actual;
      }
      OsLayer::FastFlush(&sourcemem[i]);
    }
  }
  return 0;
}
int InvertThread :: InvertPageDown ( struct page_entry * srcpe ) { const int blocksize = 4096 ; const int blockwords = blocksize / wordsize_ ; int blocks = sat_ -> page_length ( ) / blocksize ; unsigned int * sourcemembase = static_cast < unsigned int * > ( srcpe -> addr ) ; for ( int currentblock = blocks - 1 ; currentblock >= 0 ; currentblock -- ) { unsigned int * sourcemem = sourcemembase + currentblock * blockwords ; for ( int i = blockwords - 32 ; i >= 0 ; i -= 32 ) { for ( int index = i + 31 ; index >= i ; -- index ) { unsigned int actual = sourcemem [ index ] ; sourcemem [ index ] = ~ actual ; } OsLayer :: FastFlush ( & sourcemem [ i ] ) ; } } return 0 ; }
Invert a block of memory quickly, traversing downwards.
Invert a block of memory quickly traversing downwards .
// Base addresses for memory copy