Address.hh (7039:bc0b6ea676b5) | Address.hh (7054:7d6862b80049) |
---|---|
1/* 2 * Copyright (c) 1999 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; --- 157 unchanged lines hidden (view full) --- 166} 167 168// removes bits inclusive 169inline physical_address_t 170Address::bitRemove(int small, int big) const 171{ 172 physical_address_t mask; 173 assert((unsigned)big >= (unsigned)small); | 1/* 2 * Copyright (c) 1999 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; --- 157 unchanged lines hidden (view full) --- 166} 167 168// removes bits inclusive 169inline physical_address_t 170Address::bitRemove(int small, int big) const 171{ 172 physical_address_t mask; 173 assert((unsigned)big >= (unsigned)small); |
174 | 174 |
175 if (small >= ADDRESS_WIDTH - 1) { 176 return m_address; 177 } else if (big >= ADDRESS_WIDTH - 1) { 178 mask = (physical_address_t)~0 >> small; 179 return (m_address & mask); 180 } else if (small == 0) { 181 mask = (physical_address_t)~0 << big; 182 return (m_address & mask); --- 40 unchanged lines hidden (view full) --- 223{ 224 return (m_address >> number); 225} 226 227inline integer_t 228Address::memoryModuleIndex() const 229{ 230 integer_t index = | 175 if (small >= ADDRESS_WIDTH - 1) { 176 return m_address; 177 } else if (big >= ADDRESS_WIDTH - 1) { 178 mask = (physical_address_t)~0 >> small; 179 return (m_address & mask); 180 } else if (small == 0) { 181 mask = (physical_address_t)~0 << big; 182 return (m_address & mask); --- 40 unchanged lines hidden (view full) --- 223{ 224 return (m_address >> number); 225} 226 227inline integer_t 228Address::memoryModuleIndex() const 229{ 230 integer_t index = |
231 bitSelect(RubySystem::getBlockSizeBits() + | 231 bitSelect(RubySystem::getBlockSizeBits() + |
232 RubySystem::getMemorySizeBits(), ADDRESS_WIDTH); 233 assert (index >= 0); 234 return index; 235 236 // Index indexHighPortion = 237 // address.bitSelect(MEMORY_SIZE_BITS - 1, 238 // PAGE_SIZE_BITS + NUMBER_OF_MEMORY_MODULE_BITS); 239 // Index indexLowPortion = --- 54 unchanged lines hidden --- | 232 RubySystem::getMemorySizeBits(), ADDRESS_WIDTH); 233 assert (index >= 0); 234 return index; 235 236 // Index indexHighPortion = 237 // address.bitSelect(MEMORY_SIZE_BITS - 1, 238 // PAGE_SIZE_BITS + NUMBER_OF_MEMORY_MODULE_BITS); 239 // Index indexLowPortion = --- 54 unchanged lines hidden --- |