[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [MirageOS-devel] Mirage/Solo5: What to do about C stubs?
On Tue, Jul 19, 2016 at 5:19 PM, Thomas Leonard <talex5@xxxxxxxxx> wrote:
On 19 July 2016 at 16:47, Martin Lucina <martin@xxxxxxxxxx> wrote: In mirage-platform it looks like it's called by OCaml function Xenctrl.xen_mb(), but I think this function might be dead. I suspect the only user is the shared-memory-ring code and we forgot to remove this when we moved shared-memory-ring out of the platform?
IIRC the shared memory ring protocol requires the use of atomic 32-bit loads and stores, or else bad stuff happens. Cstruct uses ocplib-endian normally, but the ocplib-endian functions use (used to use?) a series of byte-sized loads and stores to cope with different possible alignments. This was not a fun bug to work on :-)
I wonder if we could simplify things a little bit by standardising and documenting the C-level interface a little more? For example in the Io_page caml_alloc_pages we've got some #ifdefs to use `_xmalloc` on `__MINIOS__`, `malloc` (should really be `aligned_malloc`) on `_WIN32` and `posix_memalign` on the rest. Perhaps minios and solo5 should provide a `posix_memalign` function? Cheers, Dave _______________________________________________ MirageOS-devel mailing list MirageOS-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |