Deleted Added
sdiff udiff text old ( 7002:48a19d52d939 ) new ( 7027:46b02e79bf2c )
full compact
1
2/*
3 * Copyright (c) 1999 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 52 unchanged lines hidden (view full) ---

61 // ~Address();
62
63 // Public Methods
64
65 void setAddress(physical_address_t address) { m_address = address; }
66 physical_address_t getAddress() const {return m_address;}
67 // selects bits inclusive
68 physical_address_t bitSelect(int small, int big) const;
69 physical_address_t maskLowOrderBits(int number) const;
70 physical_address_t maskHighOrderBits(int number) const;
71 physical_address_t shiftLowOrderBits(int number) const;
72 physical_address_t getLineAddress() const
73 { return bitSelect(RubySystem::getBlockSizeBits(), ADDRESS_WIDTH); }
74 physical_address_t getOffset() const
75 { return bitSelect(0, RubySystem::getBlockSizeBits()-1); }
76

--- 80 unchanged lines hidden (view full) ---

157 } else {
158 mask = ~((physical_address_t)~0 << (big + 1));
159 // FIXME - this is slow to manipulate a 64-bit number using 32-bits
160 physical_address_t partial = (m_address & mask);
161 return (partial >> small);
162 }
163}
164
165inline
166physical_address_t Address::maskLowOrderBits(int number) const
167{
168 physical_address_t mask;
169
170 if (number >= ADDRESS_WIDTH - 1) {
171 mask = ~0;
172 } else {
173 mask = (physical_address_t)~0 << number;

--- 74 unchanged lines hidden ---