zephyr/scripts
Ederson de Souza 62b19ef65c syscalls: llext: Export z_impl symbols so they are available to kernel
commit 67bb6db3f8 ("syscall: Export all emitted syscalls, enabling
them for extensions") exports all emitted syscalls, however, it does
that only for the `z_mrsh` symbols, effectively only available for
userspace. If an extension running at kernel level tries to use a
syscall, it will fail to load.

This patch fixes that by exposing the `z_impl` symbols instead. However,
this is not as straightforward as the `z_mrsh` ones. As, in their
signatures, they can basically contain any type, it's not just a matter
of emitting `EXPORT_SYMBOL(z_impl_<syscall>)`, as the compiler will
complain about the undefined types. Here, there are a few approaches.

One of them is to have the `EXPORT_SYMBOL` being generated on the same
files where the syscall is implemented - injecting it there would allow
it to access all known symbols. But changing a lot of files is
undesirable, and it was one of the nice points of first patch.

Another one would be to reconstruct - or simply use the absolute path -
for the includes where the syscalls are defined. Reconstruct the paths
seems fragile and I'm not sure using absolute paths is portable.

Finally, the approach used in this patch is to declare, on a different
generated file, all `z_impl_` symbols as `void *` - after all, only the
address (and the name) to the function is relevant to EXPORT_SYMBOL. By
living in an compilation unit that doesn't include any header which
would expose any of the syscalls, there shouldn't be any conflicts. And
to account for the possibility that a syscall is not compiled - due
being configured out via Kconfig - all those symbols are also weak
aliases to a pointer to NULL. This file is then included in
`llext_export.c` (which should naturally not include any conflicting
header).

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-03-26 19:31:56 -04:00
..
build syscalls: llext: Export z_impl symbols so they are available to kernel 2024-03-26 19:31:56 -04:00
checkpatch
ci scripts: remove board name from the qualifiers in list_boards.py 2024-03-26 16:20:08 -04:00
coccinelle
coredump scripts: coredump: coredump_gdbserver in pipeline 2024-03-26 08:51:49 -04:00
dts gen_defines: output the interrupt level of a node 2024-01-23 06:48:16 -05:00
footprint scripts/size_report: display object address in overview 2024-03-26 10:49:04 -04:00
generate_usb_vif
gitlint gitlint: exclude long line with co-authored-by 2023-09-27 06:20:16 -04:00
kconfig scripts: kconfig: Add substring function 2024-03-21 20:10:46 +01:00
logging/dictionary scripts: logging/dictionary/sys-t: remove escape between CDATA 2023-12-15 14:34:15 +01:00
native_simulator native_simulator: constify 'buffer' argument in nsi_host_write() 2024-02-26 11:36:21 +01:00
net tests|scripts/net: Change native_posix references to native_sim 2024-03-20 15:43:05 +01:00
pylib twister: unify test scenario path to backslash 2024-03-26 08:48:13 -04:00
pylint/checkers
release
schemas twister: add flash-before option 2024-03-25 18:37:49 -04:00
support
tests scripts: tests: Blackbox test expansion - addon 2024-03-26 18:08:31 -05:00
tracing
utils hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
west_commands scripts: remove board name from the qualifiers in list_boards.py 2024-03-26 16:20:08 -04:00
.gitignore
checkpatch.pl scripts/checkpatch: Limit which feature test macros we prevent 2024-03-26 16:21:02 -04:00
checkstack.pl
coccicheck
dump_bugs_pickle.py
gen_gcov_files.py
get_maintainer.py MAINTAINERS: add 2 new keys: tags, tests 2023-12-22 09:54:12 +01:00
github_helpers.py
list_boards.py scripts: Ignore duplicate roots in list_boards/hardware 2024-03-26 16:20:08 -04:00
list_hardware.py scripts: Ignore duplicate roots in list_boards/hardware 2024-03-26 16:20:08 -04:00
make_bugs_pickle.py
requirements-base.txt
requirements-build-test.txt scripts: coverage: gcovr to ignore negative counters 2023-11-03 07:57:10 -04:00
requirements-compliance.txt
requirements-extras.txt scripts/requirements: bump imgtool to 2.0.0 2024-02-12 23:26:04 +01:00
requirements-run-test.txt scripts: tests: --package-artifacts fix, blackbox tests 2024-03-11 16:12:55 -04:00
requirements.txt
series-push-hook.sh
set_assignees.py scripts: set_maintainer: fix author == maintainer fallback logic 2024-01-16 14:24:05 -05:00
snippets.py terminology: adopt CMake, python, and Kconfig code to use qualifiers 2024-03-21 15:32:17 +01:00
spelling.txt spelling: add enabeld typo 2024-03-06 19:27:28 -05:00
tags.sh
twister twister: implement simulation_exclude filter 2023-12-19 07:33:39 -05:00
valgrind.supp valgrind: Update POSIX soc no cpu cleanup suppression 2023-11-29 15:33:49 +01:00
west-commands.yml west: commands: Add bindesc command 2023-09-28 07:39:09 -04:00
zephyr_module.py scripts: kconfig: Always generate ZEPHYR_*_MODULE 2023-10-24 10:53:24 +02:00