The Pedigree Project
0.1
|
#include <VsidManager.h>
Classes | |
struct | VsidStack |
Public Types | |
typedef uint32_t | Vsid |
Public Member Functions | |
Vsid | obtainVsid () |
void | returnVsid (Vsid vsid) |
Static Public Member Functions | |
static VsidManager & | instance () |
Private Member Functions | |
VsidManager (const VsidManager &) | |
VsidManager & | operator= (const VsidManager &) |
VsidManager () | |
~VsidManager () | |
Private Attributes | |
Vsid | m_HighWaterMark |
VsidStack * | m_pStack |
Mutex | m_Mutex |
Static Private Attributes | |
static VsidManager | m_Instance |
PPC has too many possible VSID's to do the same thing as MIPS' ASIDs, so we have to box a little more cleverly.
We have a pointer marking the 'high water mark' of the VSID's already allocated. We also have a stack of VSIDs - when a VSID is released it is pushed onto this stack to be reallocated. If the VSID released == the high water mark, we don't push it and just decrement the high water mark instead.
When a VSID is required, we try and pop one off the stack first. If the stack is empty, we increment the high water mark and return that.
Definition at line 41 of file VsidManager.h.
typedef uint32_t VsidManager::Vsid |
VSID typedef
Definition at line 45 of file VsidManager.h.
|
private |
Default constructor
Definition at line 30 of file VsidManager.cc.
|
private |
Destructor - not implemented.
Definition at line 34 of file VsidManager.cc.
|
static |
Gets the instance of the VsidManager
Definition at line 25 of file VsidManager.cc.
References m_Instance.
Referenced by PPC32VirtualAddressSpace::PPC32VirtualAddressSpace(), and PPC32VirtualAddressSpace::~PPC32VirtualAddressSpace().
VsidManager::Vsid VsidManager::obtainVsid | ( | ) |
Returns an VSID. The TLB is flushed of all references to that ASID.
Definition at line 38 of file VsidManager.cc.
References m_HighWaterMark, m_pStack, and NOTICE.
Referenced by PPC32VirtualAddressSpace::PPC32VirtualAddressSpace().
void VsidManager::returnVsid | ( | VsidManager::Vsid | vsid | ) |
Takes an VSID. The given VSID is returned to the pool of usable VSIDs.
Definition at line 58 of file VsidManager.cc.
Referenced by PPC32VirtualAddressSpace::~PPC32VirtualAddressSpace().
|
private |
|
staticprivate |
The static VsidManager instance - singleton class.
Definition at line 81 of file VsidManager.h.
Referenced by instance().
|
private |
Our lock, to protect the integrity of our data.
Definition at line 78 of file VsidManager.h.
|
private |