We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function to synchronize between cached and non-cached memory so they contain the same content.
For example dma seems to work only on non-cached memory so all cached memory arguments get copied to extra allocated non-cached memory:
kendryte-standalone-sdk/lib/drivers/dmac.c
Line 373 in 06a2ea7
you can use a normal variable as non-cached by subtracting the offset between cache and non-cached memory like this:
uint8_t arrCached[1024]; uint8_t *arr = arrCached - 0x40000000;
but there is no guarantee at any point that arrCached and arr show the same results although they point to mirrored memory.
Would using the mb() (memory barrier) macro be enough?
mb()
kendryte-standalone-sdk/lib/bsp/include/atomic.h
Line 36 in 06a2ea7
Kind regards!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Missing feature
Function to synchronize between cached and non-cached memory so they contain the same content.
Justification
For example dma seems to work only on non-cached memory so all cached memory arguments get copied to extra allocated non-cached memory:
kendryte-standalone-sdk/lib/drivers/dmac.c
Line 373 in 06a2ea7
this is non-performant and dangerous because of the amount of mallocs used.
Workarounds (kind of)
you can use a normal variable as non-cached by subtracting the offset between cache and non-cached memory like this:
but there is no guarantee at any point that arrCached and arr show the same results although they point to mirrored memory.
Would using the
mb()
(memory barrier) macro be enough?kendryte-standalone-sdk/lib/bsp/include/atomic.h
Line 36 in 06a2ea7
Kind regards!
The text was updated successfully, but these errors were encountered: