FreeNOS
Public Member Functions | Private Types | Private Member Functions
ARM64Cache Class Reference

ARMv7 cache management implementation. More...

#include <ARM64Cache.h>

Inheritance diagram for ARM64Cache:
Cache

Public Member Functions

virtual Result invalidate (Type type)
 Invalidate the entire cache.
 
virtual Result cleanInvalidate (Type type)
 Clean and invalidate entire cache.
 
virtual Result cleanInvalidateAddress (Type type, Address addr)
 Clean and invalidate one memory page.
 
virtual Result cleanAddress (Type type, Address addr)
 Clean one memory page.
 
virtual Result invalidateAddress (Type type, Address addr)
 Invalidate one memory page.
 
- Public Member Functions inherited from Cache
virtual Result cleanData (Address addr)
 Clean one data page.
 
virtual Result cleanData (void *ptr)
 Clean one data page.
 

Private Types

enum  CacheLevelType { CacheLevelInstruction = 1 , CacheLevelData = 2 , CacheLevelInstructionData = 3 , CacheLevelUnified = 4 }
 Defines the cache level type bits. More...
 

Private Member Functions

Result dataFlush (bool clean)
 Flush the entire data cache.
 
u32 getCacheLevelId () const
 Get cache level identifier.
 
u32 getCacheLineSize () const
 Get cache line size in bytes.
 
u32 readCacheSize (u32 level, u32 type) const
 Get cache size.
 
Result flushLevel (u32 level, bool clean)
 Clean and Invalidate by cache level.
 

Additional Inherited Members

- Public Types inherited from Cache
enum  Result { Success , InvalidArgument , IOError , NotSupported }
 Result codes. More...
 
enum  Type { Instruction , Data , Unified }
 Cache types. More...
 

Detailed Description

ARMv7 cache management implementation.

See also
ARM Architecture Reference Manual, page xxx

Definition at line 43 of file ARM64Cache.h.

Member Enumeration Documentation

◆ CacheLevelType

Defines the cache level type bits.

Enumerator
CacheLevelInstruction 
CacheLevelData 
CacheLevelInstructionData 
CacheLevelUnified 

Definition at line 50 of file ARM64Cache.h.

Member Function Documentation

◆ cleanAddress()

ARM64Cache::Result ARM64Cache::cleanAddress ( ARM64Cache::Type  type,
Address  addr 
)
virtual

Clean one memory page.

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

Implements Cache.

Definition at line 55 of file ARM64Cache.cpp.

References Cache::Success.

◆ cleanInvalidate()

ARM64Cache::Result ARM64Cache::cleanInvalidate ( ARM64Cache::Type  type)
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

Implements Cache.

Definition at line 45 of file ARM64Cache.cpp.

References Cache::Success.

Referenced by invalidate().

◆ cleanInvalidateAddress()

ARM64Cache::Result ARM64Cache::cleanInvalidateAddress ( Type  type,
Address  addr 
)
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

Implements Cache.

Definition at line 50 of file ARM64Cache.cpp.

References Cache::Success.

◆ dataFlush()

ARM64Cache::Result ARM64Cache::dataFlush ( bool  clean)
private

Flush the entire data cache.

Parameters
cleanTrue to clean cache before invalidation.
Returns
Result code

Definition at line 102 of file ARM64Cache.cpp.

References Cache::Success.

Referenced by invalidate().

◆ flushLevel()

ARM64Cache::Result ARM64Cache::flushLevel ( u32  level,
bool  clean 
)
private

Clean and Invalidate by cache level.

Parameters
levelCache level
cleanTrue to clean cache before invalidation.
Returns
Result code

Definition at line 97 of file ARM64Cache.cpp.

References Cache::Success.

◆ getCacheLevelId()

u32 ARM64Cache::getCacheLevelId ( ) const
private

Get cache level identifier.

Returns
Cache Level Identifier

Definition at line 65 of file ARM64Cache.cpp.

◆ getCacheLineSize()

u32 ARM64Cache::getCacheLineSize ( ) const
private

Get cache line size in bytes.

Returns
Cache line in bytes

Definition at line 70 of file ARM64Cache.cpp.

◆ invalidate()

ARM64Cache::Result ARM64Cache::invalidate ( ARM64Cache::Type  type)
virtual

Invalidate the entire cache.

Parameters
typeCache type to invalidate.
Returns
Result code

Implements Cache.

Definition at line 27 of file ARM64Cache.cpp.

References cleanInvalidate(), Cache::Data, dataFlush(), Cache::Instruction, invalidate(), Cache::Success, type, and Cache::Unified.

Referenced by invalidate().

◆ invalidateAddress()

ARM64Cache::Result ARM64Cache::invalidateAddress ( ARM64Cache::Type  type,
Address  addr 
)
virtual

Invalidate one memory page.

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

Implements Cache.

Definition at line 60 of file ARM64Cache.cpp.

References Cache::Success.

◆ readCacheSize()

u32 ARM64Cache::readCacheSize ( u32  level,
u32  type 
) const
private

Get cache size.

Parameters
levelCache level to get size for
typeCache type to get size for
Returns
Cache size in bytes

Definition at line 75 of file ARM64Cache.cpp.


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