Esempio n. 1
0
void AbstractICache::invalidate_range(address start, int nbytes) {
  static bool firstTime = true;
  if (firstTime) {
    guarantee(start == CAST_FROM_FN_PTR(address, _flush_icache_stub),
              "first flush should be for flush stub");
    firstTime = false;
    return;
  }
  if (nbytes == 0) {
    return;
  }
  // Align start address to an icache line boundary and transform
  // nbytes to an icache line count.
  const uint line_offset = mask_address_bits(start, ICache::line_size-1);
  if (line_offset != 0) {
    start -= line_offset;
    nbytes += line_offset;
  }
  call_flush_stub(start, round_to(nbytes, ICache::line_size) >>
                         ICache::log2_line_size);
}
Esempio n. 2
0
 static void ppc64_flush_icache_bytes(address start, int bytes) {
   // Align start address to an icache line boundary and transform
   // nbytes to an icache line count.
   const uint line_offset = mask_address_bits(start, line_size - 1);
   ppc64_flush_icache(start - line_offset, (bytes + line_offset + line_size - 1) >> log2_line_size, 0);
 }