Skip to content

Commit 72d4694

Browse files
committed
libraries/RPC: Refactor and fix RPC library.
- Fix the memory corruption caused by the wrong MPU region configuration, which enabled caching of the shared memory region, without any cache maintenance in libmetal. - Fix the MPU region's TEX level, which was setting the shared memory region as a device and/or strongly-ordered memory, which caused usage faults on unaligned accesses. - Fix a deadlock that occurs if the main thread (sketch) makes a remote call and holds the virtqueue's mutex, and then gets preempted by the event thread, which in turn tries to acquire the same mutex. Note that libmetal's mutex implementation doesn't yield the CPU, it can be changed to do so, but for now the queues are protected with an OS mutex. - Fix RPCLIB msgpack unpacker memory overflow if RPMSG endpoint buffer > 512. - Optimize RPCLIB msgpack unpacker usage by allocating once and extending on demand. - Remove extra request/response threads, locking and callbacks, that were causing all sorts of concurrency issues, and were detrimental to performance. - Remove the redundant copy of messages to ring buffer, to boost the performance. - Remove many smaller dynamic allocation to improve the performance. - Use a single endpoint for message packs requests/responses ("RPC"), and another one dedicated for raw (non-packed) data. - General refactoring and cleanups, removal of dead code and variables, debugging code, etc... Signed-off-by: iabdalkader <[email protected]>
1 parent fcc63d9 commit 72d4694

File tree

3 files changed

+264
-418
lines changed

3 files changed

+264
-418
lines changed

0 commit comments

Comments
 (0)