[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MirageOS-devel] Mirage/Solo5: What to do about C stubs?



Hi all,

the mirage-solo5 package (i.e. the Solo5 "platform bindings") currently
bundle C stubs for unrelated packages which get linked into a
libsolo5camlbindings.a.

Based on some discussion on Slack and also ongoing in a PR Mindy pointed me
to (https://github.com/mirage/io-page/pull/34), is the general plan to move
as much C stubs as possible directly into the packages that actually use
them?

If so, I have a bunch of work ahead of me and will need to postpone
releasing Mirage/Solo5 to opam.ocaml.org until this is complete, since if I
release what we have now then cleaning this up afterwards will be very
painful.

The following is an inventory of C stubs we've "accumulated" in
mirage-solo5 so far:

alloc_pages_stubs.c:
    caml_alloc_pages(), for io-page even though Solo5 devices do not
    *currently* require page-aligned buffers.

barrier_stubs.c:
    caml_memory_barrier(): Not sure who is the downstream consumer of this?

    caml_cstruct_unsafe_load_uint32(), caml_cstruct_unsafe_save_uint32():
    Presumably consumed by cstruct?

checksum_stubs.c:
    A copy of the checksum stubs from tcpip. Should be built out of that
    package.

clock_stubs.c:
    unix_gettimeofday(), caml_get_monotonic_time(): These are used by (at
    least) mirage-clock-xen, which we re-used for Solo5 since it has the
    same interfaces.

cstruct_stubs.c:
    caml_blit_bigstring_to_string(), caml_blit_string_to_bigstring(),
    caml_blit_bigstring_to_bigstring(), caml_compare_bigstring(),
    caml_fill_bigstring(), caml_check_alignment_bigstring().

    Based on the name (came from the original Xen bindings), I presume
    these are for cstruct?

main.c:
    caml_poll(): Used by the Mirage/Solo5 scheduler, this actually belongs
    here though could go in a better-named file.

    caml_get_cmdline(): Belongs in mirage-bootvar-solo5.

mm.c:
    Unimplemented versions of stub_heap_get_pages_total(),
    stub_heap_get_pages_used(). These never get called, not sure who's
    supposed to be using them.


solo5_{block,console,net}_stubs.c:
    These landed here as a shortcut while we were doing the port, they
    belong in the respective mirage-{block,console,net}-solo5 packages.

Thoughts? Also any comments / corrections to the above inventory much
appreciated.

Martin

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.