The current headers do not allow the full inlining of the cache
functions. Rework and cleanup the headers to allow for the full
inlining.
Signed-off-by: Carlo Caione <ccaione@baylibre.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>
Hid type definitions of API functions from documentation
using INTERNAL_HIDDEN condition.
Changed nested groups inside rtc_interface group to use
@name instead.
Use @anchor to reference definitions for
RTC_ALARM_TIME_MASK.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
Z_LOG2() has a typo, confusing & with &&. The result is the same but
using && is more logical in that case and it eliminates a flood of
warning: dubious: x & !y
static analyser warnings. Also compare to 0 explicitly to fix a
coding style violation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Cleanup linker scripts for net_buf_pool section to use the linker
script related iterable section macros.
Also replace _net_buf_pool_list with macro's instead to complete
iterable section usage.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
OpenThread requires that the `mTimestamp` parameter from the `mRxInfo`
struct points to the end of SFD, i.e. beggining of PHR.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
The initshell sections in the linker scripts where associated with theo
old shell code. The old shell code has been removed for some time so
remove references to initshell in the linker scripts and size_calc.py
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
By using the __weak attribute with the macro `Z_DEVICE_HANDLES_DEFINE`
C++ throws the error "weak declaration must be public". This change
adds the keyword extern if the macro is included in a C++ source
file.
Signed-off-by: Victor Chavez <chavez-bermudez@fh-aachen.de>
The macro `Z_DEVICE_INIT` is not compatible with C++ due to
initialization order of the struct device. This commit fixes
the initialization for compatiblity with C++.
Signed-off-by: Victor Chavez <chavez-bermudez@fh-aachen.de>
Some devices do not need to perform any initialization, so allow the
init function to be NULL. In this case, the initialization code will
just mark the device as initialized, i.e. ready.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Introduce PINT driver, for NXP pin interrupt and pattern match engine.
The driver currently supports only the pin interrupt feature of the
PINT.
Add DTS entires for the PINT on LPC and RT devices that support this
peripheral, and remove the interrupt defintions that are PINT specific
from the GPIO module on these devices.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The Arm assembler in binutils 2.40 contains a change [1] which affects
how multiple directives on the same line are parsed.
Previously, the following combination of directives parsed successfully:
.code 32 .balign 4
With binutils 2.40, the following error is now seen:
Error: junk at end of line, first unrecognised character is `.'
To fix, insert a semicolon after '.code 32', as there already is after
'.thumb'.
[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=a37854f9162fac592b669eda53f465fc190c9341
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
rtio is utilizing iterable sections so the explicit linker
code does not need to exist so we can remove it.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Convert handling of shell_root_cmds, shell_subcmds, and
shell_dynamic_subcmds to use iterable section macros.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Allows L2s to declare generic association/connection routines
that can be bound by name to ifaces.
Allows L2-agnostic control over connectivity/association for
iface that support it.
Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
Macro was not taking into account case when logging was disabled
and it was failing to link in that case.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Normally, the driver deactivates the QSPI peripheral for periods when
no QSPI operation is performed. This is done to avoid increased current
consumption when the peripheral is idle. For the same reason, the base
clock on nRF53 Series SoCs (HFCLK192M) is configured for those periods
with the default /4 divider that cannot be used otherwise. However,
when XIP accesses are used, the driver must be prevented from doing
both these things as that would make XIP to fail. Hence, a function
is provided so that applications can inform the driver that XIP is
needed and the above idle actions should be suppressed.
This function (`nrf_qspi_nor_xip_enable()`) replaces the old one
(`nrf_qspi_nor_base_clock_div_force()`) that was intended for similar
purpose but after deactivation of the peripheral was introduced in
commit 95d867e8ed it became useless.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The transfer completion callback does not provide a way to pass
transfer status to the transfer submitter.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add a set of macros that can be utilized for any type and redefine
the struct macros to utilize these macros. While the majority of
uses for iterable sections are for structs, there are some cases
where the elements of the section might be a union or some other
type.
Also added <STRUCT|TYPE>_SECTION_<START|END>_EXTERN helper macros to
give a common means to handle setting externs in rare case they
are needed.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Add a new macro called `BT_DATA_SERIALIZED_SIZE` in `bluetooth.h` that
calculate the total size of a serialized `bt_data` given a `data_len`.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
MISRA Rule 5.7 requires uniqueness of tag identifiers. Shell is
frequently problematic because many code uses `const struct shell
*shell`. This causes CI noise every time one of these shell files is
edited, so let's update all of them with `const struct shell *sh`
instead.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
[PR#51217](https://github.com/zephyrproject-rtos/zephyr/pull/51217)
changed the `init_entry` structure, but `Z_INIT_ENTRY_NAME` (called
by `SYS_INIT` or `SYS_INIT_NAMED`) does not initialize all of the
members of the struct, leading to errors when building with
`-Werror=missing-field-initializers`.
Change the macro to initialize the `dev` member to `NULL` so that
all members of the struct are initialized.
Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
__noasan attribute was accidentally removed by
a5fd0d184a. Add it back as it is causing
some address sanitizer issues when using the LLVM toolchain.
Details on why this is needed can be found in
74cc534758.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Some functions such as the ISH power management function needs to
reserve GDT entry place holders which are filled during runtime.
Add config option to define the number of GDT entry place holders
reserved and change the ia32 linker script accordingly.
Signed-off-by: Leifu Zhao <leifu.zhao@intel.com>
- Fix initialization order (C++ requires struct fields to be
initialized in the same order they were declared).
- Fix casting issue in 'for' loop conditions
- Fix casting issues when getting atomic values
Signed-off-by: Yuval Peress <peress@google.com>
Remove deprecated I2C_NODE_MASTER definition. It has shipped deprecated
2 releases (3.2, 3.3) so it can be removed now.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This changes so that generation of RSI now uses LE arrays instead of
uint32 words. Both input and output of rsi and sih genration now uses
LE. This also fixes the generation of RSI for BE systems, which
wasn't working.
Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
Many areas of Zephyr divide and round up without using the DIV_ROUND_UP
macro. Make use of it, so that we make use of a tested system macro and
at the same time we make code more readable.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The init infrastructure, found in `init.h`, is currently used by:
- `SYS_INIT`: to call functions before `main`
- `DEVICE_*`: to initialize devices
They are all sorted according to an initialization level + a priority.
`SYS_INIT` calls are really orthogonal to devices, however, the required
function signature requires a `const struct device *dev` as a first
argument. The only reason for that is because the same init machinery is
used by devices, so we have something like:
```c
struct init_entry {
int (*init)(const struct device *dev);
/* only set by DEVICE_*, otherwise NULL */
const struct device *dev;
}
```
As a result, we end up with such weird/ugly pattern:
```c
static int my_init(const struct device *dev)
{
/* always NULL! add ARG_UNUSED to avoid compiler warning */
ARG_UNUSED(dev);
...
}
```
This is really a result of poor internals isolation. This patch proposes
a to make init entries more flexible so that they can accept sytem
initialization calls like this:
```c
static int my_init(void)
{
...
}
```
This is achieved using a union:
```c
union init_function {
/* for SYS_INIT, used when init_entry.dev == NULL */
int (*sys)(void);
/* for DEVICE*, used when init_entry.dev != NULL */
int (*dev)(const struct device *dev);
};
struct init_entry {
/* stores init function (either for SYS_INIT or DEVICE*)
union init_function init_fn;
/* stores device pointer for DEVICE*, NULL for SYS_INIT. Allows
* to know which union entry to call.
*/
const struct device *dev;
}
```
This solution **does not increase ROM usage**, and allows to offer clean
public APIs for both SYS_INIT and DEVICE*. Note that however, init
machinery keeps a coupling with devices.
**NOTE**: This is a breaking change! All `SYS_INIT` functions will need
to be converted to the new signature. See the script offered in the
following commit.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
init: convert SYS_INIT functions to the new signature
Conversion scripted using scripts/utils/migrate_sys_init.py.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
manifest: update projects for SYS_INIT changes
Update modules with updated SYS_INIT calls:
- hal_ti
- lvgl
- sof
- TraceRecorderSource
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
tests: devicetree: devices: adjust test
Adjust test according to the recently introduced SYS_INIT
infrastructure.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
tests: kernel: threads: adjust SYS_INIT call
Adjust to the new signature: int (*init_fn)(void);
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
rename the function that sets the handler for the nmi.
It should be namespaced and not camel-case:
z_NmiHandlerSet to z_arm_nmi_set_handler
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
In case of recoverable fatal errors the execution should
switch to another thread. This will ensure the current_cpu nested
count is reset when there is a context switch.
Signed-off-by: Aastha Grover <aastha.grover@intel.com>
Commit 53da110dbf deprecated
ceiling_fraction in favor of DIV_ROUND_UP. Apply this to the rtio
header as well.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>