RPMsg inter-partition messaging
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: add README.md for 18 packages missing documentation

Add READMEs for: ocaml-fdir, ocaml-initramfs, ocaml-jailhouse,
ocaml-linkedin, ocaml-openamp, ocaml-pid1, ocaml-rpmsg, ocaml-sbom,
ocaml-slack, ocaml-vz, ocaml-zephyr, space, space-block, space-ground,
space-net, space-sim, space-test, space-wire.

+48
+48
README.md
··· 1 + # rpmsg 2 + 3 + OCaml bindings to the Linux RPMsg character device interface for inter-partition messaging. 4 + 5 + RPMsg (Remote Processor Messaging) provides message-based IPC between 6 + partitions on asymmetric multiprocessing platforms. This library wraps the 7 + `/dev/rpmsg_ctrl*` and `/dev/rpmsg*` character devices, encoding the 8 + `rpmsg_endpoint_info` struct via Wire codecs instead of manual C struct packing. 9 + It is used for communication between SpaceOS (Linux) and co-processor 10 + partitions via virtio vrings on Jailhouse, Xen, and Zynq UltraScale+ 11 + platforms. 12 + 13 + Endpoint IO is built on Eio flows, so it integrates directly with the Eio 14 + event loop. 15 + 16 + ## Installation 17 + 18 + ``` 19 + opam install rpmsg 20 + ``` 21 + 22 + ## Usage 23 + 24 + ```ocaml 25 + (* Create an endpoint and exchange messages *) 26 + let () = 27 + let ctrl = Rpmsg.Ctrl.open_ () in 28 + let idx = Rpmsg.Ctrl.create_endpoint ctrl ~name:"my-ep" ~src:1024 ~dst:1025 in 29 + let fd = Rpmsg.Endpoint.open_ idx in 30 + (* wrap the fd with Eio flows, then: *) 31 + (* let ep = Rpmsg.Endpoint.of_source_sink ~source ~sink in *) 32 + (* Rpmsg.Endpoint.send ep "hello"; *) 33 + Unix.close fd; 34 + Rpmsg.Ctrl.close ctrl 35 + ``` 36 + 37 + ## API 38 + 39 + - `Rpmsg.endpoint_info` -- The `rpmsg_endpoint_info` record type matching the Linux kernel struct: a 32-byte name, 32-bit source address, and 32-bit destination address. 40 + - `Rpmsg.endpoint_info_codec` -- Wire codec for serializing and deserializing the endpoint info struct (40 bytes). 41 + - `Rpmsg.Ctrl` -- Control device handle (`/dev/rpmsg_ctrl*`). Create and destroy RPMsg endpoints via ioctl. 42 + - `Rpmsg.Endpoint` -- Message endpoint backed by Eio flows. Send and receive messages up to 496 bytes (512 minus the 16-byte virtio header). 43 + 44 + ## References 45 + 46 + - [Linux RPMsg documentation](https://docs.kernel.org/staging/rpmsg.html) 47 + - [Jailhouse hypervisor](https://github.com/siemens/jailhouse) 48 + - [Xilinx OpenAMP / RPMsg on Zynq UltraScale+](https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842073/OpenAMP)