FreeNOS
Public Types | Public Member Functions
Cache Class Referenceabstract

Cache management interface. More...

#include <Cache.h>

Inheritance diagram for Cache:
ARMCacheV6 ARMCacheV7 IntelCache

Public Types

enum  Result { Success, InvalidArgument, IOError, NotSupported }
 Result codes. More...
 
enum  Type { Instruction, Data, Unified }
 Cache types. More...
 

Public Member Functions

virtual Result invalidate (Type type)=0
 Invalidate the entire cache. More...
 
virtual Result cleanInvalidate (Type type)=0
 Clean and invalidate entire cache. More...
 
virtual Result cleanInvalidateAddress (Type type, Address addr)=0
 Clean and invalidate one memory page. More...
 
virtual Result cleanAddress (Type type, Address addr)=0
 Clean one memory page. More...
 
virtual Result invalidateAddress (Type type, Address addr)=0
 Invalidate one memory page. More...
 
virtual Result cleanData (Address addr)
 Clean one data page. More...
 
virtual Result cleanData (void *ptr)
 Clean one data page. More...
 

Detailed Description

Cache management interface.

Definition at line 35 of file Cache.h.

Member Enumeration Documentation

◆ Result

Result codes.

Enumerator
Success 
InvalidArgument 
IOError 
NotSupported 

Definition at line 42 of file Cache.h.

◆ Type

Cache types.

Enumerator
Instruction 
Data 
Unified 

Definition at line 53 of file Cache.h.

Member Function Documentation

◆ cleanAddress()

virtual Result Cache::cleanAddress ( Type  type,
Address  addr 
)
pure virtual

Clean one memory page.

Parameters
typeCache type to clean
addrVirtual memory address of the page to clean and invalidate
Returns
Result code

Implemented in ARMCacheV7, ARMCacheV6, and IntelCache.

Referenced by cleanData().

◆ cleanData() [1/2]

Cache::Result Cache::cleanData ( Address  addr)
virtual

Clean one data page.

Parameters
addrVirtual memory address to clean
Returns
Result code

Definition at line 20 of file Cache.cpp.

References cleanAddress(), and Data.

Referenced by ProcessShares::createShare(), MemoryChannel::flushPage(), Process::initialize(), ARMSecondTable::map(), ARMFirstTable::map(), ARMFirstTable::mapLarge(), ARMSecondTable::unmap(), ARMFirstTable::unmap(), and VMCtlHandler().

◆ cleanData() [2/2]

Cache::Result Cache::cleanData ( void *  ptr)
virtual

Clean one data page.

Parameters
ptrPointer with a virtual memory address to clean
Returns
Result code

Definition at line 25 of file Cache.cpp.

References cleanAddress(), and Data.

◆ cleanInvalidate()

virtual Result Cache::cleanInvalidate ( Type  type)
pure virtual

Clean and invalidate entire cache.

This operation will clean and invalidate the entire given cache.

Parameters
typeCache type to clean and invalidate.
Returns
Result code

Implemented in ARMCacheV7, ARMCacheV6, and IntelCache.

◆ cleanInvalidateAddress()

virtual Result Cache::cleanInvalidateAddress ( Type  type,
Address  addr 
)
pure virtual

Clean and invalidate one memory page.

Parameters
typeCache type to clean and invalidate.
addrVirtual memory address of the page to clean and invalidate
Returns
Result code

Implemented in ARMCacheV7, ARMCacheV6, and IntelCache.

◆ invalidate()

virtual Result Cache::invalidate ( Type  type)
pure virtual

Invalidate the entire cache.

Parameters
typeCache type to invalidate.
Returns
Result code

Implemented in ARMCacheV7, ARMCacheV6, and IntelCache.

◆ invalidateAddress()

virtual Result Cache::invalidateAddress ( Type  type,
Address  addr 
)
pure virtual

Invalidate one memory page.

Parameters
typeCache type to invalidate
addrVirtual memory address of the page to invalidate
Returns
Result code

Implemented in ARMCacheV7, ARMCacheV6, and IntelCache.


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