This is data and needs the implicit ALIGN_WITH_INPUT that
is provided with SECTION_DATA_PROLOGUE. Otherwise misalignment
may occur if XIP is turned on.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
k_thread_create() works as expected on both uninitialized memory,
or threads that have completely exited.
However, horrible and difficult to comprehend things can happen if a
thread object is already being used by the kernel and
k_thread_create() is called on it.
Historically this has been a problem with test cases trying to be
parsimonious with thread objects and not properly cleaning up
after themselves. Add an assertion for this which should catch
both the illegal creation of a thread already active, or threads
racing to create the same thread object.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Fixes races where threads on another CPU are joining the
exiting thread, since it could still be running when
the joiners wake up on a different CPU.
Fixes problems where the thread object is still being
used by the kernel when the fn_abort() function is called,
preventing the thread object from being recycled or
freed back to a slab pool.
Fixes a race where a thread is aborted from one CPU while
it self-aborts on another CPU, that was currently worked
around with a busy-wait.
Precedent for doing this comes from FreeRTOS, which also
performs final thread cleanup in the idle thread.
Some logic in z_thread_single_abort() rearranged such that
when we release sched_spinlock, the thread object pointer
is never dereferenced by the kernel again; join waiters
or fn_abort() logic may free it immediately.
An assertion added to z_thread_single_abort() to ensure
it never gets called with thread == _current outside of an ISR.
Some logic has been added to ensure z_thread_single_abort()
tasks don't run more than once.
Fixes: #26486
Related to: #23063#23062
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Add information about the network management events when user
wants to listen multiple events from different layers.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Since the info parameter is only read from and never written the const
in the function parameter should be present.
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Move pixel format setting (RGB565/RGB888) to DeviceTree. Add support for
changing pixel format at runtime.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Adds imx rt support.
Allows n-number of can interfaces based on device-tree.
Adds a "common" irq name.
Added CAN bus pins and dts for 1060 and 1064 EVK.
Signed-off-by: Rick Talbott <rtalbott@fastmail.com>
Amend Doxygen documentation for k_msgq_put to note that the message
content will not be modified as a result of the function call and
constify data parameter in function prototype.
Fixes#22301
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Instead of hardcoding the priority1 and priority2 values used
in BMCA, let the user tweak the values via Kconfig.
Fixes#28151
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The function will check that the net_pkt will contain some
data and return true in that case, and false if the net_pkt
is empty.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Channel that requires segmentation must set alloc_buf in order for the
stack to be able to reassemble segments of an SDU.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
BT_UUID_ES_TRIGGER_SETTING was incorrectly using
BT_UUID_ES_MEASUREMENT_VAL as value instead of
BT_UUID_ES_TRIGGER_SETTING_VAL.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This uses the new macros so the common kernel objects can be
garbage collected if they are not referred directly anywhere
in the code. This is useful for reducing library data size
as not all library functions and their corresponding kobjects
are being used.
Fixes#20663
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The iterable section macros Z_ITERABLE_SECTION_ROM()/_RAM() uses
Z_LINK_ITERABLE() which does KEEP() on all symbols. This results
in all symbols under those sections being kept in final image
even though these symbols are not referred directly from the code.
This adds the new set of macros which does not force KEEP() on
the symbols, and allows symbols to be garbage collected.
The existing macros are kept as-is so as not to change their
behaviors.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
As discussed in #22668, there is additional risk ascociated with
splitting linker files, as one may update one script and not be
aware of the other. Especially related to updating GNU ld, and
not mwdt could break code for mwdt unnoticed, as mwdt is not
part of CI.
Let's create a single entry point for linker template.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Align multiline string definition syntax in ASSERT in linker
script. This allows to use linker script with ASSERT provided
by linker (i.e GNU toolchain) or dummy ASSERT defined as
preprocessor macros (ARC MWDT toolchain).
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Added a note in documentation for k_mem_slab_alloc(),
k_mem_pool_alloc() and k_heap_alloc() are safe
to call in an interrupt with the timeout K_NO_WAIT.
Fixes: #28020
Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
The bluetooth.h header file uses a different tabulation style in the
documentation headers, which for recent Doxygen versions generates
verbatim blocks. This disables usage of the @option ALIAS because
verbatim blocks cannot be nested. With this commit the documentation's
tabulation is fixed and `@option` is used to resolve Kconfig options.
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
This updates Kconfig options in the Doxygen documentation to use the new
@option ALIAS. There are three categories of fixes:
* Use of `:option:` inside Doxygen headers, which is not valid (this is
rST syntax!).
* Kconfig options that were just written as plain text and were no
references were generated.
* Use of `@rst` blocks where the only reason for using them was to have
Kconfig options resolved.
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
The fix to handle long duration timeouts in 150e18de6e also
changed the duration value from signed to unsigned. This can cause
delays in processing alarms when timer handlers run longer than a tick
(either due to delays or if there are many of them). Revert to a
signed representation.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The non-secure callable functions' section is only applicable
to Cortex-M with TrustZone-M extension. Remove it from AARCH64
linker script. (CONFIG_ARM_FIRMWARE_HAS_SECURE_ENTRY_FUNCTIONS
is only enabled for Cortex-M so this is a no-op, but still, it
is a useful cleanup.)
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Added configuration for approach to starting system clock source.
There are 3 options: no wait, wait untill available, wait until
stable.
Added support for those modes in clock control driver which handles
low frequency source clock.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The default value of clean_session flag was made configurable in
commit 0fd16f8b78 but the docstring was
not updated.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Telling that all the driver supports unaligned writes was and
is not true. Drivers only have to support any source buffer.
This fix message introduced by #23628
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This code had one purpose only, feed timing information into a test and
was not used by anything else. The custom trace points unfortunatly were
not accurate and this test was delivering informatin that conflicted
with other tests we have due to placement of such trace points in the
architecture and kernel code.
For such measurements we are planning to use the tracing functionality
in a special mode that would be used for metrics without polluting the
architecture and kernel code with additional tracing and timing code.
Furthermore, much of the assembly code used had issues.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add timing functions and APIs. This is now used with some of the tests
we have for performance and metrics and will be used whereever timing
informations are needed, for example for tracing, profiling and other
operations where timing info is critical.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
According to Intel 64 and IA-32 Architectures Software
Developer’s Manual, volume 3, chapter 8.2.5, LFENCE provides
a more efficient method of controlling memory ordering than
the CPUID instruction. So use LFENCE here, as all 64-bit
CPUs have LFENCE.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Do not force linker to place text sections after each other
to have more freedom to optimize.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Create include/toolchain/mwdt.h to handle difference in
several macros for MWDT and ARC GNU toolchains.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
MWDT toolchain adds additional suffix to sections name in case of
ffunction-sections / fdata-sections are enabled.
As proposed by Andy Ross let's pick a single set of rules
and syntax that work.
Suggested-by: Andy Ross <andy@plausible.org>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
ARC MWDT assembler has slightly different directives names:
.pushsect instead of .pushsection
.popsect instead of .popsection
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Add linker script template for MWDT toolchain (linker-mwdt.ld)
Move linker.ld to linker-gnu.ld (without changes)
The "linker.ld" is wraper now.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Make the assembly codes compatible with both GNU
and Metaware toolchain.
* replace ".balign" with ".align"
".align" assembler directive is supposed by all
ARC toolchains and it is implemented in a same
way across ARC toolchains.
* replace "mov_s __certain_reg" with "mov __certain_reg"
Even though GCC encodes those mnemonics and even real
HW executes them according to PRM these are restricted
ones for mov_s and CCAC rightfully refuses to accept
such mnemonics. So for compatibility and clarity sake
we switch to 32-bit mov instruction which allows use
of all those instructions.
* Add "%%" prefix while accessing registers from inline
ASM as it is required by MWDT.
* Drop "@" prefix while accessing symbols (defined in C
code) from ASM code as it is required by MWDT.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
/#
Replace ASM sys_io implementation with identical C code for ARC.
This significantly improves portability, i.e. compiler decides
which instructions to use for a particular CPU and / or
configuration.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
GNU toolchain and MWDT (Metware) toolchain have different style
for accessing arguments in assembly macro. Implement the
preprocessor macro to handle the difference.
Make all ASM macros in swap_macros.h compatible for both ARC
toolchains.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Switch to the _arch_switch() API that is required for an SMP-aware
scheduler instead of using the old arch_swap mechanism.
SMP is not supported yet but this is a necessary step in that direction.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This introduces bt_gatt_attr_get_handle which can be used to resolve
handles of static attributes.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Make it actually give the original pointer to the attribute and its
resolved handle so static attributes don't need an extra lookup.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
fallthrough attribute was introduced in gcc 7. For older versions the
macro is empty to avoid the follow warnning:
~/zephyrproject/zephyr/lib/os/printk.c:268:5: warning: empty declaration
__fallthrough;
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>