|
The Pedigree Project 0.1
|
#include <ExtensibleBitmap.h>
Collaboration diagram for ExtensibleBitmap:Public Member Functions | |
| ExtensibleBitmap () | |
| ExtensibleBitmap (const ExtensibleBitmap &other) | |
| ~ExtensibleBitmap () | |
| ExtensibleBitmap & | operator= (const ExtensibleBitmap &other) |
| void | set (size_t n) |
| void | clear (size_t n) |
| bool | test (size_t n) const |
| size_t | getFirstSet () const |
| size_t | getFirstClear () |
| size_t | getLastSet () const |
| size_t | getLastClear () const |
Private Attributes | |
| uintptr_t | m_StaticMap |
| uint8_t * | m_pDynamicMap |
| size_t | m_DynamicMapSize |
| size_t | m_nMaxBit |
| size_t | m_nFirstSetBit |
| size_t | m_nFirstClearBit |
| size_t | m_nLastSetBit |
| size_t | m_nLastClearBit |
Friends | |
| class | CacheMemoryTestPeer |
Defines an "extensible bitmap" - a bitmap that can extend to accommodate any value.
It does not currently deal well with a sparse domain - one bit set at 0x1 and another at 0x100000 will generate a bitmap with 0x100000/0x8 bytes usage.
Definition at line 32 of file ExtensibleBitmap.h.
| ExtensibleBitmap::ExtensibleBitmap | ( | ) |
Creates a new, empty bitmap.
Definition at line 23 of file ExtensibleBitmap.cc.
| ExtensibleBitmap::ExtensibleBitmap | ( | const ExtensibleBitmap & | other | ) |
Creates a new bitmap identical to that given.
Definition at line 33 of file ExtensibleBitmap.cc.
References m_DynamicMapSize, and m_pDynamicMap.
| ExtensibleBitmap::~ExtensibleBitmap | ( | ) |
| void ExtensibleBitmap::clear | ( | size_t | n | ) |
Clears the bit in the bitmap indexed by n.
Definition at line 131 of file ExtensibleBitmap.cc.
References m_nFirstSetBit, m_nMaxBit, m_pDynamicMap, m_StaticMap, and test().
Referenced by Ohci::addTransferToTransaction(), Uhci::addTransferToTransaction(), PosixSubsystem::closeFileDescriptor(), MemoryPool::free(), PosixSubsystem::freeFd(), PosixSubsystem::freeMultipleFds(), Thread::inhibitEvent(), Uhci::reclaimQueueHeadLocked(), Ohci::reclaimTransferDescriptors(), and Ohci::retireEDStorage().
Here is the caller graph for this function:
|
inline |
Returns the index of the first clear bit.
Definition at line 60 of file ExtensibleBitmap.h.
Referenced by Ohci::addTransferToTransaction(), Uhci::addTransferToTransaction(), MemoryPool::allocateDoer(), Ohci::createTransaction(), Uhci::createTransaction(), and PtmxFile::open().
Here is the caller graph for this function:
|
inline |
Returns the index of the first set bit.
Definition at line 56 of file ExtensibleBitmap.h.
|
inline |
Returns the index of the last clear bit.
Definition at line 71 of file ExtensibleBitmap.h.
|
inline |
Returns the index of the last set bit.
Definition at line 67 of file ExtensibleBitmap.h.
| ExtensibleBitmap & ExtensibleBitmap::operator= | ( | const ExtensibleBitmap & | other | ) |
Makes this bitmap mirror the one given.
Definition at line 46 of file ExtensibleBitmap.cc.
References m_DynamicMapSize, m_nFirstSetBit, m_nMaxBit, m_pDynamicMap, and m_StaticMap.
| void ExtensibleBitmap::set | ( | size_t | n | ) |
Sets the bit in the bitmap indexed by n.
Definition at line 74 of file ExtensibleBitmap.cc.
References m_DynamicMapSize, m_nFirstSetBit, m_nMaxBit, m_pDynamicMap, m_StaticMap, and test().
Referenced by PosixSubsystem::addFileDescriptor(), Ohci::addTransferToTransaction(), Uhci::addTransferToTransaction(), MemoryPool::allocateDoer(), PosixSubsystem::allocateFd(), PosixSubsystem::copyDescriptors(), Ohci::createTransaction(), Uhci::createTransaction(), PosixSubsystem::duplicateFileDescriptor(), PosixSubsystem::getFd(), Thread::inhibitEvent(), PosixSubsystem::installFileDescriptor(), and PtmxFile::open().
Here is the caller graph for this function:| bool ExtensibleBitmap::test | ( | size_t | n | ) | const |
Returns the bit in the bitmap indexed by n.
Definition at line 178 of file ExtensibleBitmap.cc.
References m_nMaxBit, m_pDynamicMap, and m_StaticMap.
Referenced by Ehci::addInterruptInHandler(), Uhci::addInterruptInHandler(), Ohci::addTransferToTransaction(), Uhci::addTransferToTransaction(), Ehci::cancelAsyncAndDrain(), Ohci::cancelAsyncAndDrain(), Uhci::cancelAsyncAndDrain(), Ehci::cancelInterruptInAndDrain(), Uhci::cancelInterruptInAndDrain(), clear(), Ehci::doAsync(), Ohci::doAsync(), PosixSubsystem::duplicateFileDescriptor(), MemoryPool::free(), PosixSubsystem::getFd(), PosixSubsystem::installFileDescriptor(), set(), and MemoryPool::trim().
Here is the caller graph for this function:
|
friend |
Definition at line 33 of file ExtensibleBitmap.h.
|
private |
Amount of memory the dynamic map occupies.
Definition at line 84 of file ExtensibleBitmap.h.
Referenced by ExtensibleBitmap(), operator=(), and set().
|
private |
Definition at line 91 of file ExtensibleBitmap.h.
|
private |
First/last bit set/clear indexes.
Definition at line 90 of file ExtensibleBitmap.h.
Referenced by clear(), operator=(), and set().
|
private |
Definition at line 93 of file ExtensibleBitmap.h.
|
private |
Definition at line 92 of file ExtensibleBitmap.h.
|
private |
Largest stored bit in the dynamic map.
Definition at line 87 of file ExtensibleBitmap.h.
Referenced by clear(), operator=(), set(), and test().
|
private |
The dynamic map, to accommodate bit numbers > {31,63}
Definition at line 81 of file ExtensibleBitmap.h.
Referenced by clear(), ExtensibleBitmap(), operator=(), set(), test(), and ~ExtensibleBitmap().
|
private |
Performance hint - one statically allocated word. Means we can index data from 0..{31,63} without dynamically allocating anything.
Definition at line 78 of file ExtensibleBitmap.h.
Referenced by clear(), operator=(), set(), and test().