The macro obtains the toolchain specific flag and value for
setting of the requested c standard.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
Initialize the net_pkt cursor to begining after net_pkt_write.
Without which recv_cb can't peek/get net_pkt
Signed-off-by: Parthiban Nallathambi <parthitce@gmail.com>
We need to be able to force certain versions based on the branch and
code base being used. For example for 1.14 we will need to apply some
fixes or revert some commits that may only apply to master.
Next step is also adding this to 1.14 branch and use a working commit.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
To avoid and minimize conflicts when items are always added to the
bottom of the list, order things alphabetically.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Cleanup references to boards in some of the example and use the same
boards through the examples. Other minot cleanups and make the text more
generic and not specific to certain boards.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
On 64-bit systems the most notable difference is due to longs and
pointers being 64-bit wide. Therefore there must be a distinction
between ints and longs.
This patch:
- Make support functions take a long rather than an int as this can
carry both longs and ints just fine.
- Use unsigned values in _to_x() to cover the full unsigned range
and avoid sign-extending big values. Negative values are already
converted to unsigned after printing the minus sign. This also makes
division and modulus operations slightly faster.
- Remove excessive casts around va_arg() and use proper types with it.
- Implement the l and z length modifiers as they're significant on
64-bit targets. While at it, throw in the z modifier as well.
Since they all come down to 32-bit values on 32-bit targets, the
added code should get optimized away as duplicate by the compiler
in that case.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Because of how generate defines for instances its possible that we have
a name conflict if the instance ID and reg addr space clash.
For example on qemu_x86 there are current two 'soc-nv-flash' nodes and
one is at reg addr 0, but instance id 1, the other is reg addr 0x1000
and instance id 0. We'd possibly get this conflict:
For the 'soc-nv-flash' at 0x1000 (instance 0):
(instance define)
#define DT_SOC_NV_FLASH_0_BASE_ADDRESS 0x1000
For the 'soc-nv-flash' at 0x0 (instance 1):
(address define)
#define DT_SOC_NV_FLASH_0_BASE_ADDRESS 0x0
To deal with this we make sure that the lower reg address is instance 0,
than things work out ok. To handle this case, if we sort the instance
IDs based on reg addr than if we have something at reg addr 0, it will
also than be an instand ID 0.
The longer term solution will be to deprecated the old defines and
remove the conflict between instance ID defines and normal DT defines.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The neighbor cache did not contain link address type. This is not
causing problems atm but good to fix anyway.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Port the implementation that performed random backoff of
forced slave event scheduling.
When peer master implementation skips events, multiple
local overlapping slaves will randomize their forced
scheduling to break out of a round robin pattern increasing
the chance of synchronizing with their masters again.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Final step of linker abstraction:
* Abstract zephyr_lnk by including it in toolchain_ld_link_elf.
* Abstract relevant uses of target_link_libraries.
* Introduce toolchain_ld_force_undefined_symbols.
No functional change expected.
This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
For the request:
DCID shall map to rx.cid:
'This field specifies the endpoint of the channel to be disconnected
on the device receiving this request.'
SCID shall map to tx.cid:
'This field specifies the endpoint of the channel to be disconnected
on the device sending this request.'
For the response when receiving the roles are inverted.
Fixes#16799
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Changed ticker behavior to resolve conflicts in ticker_worker instead of
in ticker_job. This allows better real-time slot allocation, as well as
allowing callbacks even if ticker node doesn't get air-time (for audio
stream housekeeping). A priority property now also allows prioritizing
one ticker node over others.
Signed-off-by: Morten Priess <mtpr@oticon.com>
The macro is intended to abstract the -fno-common compiler option
which controls the placement of uninitialized global variables. The
macro leaves it up to the toolchain to define the option.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
Fix scan requests being processed during directed advertisiments.
Directed advertise packets are not scannable
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
It is possible that iface is NULL when selecting IPv4 destination
address for a sent packet.
Coverity-CID: 198877
Fixes#16570
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This adds number of matches as optional parameter to gatt show-db:
> gatt show-db 2803 1
attr 0x005065f0 handle 0x0002 uuid 2803 perm 0x01
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Number of matches was not being properly handled causing the callback to
be called more than specified by the caller.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit rewrites the documentation section describing
the Shared FP registers mode for Cortex-M to align with the
latest architecture rework of Shared FP mode.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
We can now invoke k_float_disable(.) for ARM platforms,
too, since we introduced the function as a cross-arch
system call.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit adds the architecture-specific implementation
of k_float_disable() for ARM and x86.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Support for Floating Point (both un-sharing and sharing
registers mode) is currently implemented for ARM and X86
architectures, so reflect this in the Kconfig symbol
definition.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
We introduce k_float_disable() system call, to allow threads to
disable floating point context preservation. The system call is
to be used in FP Sharing Registers mode (CONFIG_FP_SHARING=y).
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
When building without support for user mode (CONFIG_USERSPACE=n)
we need to correct the starting address of the MPU Guard, before
passing it to the function that evaluates whether a stack
corruption has occurred. The bug was introduced by commit
(60bae5de38) in
PR-13619, where the start address of the MPU guard was properly
corrected, but the guard start at the corresponding stack-fail
check was not adjusted accordingly.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Using void pointers as universal arguments is widely used. However, when
compiling a 64-bit target, the compiler doesn't like when an int is
converted to a pointer and vice versa despite the presence of a cast.
This is due to a width mismatch between ints (32 bits) and pointers
(64 bits). The trick is to cast to a widening integer type such as
intptr_t and then cast to
void*.
When appropriate, the INT_TO_POINTER macro is used instead of this
double cast to make things clearer. The converse with POINTER_TO_INT
is also done which also serves as good code annotations.
While at it, remove unneeded casts to specific pointer types from void*
in the vicinity, and move to typed variable upon function entry to make
the code cleaner.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The INT_TO_POINTER and POINTER_TO_INT macros must accommodate larger
pointers on 64-bit systems that don't fit into an int.
In the INT_TO_POINTER case, we have to use an extra cast to intptr_t
as an intermediate widening type to avoid complaints from the compiler
when converting from an int.
This change makes no difference on 32-bit systems.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Since the bt_mesh_msg_ctx struct no longer has a size that is a
multiple of 2, the bitfields might as well be made to normal types
as this will minimize the code generated to access them.
Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
By moving the rssi value from the bt_mesh_net_rx struct to the
bt_mesh_msg_ctx struct, it will be available to applications via
the mesh op callbacks.
Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
The macro is intended to abstract the -imacros compiler option for
inclusion of the autoconf.h header file. The abstraction allows for a
given toolchain to decide how the inclusion of the header file is to
be done.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
The query->len does not take 'Terminator' into account, shift over
one byte to prevent overwriting it with next field (Type).
This fixes mdns_resolver sample.
Fixes: 87eb552dd2 (net/dns: Switch mdns responder to new net_pkt API)
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
The attribute handle used to read next attribute has to be incremented
to not loop reading the same attribute.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
When trying to establish friendship the Friend must respond to the
initial Friend Poll with a Friend Update. If this initial Friend Update
response is not received the Friendship establishment process must start
again.
When starting a second Friendship establishment processes the `sent_req`
field of the `lpn` struct was left set to `TRANS_CTL_OP_FRIEND_POLL`.
This prevented the initial Friend Poll being sent out on the second
attempt. Since the Friend Poll was not sent, no timeout is set and
nothing happens ever again. No more Friendship Requests are sent.
This commit clears `sent_req` back to zero when no Friend Update
response has been received after the initial Friend Poll.
Fixes#16678
Signed-off-by: Rich Barlow <rich@bennellick.com>
Add some missing fatal asserts that need to be caught to
avoid unexpected failures in the implementation of the
architecture.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The macro is intended to abstract the -ffreestanding compiler option
which tells the compiler that this is a bare metal env. The option is
compiler and thus toolchain specific, but this macro leaves it up to
the toolchain to decide the value of the option.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
Structures to which this applies contain pointers. So the alignment
should depend on pointer width. On 32-bit builds this remains the same.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Place audio buffers in LPSRAM using linker section attribute
for the 2-way audio sample application
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Place audio buffers in LPSRAM using linker section attribute
for the I2S audio sample application
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Place audio buffers in LPSRAM using linker section attribute
for the digital mic audio sample application
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Add dts fixup definitions for low power sram base address and size
- DT_LP_SRAM_BASE
- DT_LP_SRAM_SIZE
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>