|
The Pedigree Project
0.1
|
#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 CacheManager & | instance () |
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 |
| Thread * | m_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 () |
| Request * | getNextRequest () |
Static Protected Member Functions inherited from RequestQueue | |
| static int | trampoline (void *p) |
| static int | doAsync (void *p) |
Protected Attributes inherited from RequestQueue | |
| Request * | m_pRequestQueue [REQUEST_QUEUE_NUM_PRIORITIES] |
| volatile bool | m_Stop |
| Mutex | m_RequestQueueMutex |
| ConditionVariable | m_RequestQueueCondition |
| ConditionVariable | m_AsyncRequestQueueCondition |
| Thread * | m_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 |
|
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.
|
privatevirtual |
RequestQueue doer - children give us new jobs, and we call out to them when they hit the front of the queue.
Implements RequestQueue.
Definition at line 140 of file Cache.cc.
References List< T, nodePoolSize >::begin(), ERROR, Cache::executeRequest(), PhysicalMemoryManager::freePageCount(), VirtualAddressSpace::getKernelAddressSpace(), VirtualAddressSpace::getKernelCacheEnd(), VirtualAddressSpace::getKernelCacheStart(), Scheduler::instance(), PhysicalMemoryManager::instance(), BusMasterIde::m_bActive, Process::m_Lock, UNLIKELY, and Scheduler::yield().
|
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.
|
virtual |
Called when the handler is registered with the Timer/SchedulerTimer class and a timer event occured
| [in] | delta | time elapsed since the last event, in nanoseconds |
| [in,out] | state | the 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().
1.8.11