![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <stdlib.h>#include <types.h>#include <mmu.h>#include <timer.h>#include <csr.h>#include <common.h>#include <log.h>
Macros | |
| #define | L1_CACHE_BYTES (64) |
| Size of L1 cache line in bytes. | |
Functions | |
| void | data_sync_barrier (void) |
| Insert a data synchronization barrier. | |
| 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 | mmu_enable (void) |
| Enable the SV39 MMU with cache initialization. | |
| 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. | |
| #define L1_CACHE_BYTES (64) |
Size of L1 cache line in bytes.
| 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 data_sync_barrier | ( | void | ) |
Insert a data synchronization barrier.
This function ensures that all previous instructions are completed before any subsequent instructions are executed, particularly useful for ensuring memory consistency.
| void dcache_enable | ( | void | ) |
Enable the data cache.
This function enables the data cache by writing to the machine cache control register.
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.
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. |
| void mmu_enable | ( | void | ) |
Enable the SV39 MMU with cache initialization.
This function initializes the cache and enables both data and instruction caches for the SV39 memory management unit.