dde_linux module loading

Johannes Kliemann Johannes.Kliemann at ...250...
Thu Apr 27 08:21:35 CEST 2017

Hallo Josef,

thanks for your tips. I went through the code and found the dwc3 driver
which uses `module_platform_driver`. In the source it gets called with
`module_platform_driver(dwc3_driver)` and the declaration in Genode is
`extern "C" void module_dwc3_driver_init();`.
The efifb framebuffer driver I try to include gets called with
`module_platform_driver(efifb_driver)` so the corresponding declaration
should be `extern "C" void module_efifb_driver_init();`. I tried both
the macros of
'repos/dde_linux/src/lib/usb/include/spec/arm/platform/lx_emul.h' as you
said and of 'repos/dde_linux/src/lib/usb/include/lx_emul.h' (which gets
included by 'repos/dde_linux/src/lib/usb/spec/arndale/platform.cc' which
uses the dwc3 driver.
None of these macros worked, I always got a undefined reference error
from the linker. Did I miss something?


Am 26.04.2017 um 15:45 schrieb Josef Söntgen:
> Hello Johannes,
> * Johannes Kliemann <Johannes.Kliemann at ...250...> [2017-04-26 15:00:35 +0200]:
>> how are modules in dde_linux loaded exactly? For example the i915 driver
>> seems to be loaded with `module_i915_init` which somehow connects to
>> `module_init(i915_init)` but I can't see how this is done.
> Please take a look at 'repos/dde_linux/src/include/lx_emul/module.h'
> which defines the macros used by the vanilla sources. In this case
> we just generated a function that can be called directly.
>> I want to add a new driver which is loaded by
>> `module_platform_driver(...)`. What steps are required to add this
>> driver besides adding the declaration in main.cc?
> Until now the usb_drv on ARM was the only dde_linux driver that needed
> this macro, hence it is defined in its private Linux emulation header
> (see 'repos/dde_linux/src/lib/usb/include/spec/arm/platform/lx_emul.h').
> Normally we only move definitions or rather emulation code to the somewhat
> generic lx_kit/lx_emul locations if used by more than one driver.
> For now I suggest to implement the macro privately in the intel_fb
> driver as well and we will come up with a better solution later on.
> Regards,
> Josef

More information about the users mailing list