This extends the thread abort hook to support memory mapped
stack. The calculation to find out to which instance of thread
pools the outgoing thread belongs requires physical address.
So find the physical address via the memory mapped stack for
that.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This extends the test for memory mapped stack, as the address of
memory mapped stack object would be different than the actual
stack object.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This extends the test for memory mapped stack, as the address of
memory mapped stack object would be different than the actual
stack object.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This introduces support for memory mapped thread stacks,
where each thread stack is mapped into virtual memory
address space with two guard pages to catch
under-/over-flowing the stack. This is just on the kernel
side. Additional architecture code is required to fully
support this feature.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is similar to k_mem_map()/_unmap(). But instead of using
anonymous memory, the provided physical region is mapped
into virtual address instead. In addition to simple mapping
physical ro virtual addresses, the mapping also adds two
guard pages before and after the virtual region to catch
buffer under-/over-flow.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the mechanism to do cleanup after k_thread_abort()
is called with the current thread. This is mainly used for
cleaning up things when the thread cannot be running, e.g.,
cleanup the thread stack.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Previous commit changed the privileged stack size to be using
kconfig CONFIG_PRIVILEGED_STACK_SIZE instead of simply
CONFIG_MMU_PAGE_SIZE. However, the stack bound check function
was still using the MMU page size, so fix that.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Most places use CONFIG_X86_STACK_PROTECTION, but there are some
places using CONFIG_HW_STACK_PROTECTION. So synchronize all
to use CONFIG_X86_STACK_PROTECTION instead.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This test is intended to teach the conventions and best practices to a
potential contributor that wants to add a test, for say a new feature.
It is liberally commented on purpose, so new contributors don't have to
spend two weeks understanding the intricacies of the simulator, the bsim
test framework, the native builds, backchannels, etc..
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This code can be found (kinda) duplicated all over
`tests/bsim/bluetooth`.
Put it in a common place.
Refactoring the current tests will be done in a future commit.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Improve function which guesses the test name so the calling
script can be invoked from any folder, not just Zephyr's
base.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The "struct sockaddr" should only be used in casts and never
as a standalone variable because it might not have enough
space allocated for all the protocol specific fields.
So refactor the port_in_use() function to reflect that.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
errno values are positive, therefore they should be negated when
assigned as return values for net_dhcpv4_server_start().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fixes some missed renames for overlays with the recent change
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The commit adds dependency on Kconfig FLASH_PAGE_LAYOUT to subsystems
that really require it:
FCB, NVS, LittleFS
and removes direct selection from '*.conf' files where no longer
needed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
`setsockopt` is enabled by `CONFIG_POSIX_API`, use
`zsock_setsockopt` instead, otherwise there will be a
compilation error if `CONFIG_NET_SOCKETS_SOCKOPT_TLS` is
enabled.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
If a clock control device is set in the `clocks` property,
it is used to determine the frequency.
If `fixed-clock` is set for the clocks, we use that value as is.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Introduce the `COMPAT_SPECIFIC_...` macros to determine the function name
from the compatible name.
These macros allow the isolation of device-dependent code in a generic way.
For example, if the compatible name is `ambiq,uart`,
The `COMPAT_SPECIFIC_DEFINE` macro is replaced by `AMBIQ_UART_DEFINE`.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Updated the west.yml file
to add nxp_hal update for pwm
definitions used by devices
LPC5534, LPC5536 and LPC55S36.
The nxp_hal changes lets the PWM
driver be aware that these devices
contain a WAITEN bit in their PWM
register which can be used when setting
up the PWM on init phase.
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Deprecate CAN_MAX_STD_ID/CAN_MAX_EXT_ID macros in favor of
CAN_STD_ID_MASK/CAN_EXT_ID_MASK.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Check if the interface is down before joining IPv4 mDNS multicast
group. This avoids warning later when the network packet cannot be sent.
Fixes#71121
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
We need to use correct SOC name when naming the Kconfig.defconfig*
files.
So we need the following changes:
- mimx8mp -> mimx8ml8
- mimx8mm -> imx8mm6
- mimx8mn -> mimx8mn6
- mimx8mq -> mimx8mq6
Then we also need to take care of qualifiers name. Standard notation
uses "_" instead of "."
e.g : Kconfig.defconfig.mimx8mp.a53 -> Kconfig.defconfig.mimx8ml8_a53
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Treewide changes touching a single area or topic should have the
area/subsystem at the start of the commit message. Treewide is very
ambigous.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adjustments of overlay and conf files to adjust for the MERGE removal.
The revert of MERGE requires specific overlay and conf files for boards
which relied on the MERGE feature.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Adjustments of dts and defconfig files to adjust for the MERGE removal.
The revert of MERGE requires specific dts and defconfig files for boards
which relied on the MERGE feature.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This allow developers to create board files without the SoC name when
the board only defines a single SoC.
This means that a board, such as rpi_pico, which defines only a single
SoC, rp2040, and one variant, now allows the following file names:
Board target: rpi_pico/rp2040
- dts: rpi_pico_rp2040.dts, short: rpi_pico.dts
- defconfig: rpi_pico_rp2040_defconfig, short: rpi_pico_defconfig
- overlay: rpi_pico_rp2040.overlay, short: rpi_pico.overlay
- conf: rpi_pico_rp2040.conf, short: rpi_pico.conf
Board target: rpi_pico/rp2040/w
- dts: rpi_pico_rp2040_w.dts, short: rpi_pico_w.dts
- defconfig: rpi_pico_rp2040_w_defconfig, short: rpi_pico_w_defconfig
- overlay: rpi_pico_rp2040_w.overlay, short: rpi_pico_w.overlay
- conf: rpi_pico_rp2040_w.conf, short: rpi_pico_w.conf
A multi CPU cluster board, nrf5340dk:
Board target: nrf5340dk/nrf5340/cpunet
- dts: nrf5340dk_nrf5340_cpunet.dts, short: nrf5340dk_cpunet.dts
- defconfig: nrf5340dk_nrf5340_cpunet_defconfig,
short: nrf5340dk_cpunet_defconfig
- overlay: nrf5340dk_nrf5340_cpunet.overlay,
short: nrf5340dk_cpunet.overlay
- conf: nrf5340dk_nrf5340_cpunet.conf, short: nrf5340dk_cpunet.conf
A multi SoC board, nrf5340dk (real: nrf52840, emulated: nrf52811):
Board target: nrf52840dk/nrf52840
- dts: nrf52840dk_nrf52840.dts, short: Not possible
- defconfig: nrf52840dk_nrf52840_defconfig, short: Not possible
- overlay: nrf52840dk_nrf52840.overlay, short: Not possible
- conf: nrf52840dk_nrf52840.conf, short: Not possible
If two conflicting files are found, for example both
rpi_pico_rp2040.overlay and rpi_pico.overlay, then an error is raised.
If short form is detected for a board target with multiple SoCs, for
example nrf52840dk_nrf52840.overlay and nrf52840dk.overlay, then an
error is raised.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Splits configuration up that was merged as part of hwmv2 due to
the merged configuration feature being reverted
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This change reverts a change that was introduced with hwmv2 which
allowed for using common board names for overlays, given the board
target ``nrf9160dk@0.7.0/nrf9160/ns``.
In hwmv1 this would have used:
``nrf9160dk_nrf9160_ns.conf``.
``nrf9160dk_nrf9160_ns_0_7_0.conf``.
In hwmv2 this would have used:
``nrf9160dk_nrf9160_ns.conf``
``nrf9160dk_nrf9160_ns_0_7_0.conf``
``nrf9160dk_nrf9160.conf``
``nrf9160dk_nrf9160_0_7_0.conf``
``nrf9160dk.conf``
``nrf9160dk_0_7_0.conf``
With these changes, the following are used (which restores the hwmv1
behaviour):
``nrf9160dk_nrf9160_ns.conf``
``nrf9160dk_nrf9160_ns_0_7_0.conf``
For a board with a default SoC which is not a variant for example
``rpi_pico`` then ``rpi_pico.conf`` will also be used, this file
will not be used for variants e.g. ``rpi_pico/rp2040/w``
This applies to .dts, .conf and .overlay files in the boards
directory, and to .conf and .overlay files in application board
overlay directories.
This revert is needed to avoid issues whereby variants have
incompatible configuration to the parent board target, which has
been affecting samples and tests.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This API is not widely used and it is actually broken since device
runtime power management is not checking it when suspending and
resuming.
On top of that, this API is very close to pm_device_busy* API,
close enough to consolidate in only one API.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Checking if the device state is locked is not correct, device runtime
put / get is no longer checking for it and the only place that was
locking device's state was the pm action callback and if the idea
was to protect some concurrent call, using it is not enough.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
There is no needed to lock/unlock a device state in its pm action
callback. The power management subsystem should take care of
serialize these calls.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>