eclipse-iceoryx / iceoryx2

Eclipse iceoryx2™ - true zero-copy inter-process-communication in pure Rust
https://iceoryx.io
Apache License 2.0
1.03k stars 40 forks source link

Interoperability between 32-bit and 64-bit applications. #402

Open elBoberido opened 1 month ago

elBoberido commented 1 month ago

Brief feature description

Having interoperability between 32-bit and 64-bit applications would help porting legacy application to 64-bit by opening the path to port one application at a time and keep the system running.

Additionally, there are SoCs with 32-bit realtime cores and 64-bit performance cores. An interoperability between 32-bit and 64-bit application is a precondition for zero-copy between those cores.

The goal is to get iceoryx2 running on the Kria KR260 Robotics Starter Kit

Detailed information

Due to differences in the alignment of 64-bit PODs on 32-bit architectures compared to 64-bit architectures, it must be ensured that all data structures have the same data layout. With C++ and GCC this can be done via the -malign-double flag, which ensures that the alignment of 64-bit PODs on 32-bit architectures matches the alignment of the 64-bit architectures.

If Rust does not support such a compiler flag, all 64-bit data structures must have an explicit alignment to 8 bytes.

Additionally, POSIX data structures like ´sem_t´ have a different size on 32-bit than on 64-bit. These structures cannot be used in shared memory and need an replacement. On Linux, a futex based solution can be used and on Windows a similar approach with WaitOnAddress is feasible. Operating systems which do not support such a mechanism, can either use a spin based solution or a completely different concept which does not rely on such a data structure being placed into the shared memory.

References