Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The current error messages are a bit cryptic, rework them to make them
more meaningful:
- add an extra message on the first error to explain what the errors
refer to.
- rework the error message to be more explicit.
- rework the priority string print to use a LEVEL+offset format to
somehow highlight that the number is the offset from the level, not
the actual priority.
- print the init function name in addition to the devicetree path.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Since bb590b5b6e introduced ordinals in the priority sequence, the "same
priority" case cannot happen anymore, furthermore the priority value in
the script is now the position of the function in the init sequence, so
if two devices have the same priority there's something real bad going
on.
Drop all the "same priority" handling code and tests, convert the case
into ane exception instead. Drop the init stubs as well from the test,
they are not required anymore.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Now that child nodes are handled by edtlib there's no need to parse
child nodes in check_init_priorities anymore.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit removes the needs or generating isrList.bin temporary file.
Now gen_isr_tables.py script access the required section directly in
elf file, that was accessed by the script anyway.
It simplifies the building removing one step.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
Rework check_init_priorities to use the main executable file instead of
the individual object files for discovering the devices.
This should make the script more robust in case of stale files in the
build directory, and also makes it work with LTO object files.
Additionally, keep track of the detected init calls, and add a handy
"-i" option to produce a human readable print of the initcalls in the
call sequence, which can be useful for debugging initialization problems
due to odd SYS_INIT and DEVICE interactions.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit introduces all the necessary changes for
enabling the usage of shared interrupts.
This works by using a second interrupt table: _shared_sw_isr_table
which keeps track of all of the ISR/arg pairs sharing the same
interrupt line. Whenever a second ISR/arg pair is registered
on the same interrupt line using IRQ_CONNECT(), the entry in
_sw_isr_table will be overwriten by a
(shared_isr, _shared_sw_isr_table[irq]) pair. In turn, shared_isr()
will invoke all of the ISR/arg pairs registered on the same
interrupt line.
This feature only works statically, meaning you can only make use
of shared interrupts using IRQ_CONNECT(). Attempting to dynamically
register a ISR/arg pair will overwrite the hijacked _sw_isr_table
entry.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Update CFB font generator so it works with Pillow version 10. They
deprecated some methods, with no direct replacements, so the generated
fonts might be slightly different.
Signed-off-by: Jonathan Rico <jonathan@rico.live>
Log the device priority on the file debug output print, this is
convenient to list out all the defined devices and their priority, even
if they don't depend on each other.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
It is only available if CONFIG_DEVICE_DEPS=y, so the ZephyrElf class
would fail to load if it does not treat _DEVICE_STRUCT_HANDLES_OFFSET as
optional.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
The generated stubs use retval for function return value.
However, this is too generic and is going to collide with
other code. So rename those to be more specific. Note
that the double underscore is intentional to minimize
chance of being shadow variables.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Some architectures such as RISC-v support more than 255 interrupts
per aggrigator. This diff adds the ability to forgo the aggrigator
pattern and use a configurable number of bits for multilevel
interruts.
Signed-off-by: Joshua Lilly <jgl@meta.com>
For applications relocating big parts of the code with many sections,
builds were failing on Windows due to hitting the max command-line
length on that platform.
Fix this by using a file to store the dictionary passed to the python
script.
Fixes https://github.com/zephyrproject-rtos/zephyr/issues/60994.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Update the script to parse the new section naming. The ordering type
is converted from an integer to a tuple, which still compares correctly
due to the elementwise behaviour of tuple comparison.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
The new stack zephyr,cdc-acm-uart driver has two separate init path, one
of which kicks in before the USB stack to start buffering log messages.
This generates a false positive in the build time priority checking,
adding a check to ignore that compatible entirely.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Rename the device dependencies array variable to use the "deps" name, in
line with latest renamings in device.h
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename multiple internal device macros to use the DEVICE_DEPS naming, so
that it is clear they belong to the device dependencies APIs.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
These macros are used internally by the device dependencies functions.
There's no need to expose them publicly, so prefix them with Z_ and add
them under INTERNAL_HIDDEN docs section.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Use the "device_deps" naming scheme to emphasize we are storing device
dependencies. The fact we are using device handles to store them is an
implementation detail.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename the gen_handles script and all of its references/associated files
to gen_device_deps. The new new makes things more clear, because the
script just take care of generating, for each device, an array of device
dependencies. While device handles are used internally to store this
information, it is in reality an implementation detail.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The code_relocation feature creates generic section names that sometimes
conflict with already existing names.
This patch adds a '_reloc_' word to the created names to reduce the risk
of conflict.
This solves #54785.
Signed-off-by: Björn Stenberg <bjorn@haxx.se>
Fixes an issue on windows where there would be many permutations
of paths with different folder separators by converting to
posix-style path separators.
Issue was introduced by
https://github.com/zephyrproject-rtos/zephyr/pull/58351
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The syscall generation phase parses all header files to look
for potential syscalls, and emits all the relevant files to
enable syscalls. However, this results in all the syscall
marshalling functions being included in the final binary.
This is due to these functions being referred to inside
the dispatch list, resulting in ineffective garbage
collection during linking. Previous commits allows each
drivers and subsystems to specify which header files
containing syscalls are relevant. So this commit changes
the syscall generation to only include the syscalls needed
for the build in the syscall dispatch list and removing
various bits related to that. This allows the linker to
garbage collect unused syscall related function, and thus
reducing final binary size.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
When CONFIG_HAS_DYNAMIC_DEVICE_HANDLES is selected, devices handles are
placed in RAM region so that they can be modified at runtime. However,
the gen_handles.py script added the `const` attribute to the device
handle arrays regardless of this setting, leading to faults when running
the application. This may be an indicator that this feature is not
actively used.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Print a clean error message when provided a relocatable file, instead
of generating a source file which will cause compilation errors further
away from the source.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Based on investigations with relocatable `.elf` files, the symbol table
data in relocatable files is not shifted by the section address. Remove
the shift from these files to ensure that data can be pulled from the
symbol table.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Retrieve the section holding the symbol data directly from the symbol
information, instead of trying to find a section that contains data at
the correct address. The later approach does not work for relocatable
files, which contain multiple sections all containing data in
overlapping temporary memory addresses (usually starting at 0).
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add support for more verbose output enabling debugging output and add a
first debug print to output the file to device path mapping. Found this
to be extremely useful to find what file is instantiating a specific
device for non obvious cases.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Update the sensor shell logic to use the new sensor_read() APIs and
make triggers an option of the sensor_shell sample (this avoids the
trigger stealing the interrupt status from one-shot reads).
Signed-off-by: Yuval Peress <peress@google.com>
Add a new async API based on the RTIO subsystem. This new API allows:
1. Users to create sampling configs (telling the sensor which channels
they want to sample together).
2. Sample data in an asynchronous manner which provides greater control
over the data processing priority.
3. Fully backwards compatible API with no driver changes needed for
functionality (they are needed to improve performance).
4. Helper functions for processing loop.
Signed-off-by: Yuval Peress <peress@google.com>
Add a check_init_priorities.py scripts. This goes through all the object
files looking for known initialization sections and building a map of
device ordinals and their effective initialization priority. Then
compares that with the list of dependencies generated based on the
device tree and reports any warning (dependent devices, same priority)
or error (incorrect priority).
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
pylint reports the following issues on the
scripts/build/gen_isr_tables.py:
C0325:Unnecessary parens after '=' keyword (superfluous-parens)
File:scripts/build/gen_isr_tables.py
Line:16
Column:0
C0325:Unnecessary parens after '=' keyword (superfluous-parens)
File:scripts/build/gen_isr_tables.py
Line:316
Column:0
Fix that so that unrelated PR touching the same file have a chance to
pass the compliance checks.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Some compilers and static analyzers warn when non-static (globals) are
not declared in some .h file. Tweak the generated code and add an
`extern` declaration before each device handle definition to make it
look it was declared in a (non-existent) .h file.
This makes the code a bit longer but it is already generated and very
repetitive anyway.
In the typical SOF configuration this silences about 150 sparse
warnings; as many as device handles.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Sometimes we want to force the inlining of a __syscall. Introduce a new
__syscall_always_inline symbol to do that.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
An explicit import of edtlib is not required when using
pickle.load() and creates a duplicate module object.
Signed-off-by: Keith Short <keithshort@google.com>
This refactors the script to introduce a SectionKind enum that
represents each of the kinds of sections handled by this system (text,
data, rodata or bss), using that to improve the code structure by
reducing the use of strings in favor of indicating the use of values by
their types.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
When using code_data_relocation the script identifies sections that
should be relocated, but cannot guarantee that section names are unique
across all linked files. If a section name is not unique then matching
all sections with that name across all input files will relocate more
data than intended.
As a simple example, if both file1 and file2 contain .rodata.strings
sections, then if gen_relocate_app inspects only file1 it will generate
a linker script fragment `*(.rodata.strings)` that matches both object
files.
This commit changes gen_relocate_app to make the linker match on object
files as well (`*file1.o(.rodata.strings)`) to ensure unwanted sections
don't get relocated.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>