Fixes a typo in board_porting.rst
Fixes wrong syntax for file markup element
in build-flash-debug.rst
Signed-off-by: Suryansh Sharma <suryansh@evilscientist.cc>
This commit partially reverts the changes introduced in
(bbe1a19786), where the PSP
modification, the interrupt enabling, and the branch to main
thread were refactored in C functions. This introduced an issue
with stack usage when compiling without any optimization.
Reverting to use assembly functions to jump to main thread
ensures, now, that the pointer to main() is preserved intact
while changing the PSP and passed correctly to z_thread_entry().
Fixes#14471.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit simply moves the MPU re-programming of
dynamic regions during initialization to occur right
before switching PSP to the main thread stack. As a
result, the MPU re-programming will execute using
the interrupt stack. No functional changes are
introduced.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
There's a BT_DBG that will output the value of pub_addr before its ever
set to anything. Remove output of pub_addr from BT_DBG().
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add framework for device Idle Power Management(IPM)
for suspending devices based on device idle. This will
help in saving power even while system(CPU) is active.
The framework uses device_set_power_state() API set the
device power state accordingly based on the usage count.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.
To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.
This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
The clang ARM assembler is a bit stricter than GNU as, make a few
changes so things build with both
Signed-off-by: Peter Smith <peter.smith@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If pkt allocation fails, then prepare to handle NULL pointer.
Coverity-CID: 195844
Fixes#14405
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
efm32pg_stk3402a and lpcxpresso54114_m0 board yaml files didn't set
xtools under the toolchain category, fix that.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Architecture defconfigs are not used anymore and are stale. Remove them
to avoid confusion.
Related to #14442
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
select() is a rather peculiar construct, defining/depending on many
types and symbols. Making that to coexist with POSIX subsystem is
an ongoing challange. To facilitate that, let's split those
definitions to a separate header (which e.g. can be included without
including all the rest of socket defines).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commit fd1401495b ("net/tcp: Move net_tcp_set_hdr() away from net
core") removed <net/tcp.h>. This results in a not found error being
generated when CONFIG_NET_TCP is enabled.
We also, don't need to include <net/udp.h> anymore due to new
net_pkt API changes.
Let's clean up the includes by removing both of them.
Signed-off-by: Michael Scott <mike@foundries.io>
Socket-based API sends timeout K_FOREVER(-1) to net_context_connect()
function where previously net_app APIs used an actual timeout value.
Now that we've switched to socket-based APIs, we reveal poor handling
for the timeout value which causes an error in the WNC-M14A2A driver
due to math performed on the -1 value.
Let's be sure to check for valid timeout values prior to performing
math and then make sure it falls within the allowable range of values
for the AT@SOCKCONN command (30 seconds to 360 seconds).
Signed-off-by: Michael Scott <mike@foundries.io>
In commit c1f24abb13 ("drivers: modem: wistron kconfig separation"),
A single line of the WNC-M14A2A congigs was left in the main modem
Kconfig.
Let's clean up the Kconfig file by removing the left over.
Signed-off-by: Michael Scott <mike@foundries.io>
CONFIG_GPIO may not be enabled on some HW, so let's make sure to
enable it if the dependencies are met, as the WNC-M14A2A driver
needs to set power, reset and other GPIOs.
Signed-off-by: Michael Scott <mike@foundries.io>
No need to build the net_pkt, just send the buffer directly.
Let's reuse already parsed ip/proto headers as well.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No need to build the net_pkt, just send the buffer directly.
Let's reuse already parsed ip/proto headers as well.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Using new net_pkt r/w API and so on.
This sample would still need to be using socket API instead.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Some function return values were not handled. Added assert in case
those functions return error. It is possible only if same ring buffer
instance is used without any protection from multiple contexts.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
PyYAML 5.1 was just released and it doesn't support !include as
previous versions do. This breaks our DTS bindings parsing.
Let's fix our extract_dts_include.py script to work with both
3.13 and 5.1.
Also, update the pyyaml requirement to >=3.13 to be sure we're
compatible.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/14496
Signed-off-by: Michael Scott <mike@foundries.io>
User mode-related API functions have been renamed to use the
'z_' prefix, so we need to update the architecture porting
guide accordingly.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Let folks know that using amend and force pushes for adding review
changes is the recommend method for contributing to the project, but it
can cause some unexpected behavior from GitHub.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Corrections in the documentation of arguments in
Z_SYSCALL_MEMORY, Z_SYSCALL_MEMORY_READ, and
Z_SYSCALL_MEMORY_WRITE macros.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit enhances the documentation of z_arch_buffer_validate
describing the cases where the validation is performed
successfully, as well as the cases where the result is
undefined.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
We needed to add support for the RV32M1_LPTMR_TIMER to the test so its
knows what the IRQ of the timer is.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Apply a similar fix to commit 0289a410ba
to the openisa_rv32m1 linker script for handling .srodata sections.
Otherwise we get oprhan read-only data section. Fix this by adding
the .srodata section to the RISC-V linker script.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This turns on the linker flag to sort sections by alignment
in decreasing size of symbols. This helps to minimize
padding between symbols.
This also adds the linker options to sort common symbols by
alignment in descending to minimize the need for padding.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
During testing with sorting section by alignment with qemu_nios2,
if rodata section is not aligned on 4-byte boundary and its size
not of multiple of 4, it would never boot correctly. So align
the rodata here. This is in preparation to enable the linker
option to sort sections by alignment.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The shared page is inherently used in multiprocessor contexts where
the compiler optimizer can trip us up (specifically, a spin on
num_active_pus was being hoisted out of the loop on some gcc's). Put
the volatile declartion into the struct pointer itself instead of
relying on the code to get it right.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
We can turn this off in application code, but the default should be
SMP.
Oddball note: the SMP setting is in the soc layer and not arch, even
though I think it would be better there. We don't actually have a
per-arch defconfig file included by kconfig.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The various tests would all do a "wait for threads to exit" step
before checking the results, but this was implemented with a simple
busy wait that turns out to need careful tuning (because there was
busy waiting in the threads).
Rather than try to synchronize this, white box the issue (it's a low
level SMP test, after all) by spinning on the thread states directly
watching for the kernel to flag them dead. The downside here is that
if the process fails for some reason we'll get a hang and a timeout
reported from sanitycheck and not a synchronous ztest assertion. But
in return, successful tests run much faster and I don't need to worry
about how to tune them for IPI latency on different platforms.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This case was predicated on a mistake. The behavior of k_wakeup() has
always been NOT to wake up threads that are "pending" on a wait queue,
only ones blocked on a timeout in k_sleep(). As written, this test
case could never pass.
(Really there's no good reason for that. It seems reasonable to me to
expect wakeup to work symmetrically, and the docs are sort of
ambiguous on the subject. But the code in k_wakeup() is clear:
threads flagged pending get an early exit and the call becomes a
noop.)
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This was always doing a remove/add of the _current thread to the run
queue, which is wrong because in SMP _current isn't in the queue to
remove. But it went undetected until the recent dlist changes.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
In SMP, we are setting the _current pointer while holding the
scheduler spinlock locally, which means that when we try to release it
the validation layer (not the spinlock per se) will scream at us
because the thread that took the lock doesn't match the one releasing
it.
Special case this when validation is enabled.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The k_spin_lock() validation was setting the new owner of the spinlock
BEFORE the actual lock was taken, so it could race against other
processors trying the same thing. Split the modification step out
into a separate function that can be called after we affirmatively
have the lock.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
There was a test-created thread that wasn't including this. It's a
huge stack and doesn't overflow (though I thought briefly that it
was), but it's a rule that we need to have that buffer and I'm trying
to fix these as I find them.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>