jnaulet / OpenPicoRTOS

Very small, safe, lightning fast, yet portable preemptive RTOS with SMP support
MIT License
46 stars 4 forks source link

Find a better cache management system #50

Closed jnaulet closed 1 year ago

jnaulet commented 1 year ago

Right now, cache functions are ifdef-ed depending on the need (especially on the staging PowerPC archs).

This shouldn't be the case, a cache management function is a cache management function regardless if it's used or not, this should be handled at the drivers, scheduler or device level.

More or less any level except the current one.

jnaulet commented 1 year ago

Ok, more on the topic... The need is clear, we want the hardware to do cache snooping when it is available and use software cache sync when it is not. This is mostly for SMP purposes, but DMA is concerned, too.

Fot the sake of convenience, this is ideally chosen at the device level, freeing the user's mind from it. Second best would be at the config level, this might offer different options for testing/benchmarking purposes (i think about the e200z7 platforms here, that only offers write-through and might benefit from software write-back).

IPCs need to know this information too, so now is the time to find an elegant lighweight solution that is usable in the scheduler and in the IPCs.