The net_capture_is_enabled() function returns boolean value
so fix the function prototype.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The net_capture_pkt() does not return anything so remove the
return description from the function documentation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
These functions are those that need be implemented by backing
store outside kernel. Promote them from z_* so these can be
included in documentation.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
These functions and data structures are those that need
to be implemented by eviction algorithm and application
outside kernel. Promote them from z_* so these can be
included in documentation.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fixed several compilation errors that resulted from selecting
TRACING without specifying a tracing system (Tracerecorder,
CTF, Systemview). In this case (TRACING_NONE), some default trace hooks
(in tracing.h) were incorrectly named resulting in compilation errors.
The legacy sys_trace_isr_enter, sys_trace_isr_exit, and sys_trace_idle
also caused problems since these were only given as defines, resulting
in undefined reference errors since they are required by the assembly
files calling these. To solve this issue I've added a stub file
"tracing_none.c" (only compiled if TRACING_NONE) and declared the
functions in tracing.h if no tracing system is selected.
Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
The `CONFIG_LINKER_SORT_BY_ALIGNMENT` config, which is enabled by
default, causes the sections containing C++ exception handling
information to be re-ordered for certain targets (in particular, the
64-bit arch targets). This effectively breaks the required "crtbegin.o
-> others -> crtend.o" order and causes the address of the
__EH_FRAME_BEGIN__ symbol to be invalid; thereby, causing C++
exception unwinding to fail.
This commit adds SORT_NONE property to these sections in order to
ensure that the linking order specified in the linker command line is
maintained.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Fixes part of: #32448
This commit updates the CMake CMAKE_CXX_LINK_EXECUTABLE to include
crtbegin.o and crtend.o at the right locations when linking with gcc.
It also updates linker scripts to ensure proper location of the
exception header frame sections.
This ensure proper handling of exceptions for those architectures
- x86
- xtensa
- riscv32
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The current iso commands in the shell only supports setting up
a bidirectional stream or unidirectional for central role.
Adding rx/tx/rxtx option to iso listen command to allow for
peripheral side configuration of an iso connection.
Signed-off-by: Casper Bonde <casper_bonde@bose.com>
The sequence number is needed in the appliaction layer to detect lost
packets in the ISO stream in cases where the timestamp is not included.
(Sequence number is mandatory to include where timestamp is optional).
The API for the public metadata have been moved to a public header file.
As the size of the ISO meta data exceeds the default 4 octets net_buf
user_data the public ISO metadata have been moved into a seperate array.
The internal metadata is still stored in net_buf user_data.
This also fixed the user_data overflow on 32 bit systems, caused by
writing the ts into user_data on index 4 to 7, which is outside the 4
allocated bytes.
Signed-off-by: Casper Bonde <casper_bonde@bose.com>
Some time ago we did a cleanup of sys_io function and left nios2 broken,
especially on the MAX10 board. Revert back to the original
implementation for this architecture.
Fixes#35694
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change fixes a build warning related to attribute ignored in
declaration of struct. The __packed attribute is removed.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Most APIs have the default synchronous and an asynchronous version
with the sufix _async because that is the most common use.
All devices in tree right now are using the synchronous version, so
just change it to be consistent with the rest of the system.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Since we are using mutex to protect critical sections and mutexes are
reentrant, it is possible to get rid of atomic for the state because
we can lock the mutex in device_pm_callback.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Protect critical sections using the mutex.
The mutex is required to use the conditional variable and since we
need to atomically check the pm state and the workqueue before wait
the condition, it is necessary to protect them using the same mutex.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Protect critical sessions using the spinlock available. The atomic
usage was not properly protecting the critical section and was
possible to have a race condition between the usage check and state
set.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add a function that properly uses a mutex to check a condition before
wait on the conditional variable.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The commit adds Kconfig option to configure dummy shell buffer size.
Size of this buffer determines how mutch of command output will be
stored in buffer.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Fix issue is host handling of connected and disconnected event.
Since the host wants the disconnected event to be processed as a
priority event as well as in reguler event context while the connected
event is always in reguler event context we can end up in a situation
where the disconnected priority event is processed before the connected
event.
Since the disconnected priority event is there to release unack'ed TX
pending on the connection in case the RX thread is blocked waiting
for TX resources, we need to keep this behavior. Otherwise this would
be a potential deadlock of the RX thread waiting for resources that can
only be released by the RX thread.
When this situation happens we know that there cannot be any pending TX
on this connection so we can safely skip releasing of unack'ed TX.
The second thing the disconnected priority event does is marking the TX
path on the connection as disconnected. We need to do the same in this
situation, so we make sure that the TX path is already marked
disconnected when providing the connected callback to the application.
This fixes a regression from 4be66bd33d.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add check for the advertising already being enabled when attempting to
start the advertising set.
Document that the advertising set cannot be started from the connection
connected callback, and instead has to be started from the advertising
set connected callback.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
tracerecorder maintains its macros definitions outside of zephyr and can
deal with undefined macros or hooks that are implemented in Zephyr but
not yet implemented in TR. Move inclusion to the bottom after all macros
have been initialized.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The scheduler has historically had an API where an application can
inform the kernel that it will never create a thread that can be
preempted, and the kernel and architecture layer would use that as an
optimization hint to eliminate some code paths.
Those optimizations have dwindled to almost nothing at this point, and
they're now objectively a smaller impact than the special casing that
was required to handle the idle thread (which, obviously, must always
be preemptible).
Fix this by eliminating the idea of "cooperative only" and ensuring
that there will always be at least one preemptible priority with value
>=0. CONFIG_NUM_PREEMPT_PRIORITIES now specifies the number of
user-accessible priorities other than the idle thread.
The only remaining workaround is that some older architectures (and
also SPARC) use the CONFIG_PREEMPT_ENABLED=n state as a hint to skip
thread switching on interrupt exit. So detect exactly those platforms
and implement a minimal workaround in the idle loop (basically "just
call swap()") instead, with a big explanation.
Note that this also fixes a bug in one of the philosophers samples,
where it would ask for 6 cooperative priorities but then use values -7
through -2. It was assuming the kernel would magically create a
cooperative priority for its idle thread, which wasn't correct even
before.
Fixes#34584
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Remove dead code enum tracing_log_id
Not used anywhere in the code. Also it caused MISRA rule 8.12
violation.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
1. functions can only belong to one group, use arch-timing (already
defined)
2. group was not properly terminated
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The K_HEAP_DEFINE macro would allow users to specify heaps that are
too small, leading to potential corruption events (though at least
there were __ASSERTs that would catch this at runtime if enabled).
It would be nice to put the logic to compute this value into the heap
code, but that isn't available in kernel.h (and we don't want to pull
it in as this header is already WAY to thick). So instead we just
hand-compute and document the choice. We can address bitrot problems
with a test.
(Tweaks to heap size asserts and correct size bounds from Nicolas Pitre)
Fixes#33009
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Picky C++ compilation reported warnings that input arguments
are not used. Adding missing ARG_UNUSED().
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
C++ compiliation may generate warning if all fields are not
explicitly initialized. Added explicit initialization to 0.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
C++ compiliation may generate warning if some fields are not
explicitly initialized. Added explicit initialization to 0.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
syntax ". += length;" not work with arcmwdt toolchain, let's using
". = . + length;", which both work with gnu and arcmwdt toolchain.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
Add empty Z_LOG_MSG2_SIMPLE_CREATE when CONFIG_LOG_SPEED=n. It
allows to reduce compilation time by removing code at preprocessor
stage. Previously functionality was the same, compiler was removing
unused code but because logging is widely use that had a visible
impact on compile time.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The way some structures were documented was causing issues on the
Sphinx/Breathe side. Move to a more "standard" format.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
If this call receives an invalid device pointer as argument it
assumes that the `device` is not ready for usage.
This routine is currently called by two device specific APIs:
- device_usable_check(const struct device *dev)
- device_is_ready(const struct device *dev)
The device-specific APIs documentation claims that these two
routines must be called with a device pointer captured from
DEVICE_DT_GET(). So passing NULL is a violation of the rule.
Nevertheless, is quite common in drivers to assign NULL to
a device pointer if the corresponding DT property has not been
found (e.g. a not used gpio interrupt declaration for a given
device instance) and seems legit to interpret this condition
same as the device is not ready for usage.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Buffer used for storing log messages must be aligned as specified
by Z_LOG_MSG2_ALIGNMENT. Added missing alignment.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
When a non-zero delay is used the schedule functions can't fail, but
if K_NO_WAIT is passed error conditions may be forwarded from
k_submit_to_queue.
Also add a missed error return from k_submit_to_queue.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Simplified handling of runtime filtering that lead to removal
of LOG_CHECK_CTX_LVL_FILTER macro. Fixing multiply coverity issues
like CID 236013.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
use atomic_clear_bit instead of atomic_test_and_set_bit
which will not return old value, and thus more coverity friendy
Fixing: #35154
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Arg can be double * and it is casted to int *. Coverity reports
it (CID 235943). Fixed by adding intermediate void * variable.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>