The Pedigree Project  0.1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CacheManager Class Reference

#include <Cache.h>

+ Inheritance diagram for CacheManager:
+ Collaboration diagram for CacheManager:

Public Member Functions

void initialise ()
 
void registerCache (Cache *pCache)
 
void unregisterCache (Cache *pCache)
 
bool trimAll (size_t count=1)
 
virtual void timer (uint64_t delta, InterruptState &state)
 
void trimThread ()
 
- Public Member Functions inherited from RequestQueue
 RequestQueue (const String &name)
 
virtual void destroy ()
 
MUST_USE_RESULT uint64_t addRequest (size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0)
 
MUST_USE_RESULT uint64_t addRequest (size_t priority, ActionOnDuplicate action, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0)
 
uint64_t addAsyncRequest (size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0)
 
void halt ()
 
void resume ()
 

Static Public Member Functions

static CacheManagerinstance ()
 

Private Member Functions

virtual uint64_t executeRequest (uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5, uint64_t p6, uint64_t p7, uint64_t p8)
 
virtual bool compareRequests (const Request &a, const Request &b)
 

Private Attributes

List< Cache * > m_Caches
 
Threadm_pTrimThread
 
bool m_bActive
 

Static Private Attributes

static CacheManager m_Instance
 

Additional Inherited Members

- Public Types inherited from RequestQueue
enum  ActionOnDuplicate { Block, NewRequest, ReturnImmediately }
 
- Protected Member Functions inherited from RequestQueue
 RequestQueue (const RequestQueue &)
 
void operator= (const RequestQueue &)
 
bool isRequestValid (const Request *r)
 
int work ()
 
RequestgetNextRequest ()
 
- Static Protected Member Functions inherited from RequestQueue
static int trampoline (void *p)
 
static int doAsync (void *p)
 
- Protected Attributes inherited from RequestQueue
Requestm_pRequestQueue [REQUEST_QUEUE_NUM_PRIORITIES]
 
volatile bool m_Stop
 
Mutex m_RequestQueueMutex
 
ConditionVariable m_RequestQueueCondition
 
ConditionVariable m_AsyncRequestQueueCondition
 
Threadm_pThread
 
bool m_Halted
 
Mutex m_HaltAcknowledged
 
RequestQueueOverrunChecker m_OverrunChecker
 
size_t m_nMaxAsyncRequests
 
size_t m_nAsyncRequests
 
size_t m_nTotalRequests
 
String m_Name
 

Detailed Description

Provides a clean abstraction to a set of data caches.

Definition at line 55 of file Cache.h.

Member Function Documentation

virtual bool CacheManager::compareRequests ( const Request a,
const Request b 
)
inlineprivatevirtual

Used to ensure we only ever fire a WriteBack for the same page once - that is, we don't constantly write back the same page over and over while it's still queued.

Reimplemented from RequestQueue.

Definition at line 100 of file Cache.h.

uint64_t CacheManager::executeRequest ( uint64_t  p1,
uint64_t  p2,
uint64_t  p3,
uint64_t  p4,
uint64_t  p5,
uint64_t  p6,
uint64_t  p7,
uint64_t  p8 
)
privatevirtual
void CacheManager::initialise ( )
virtual

Initialises the queue, spawning the worker thread.

Reimplemented from RequestQueue.

Definition at line 78 of file Cache.cc.

References List< T, nodePoolSize >::begin(), Machine::getTimer(), Processor::information(), RequestQueue::initialise(), and BusMasterIde::m_bActive.

void CacheManager::timer ( uint64_t  delta,
InterruptState &  state 
)
virtual

Called when the handler is registered with the Timer/SchedulerTimer class and a timer event occured

Parameters
[in]deltatime elapsed since the last event, in nanoseconds
[in,out]statethe state of the processor when the event occurred.

Implements TimerHandler.

Definition at line 131 of file Cache.cc.

References List< T, nodePoolSize >::begin().

bool CacheManager::trimAll ( size_t  count = 1)

Trim each cache we know about until 'count' pages have been evicted.

Definition at line 117 of file Cache.cc.

References List< T, nodePoolSize >::begin().


The documentation for this class was generated from the following files: