![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
Cache control functions for RISC-V architecture. More...


Go to the source code of this file.
Functions | |
| void | cache_init (void) |
| Initialize the cache configuration. | |
| void | dcache_enable (void) |
| Enable the data cache. | |
| void | icache_enable (void) |
| Enable the instruction cache. | |
| void | flush_dcache_range (uint64_t start, uint64_t end) |
| Flush a range of the data cache. | |
| void | invalidate_dcache_range (uint64_t start, uint64_t end) |
| Invalidate a range of the data cache. | |
| void | flush_dcache_all () |
| Flushes the entire data cache. | |
| void | invalidate_dcache_all () |
| Invalidates the entire data cache. | |
Cache control functions for RISC-V architecture.
This header file provides functions for initializing and controlling data and instruction caches on RISC-V architecture.
| void cache_init | ( | void | ) |
Initialize the cache configuration.
This function configures the cache settings by writing specific values to the control and status registers.
| void dcache_enable | ( | void | ) |
Enable the data cache.
This function enables the data cache by writing to the machine cache control register.
| void flush_dcache_all | ( | ) |
Flushes the entire data cache.
This function flushes all data cache lines, ensuring that any modified or "dirty" cache lines are written back to the main memory. It ensures that the data in the cache is coherent with the memory.
Flush a range of the data cache.
This function flushes the data cache for a specified range, ensuring that any dirty cache lines are written back to memory.
| start | The starting address of the range to flush. |
| end | The ending address of the range to flush. |
| void icache_enable | ( | void | ) |
Enable the instruction cache.
This function enables the instruction cache by setting the appropriate control bits in the machine cache control register.
| void invalidate_dcache_all | ( | ) |
Invalidates the entire data cache.
This function invalidates all data cache lines, ensuring that no stale or outdated data remains in the cache. This operation discards the cache contents and ensures that the next access will fetch fresh data from memory.
Invalidate a range of the data cache.
This function invalidates the data cache for a specified range, ensuring that no stale data remains in the cache for the given addresses.
| start | The starting address of the range to invalidate. |
| end | The ending address of the range to invalidate. |