1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 43 unchanged lines hidden (view full) --- 52 53void 54DirectoryMemory::init() 55{ 56 m_num_entries = m_size_bytes / RubySystem::getBlockSizeBytes(); 57 m_entries = new AbstractEntry*[m_num_entries]; 58 for (int i = 0; i < m_num_entries; i++) 59 m_entries[i] = NULL; |
60 61 m_num_directories++; 62 m_num_directories_bits = ceilLog2(m_num_directories); 63 m_total_size_bytes += m_size_bytes; 64 65 if (m_numa_high_bit == 0) { 66 m_numa_high_bit = RubySystem::getMemorySizeBits() - 1; 67 } --- 58 unchanged lines hidden (view full) --- 126DirectoryMemory::allocate(const PhysAddress& address, AbstractEntry* entry) 127{ 128 assert(isPresent(address)); 129 uint64 idx; 130 DPRINTF(RubyCache, "Looking up address: %s\n", address); 131 132 idx = mapAddressToLocalIdx(address); 133 assert(idx < m_num_entries); |
134 entry->changePermission(AccessPermission_Read_Only); 135 m_entries[idx] = entry; 136 137 return entry; 138} 139 140void 141DirectoryMemory::print(ostream& out) const --- 14 unchanged lines hidden --- |