Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llext: export DT devices to extensions #78508

Merged
merged 5 commits into from
Sep 25, 2024

Commits on Sep 16, 2024

  1. device.h: fix bad error message for Z_DEVICE_NAME_CHECK

    The error message for Z_DEVICE_NAME_CHECK was needlessly calling
    DEVICE_NAME_GET() on the "name" string, resulting in a confusing message
    being displayed.
    
    Remove the DEVICE_NAME_GET call so that the error message shown by the
    compiler contains the actual name.
    
    Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
    pillo79 committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    4d40c6f View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. device.h: fix misleading comment

    The comment for Z_DEVICE_DT_DEV_ID() is misleading: device_get_binding()
    compares its inputs with values generated by the DEVICE_DT_NAME() macro,
    which expands to the node's DT label or to the node's full name.
    
    This patch updates the comment to reflect the actual behavior of
    Z_DEVICE_DT_DEV_ID().
    
    Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
    pillo79 committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0e44381 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2024

  1. llext: add wrapper to EXPORT_SYMBOL / LL_EXTENSION_SYMBOL

    This patch adds an indirection level moving the current code from inside
    the EXPORT_SYMBOL and LL_EXTENSION_SYMBOL macros to private Z_* macros.
    This is done to allow for the official APIs to properly expand more
    complex arguments, such as the DT function-like macros.
    
    Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
    pillo79 committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    5aae393 View commit details
    Browse the repository at this point in the history
  2. llext: export DT devices to extensions

    This change adds a new configuration option, LLEXT_EXPORT_DEVICES, which
    enables exporting all devices defined in the device tree to llext
    extensions. When enabled, all devices are made available to extensions
    via the standard DT_ / DEVICE_* macros.
    
    Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
    pillo79 committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    b9b55a8 View commit details
    Browse the repository at this point in the history
  3. llext: test exporting DT devices to extensions

    Add a new test to the simple llext test suite that verifies that DT
    devices are properly exported to extensions. This is done by obtaining a
    device handle from the DT and then trying to get the same handle at
    runtime using the device_get_binding() API.
    
    This test is optional because the current qemu_xtensa platform does not
    have any usable DT devices to test with.
    
    The LLEXT heap size is also increased to 64 kbytes to avoid heap
    exhaustion when running the new test on mps2_an385.
    
    Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
    pillo79 committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    689da27 View commit details
    Browse the repository at this point in the history