The revamp is done. See below.
On 01/07/15 14:24, Antti Kantee wrote:
What is the intended division between bmk_platform_X() and bmk_cpu_X()?
Is it ok to just call e.g. bmk_cpu_block() from bmk_platform_block()
as I'm
doing it now? Similarly for bmk_platform_clock_epochoffset() just calling
bmk_cpu_clock_epochoffset().
Well, it's a bit poor since bmk means many things due to how things
evolved. Should fix that some day.
Ideally, the hw platform would be like xen, i.e. all except select
symbols are hidden when rumprun.o is created (which should probably be
called hw.o). (*)
Anyway, bmk_platform is intended to be upcalls from libbmk_core to the
platform. bmk_platform_cpu is intended to be the same, except just
signaling an always architecture-dependent implementation. bmk_cpu
signals architecture-dependence *within* hw. The only rule, really, is
that you should only use things starting with bmk_platform as an upcall
from the generic libbmk_core.
So, I guess when hw symbols are hidden, the bmk_ can be dropped from
there, and the confusion will magically disappear (yes, yes, yes ... ??!?)
Now everything which should be private to platform/hw is private on the
linker level. That means that the bmk_ was dropped from symbols private
to hw. So the namespaces in rumprun are:
bmk: common to platforms
bmk_platform: callbacks from common code to platform code
Additionally, in hw:
cpu: private to a particular machine architecture
(all other namespaces are considered global *within* hw)
(The Xen platform, IIRC, has more complicated rules)
Also, I moved the headers, so e.g. <bmk/kernel.h> is now <hw/kernel.h>
bmk-core could probably now be renamed to bmk, but not sure if it's
worth the effort.
*) ok there is one not-yet-examined case. It might be worthwhile to
allow for exceptions so that applications could make calls directly into
the "kernel" bypassing the syscall layer. But need to imagine a usable
mechanism for that, and since it doesn't currently work anyway, no sweat
about it.
Since we don't have that one yet, I didn't worry about it yet.