Add a new interfaces for getting processor ID. On some of the
architectures, implement by means of arch_curr_cpu().
On xtensa, we get this via the PRID register.
Doxygen string by Andy Ross.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This function retrieves TX sync information
(timestamp, offset, and sequence number)
from controller using HCI command HCI_LE_Read_ISO_TX_Sync.
Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
Allocated own message buffer for RD client interface.
This helps to cover if all messages are queued and need to do
registration or update.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
(cherry picked from commit 8dca91109d73a4a697e074c58ee9430d56c01a51)
Mesh 1.0.1 specification doesn't prohibit to use full range of
the fixed group addresses for subscription.
The immediate use case is upcoming IPT transport models
which will also work on Mesh 1.0 devices. The models
declare their own fixed group addresses.
Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
This commit adds the following new thread stack declaration macros that
replace the now-deprecated thread stack "extern" macros:
K_KERNEL_STACK_DECLARE
* replaces K_KERNEL_STACK_EXTERN.
* accepts a stack size parameter.
K_KERNEL_STACK_ARRAY_DECLARE.
* replaces K_KERNEL_STACK_ARRAY_EXTERN.
K_KERNEL_PINNED_STACK_ARRAY_DECLARE.
* replaces K_KERNEL_PINNED_STACK_ARRAY_EXTERN.
K_THREAD_STACK_DECLARE
* replaces K_THREAD_STACK_EXTERN.
* accepts a stack size parameter.
K_THREAD_STACK_ARRAY_DECLARE
* replaces K_THREAD_STACK_ARRAY_EXTERN.
The term "declare" has been chosen in place of "extern" in order to
align with the existing terminology used throughout the kernel code.
Note that the K_{KERNEL,THREAD}_STACK_DECLARE macro accepts a new stack
size parameter so that the `sizeof` operator can be used with the
external stack symbols declared using it.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit removes the `@def` command in the Doxygen documentation
because Doxygen is smart enough to figure out that a comment block is
for the following `#define`, and it is completely redundant.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit updates the thread stack API documentation such the
terminology used by the documentation matches that of the actual macro
and function names.
For instance, the term "declare" in the context of "defining" a stack
has been changed to "define."
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit ensures that all thread stack API macros are included in
the `thread_stack_api` documentation group.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Remove v1 implementation from log_core and all references in the tree.
Remove modules used by v1: log_list and log_msg.
Remove Kconfig v1 specific options.
Remove Kconfig flags used for distinction between v1 and v2.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Currently the device MMIO APIs is only able to map single DT-defined
regions and also the _NAMED variant is assuming that each DT-defined
device has only one single region to map.
This is a limitation and a problem when in the DT are defined devices
with multiple regions that need to be mapped.
This patch is trying to overcome this limitation by introducing the
DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME macro that leveraged the 'reg-names'
DT property to map multiple regions defined by a single device.
So for example in the DT we can have a device like:
driver@c4000000 {
reg = <0xc4000000 0x1000>, <0xc4001000 0x1000>;
reg-names = "region0", "region1";
};
and then we can use DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME doing:
struct driver_config config = {
DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME(region0, DT_DRV_INST(0)),
DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME(region1, DT_DRV_INST(0)),
};
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Avoid potentially calling __builtin_clz() twice with non-constant
values. Also add a test for it.
Clang produces false positive vla warnings so disable them. GCC will
spot real vla's already.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
MISRA C:2012 Rule 7.2 (A `u' or `U' suffix shall be applied to all
integer constants that are represented in an unsigned type)
Added missing `U' suffixes in constants that are involved in the
analyzed build, plus a few more not to introduce inconsistencies
with respect to nearby constants that are either unused in the
build (but implicitly unsigned) or are used and are immediately
converted to unsigned.
Signed-off-by: Abramo Bagnara <abramo.bagnara@bugseng.com>
Fixup how the drv_name field is set in NET_DEVICE_DT_OFFLOAD_DEFINE
and NET_DEVICE_DT_DEFINE_INSTANCE to be consistent with
NET_DEVICE_DT_DEFINE.
Signed-off-by: Kumar Gala <galak@kernel.org>
The current implementation for events channel is using an empty
callback for every unbind channel and the interrupt is clearing
every event and calling the callback.
However in a scenario where a domain fires a notification when
another has not yet bind the channel, the event will be missed.
To address this limitation, this commit is keeping track of
missed event channel notification when the empty callback is
used, a function to retrieve and clear the missed event is
introduced.
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
This commit extends the `struct net_pkt` structure with
`ieee802154_txpwr` field that contains signed value of the desired
transmission power of a IEEE 802.15.4 frame in dBm.
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
This adds a simple function to get the thread pointer to the user
mode thread of the user work queue. This is useful for granting
that user mode thread additional access to kernel objects.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clean up the docstrings for the APIs related to converting property
values to tokens. I think the current language has a few issues and
could be made clearer in some cases.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Added macro for getting nth element from section.
Added macro for counting elements in the section.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Makes it possible for an application to
handle CSIS RSI advertising by registering a
callback, which will disable the internal
CSIS advertising.
Also fixes registering callbacks in CSIS.
Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Rename the symbols used to denote the locations of the global
constructor lists and modify the Zephyr start-up code accordingly.
On POSIX systems this ensures that the native libc init code won't
find any constructors to run before Zephyr loads.
Fixes#39347, #36858
Signed-off-by: David Palchak <palchak@google.com>
By default, any string or opaque data that LwM2M engine initializes
sets data lenght to same value as given buffer length for that
resource.
However, on run time, engine keeps track how much data is written
to each resource, so when reading from any resource, should only
return data that has been written there. But uninitialized resources
return the content of the whole buffer.
Fixed the problem by introducing macros INIT_OBJ_RES_LEN(),
INIT_OBJ_RES_MULTI_DATA_LEN() and INIT_OBJ_RES_DATA_LEN() that
allows you to give the amount of data existing in buffer when
the resource is initialized. This sets the data_len and max_data_len
variables correctly.
Also introduced new functions lwm2m_engine_get_res_buf() and
lwm2m_engine_set_res_buf() that distinct between data size and
buffer size. Deprecated the previous functions
lwm2m_engine_get_res_data() and lwm2m_engine_set_res_data()
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Extended logging backend API with log_backend_is_ready call which
returns 0 is backend is ready. Logging core will make sure that
all autostarted backends are ready before they are enabled.
This option allows to handle backends which are not yet ready
after init function is called (e.g. usb backend that is not plugged
in). If this is the only backend in the system, logging processing
will not start util first backend is ready.
Function for checking readiness is optional and when backend has
no such function it is assumed that backend is ready after
initialization function returns which makes this feature backward
compatible.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This improves the macro so that it can take variable number of
arguments, e.g. BT_CODEC_LC3_CHAN_COUNT_SUPPORT(1, 2, 8).
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Adds a helper function to query whether a device is currently powered.
This can be used to determine if the chip can be initialised now, or if
it needs to be deferred.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Clarify a few restrictions that seem obvious but weren't specified:
+ On MP systems, counters are often asynchronous between cores, so you
need to make sure all the values read are on the same CPU.
+ Many platforms have a 32 bit (or smaller, c.f. Cortex M SysTick)
internal counter, but are being forced to return a 64 bit quantity
that will behave badly on rollover (you can't just subtract two
times anymore!). Demand that the existing arch_timing_cycles_get()
API (which didn't seem to have useful much to do) implement rollover
correction on the subtraction.
This allows an Xtensa implementation based on direct CCOUNT reads on
intel_adsp to be correct per the API docs.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add flags option to init call and a flag to use cache.
Add Kconfig choice to pick how to approach cache. Cache can be
enforced in all spsc_pbuf instances, disable in all, or runtime selected
based on configuration flag. Option is added to allow memory footprint
savings.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Move icmsg_buf to lib/os and rename to spsc_pbuf (Single Producer
Single Consumer Packet Buffer). It is a generic module and initially
was created as internal module for ipc service.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Rename the BT_ISO_INTERVAL_MIN/MAX to
BT_ISO_SDU_INTERVAL_MIN/MAX to avoid confusing this
the the ISO interval which is different from the SDU
interval.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add two new parameters to bt_iso_chan_send:
sn: The packet sequence number which shall be incremeted
per SDU interval.
ts: An optional timestamp value used to synchronize SDUs.
The sequence number in the API uses a 32-bit value even though
the sequence number for the HCI command is 16-bit. This is to
properly handle wrapping of sequence numbers, which is much
easier to do with additional bits allocated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The reserved memory mechanism (sections and regions definition) has been
entirely replaced, greatly extended and made it better by the work done
on the zephyr,memory-region compatible.
Since there is are no actual users, we can remove it.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This patch adds the following dt-spec helpers:
- adc_channel_setup_dt()
- adc_raw_to_millivolts_dt()
- adc_sequence_init_dt()
The objective of these functions is to reduce application boilerplate
when Devicetree is used to configure the ADC.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
CONFIG_LOG2_MSG_PKG_ALWAYS_ADD_RO_STRING_IDXS was added as
a stop-gap measure to support Sys-T catalog messages. Since
the Sys-T backend has envolved to use tagged argument, this
kconfig and its effect are no longer needed. So remove it.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds support for packaging with tagged arguments for log
messages so that backends can make use of this information
when they process messages.
Note that currently tagged arguments must be used with
CONFIG_LOG2_ALWAYS_RUNTIME where log messages are created via
z_log_msg2_runtime_{v,}create(). For some reason, using C++ on
Cortex-M (mps2_an385) results in an additional empty string
argument being added to the list. This does not happen if only
doing C on mps2_an385, or on other architectures.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>