As the pointer to the data buffer passed to k_pipe_put() is now a
'const', that buffer must be initialized before calling k_pipe_put()
to avoid a compiler warning.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This follows the idea to remove any z_ prefix. Since MMU has
a large number of these, separate out these changes into one
commit to ease review effort.
Since these are no longer have z_, these need proper doxygen
doc. So add them too.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
How cache test could be ran without CONFIG_CACHE_MANAGEMENT?
Adding qemu_x86/x86_64 as cache related API in x86 has proven to be
very brittle against changes recently: no test was at least verifying
it builds properly, not to mention running it.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Updated the tests to use info from the devicetree or Kconfig as
ground truth and compare that with the output from the
functions under test.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Assert that the `local_irq` of each levels should only ranges
from `0` to `CONFIG_MAX_IRQ_PER_AGGREGATOR`, so that it doesn't
overflow the other aggregators.
Also, assert that the output of `z_get_sw_isr_table_idx` shouldn't
overflow the ISR table.
Update the `sw_isr_table` tests to test the range of
`CONFIG_MAX_IRQ_PER_AGGREGATOR` instead of the entire range of
level bits.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Split the `sw_isr_irq_parent_table` test into one that tests
the IRQ table index function which is generic and should
always be tested, and one that tests multi-instance -related
functions which only work in interrupt controller drivers that
has multi-instance implementation.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This option (CONFIG_HEAP_MEM_POOL_SIZE) is not used for the tests.
Moreover it overrides the option, specified in the board's Kconfigs.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Test consistently fails with timeout for board `hifive1`, so exclude
this board until fixed.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This board have an NXP MPU with 8 configurable regions, of which five
of them are already used by the static MPU configuration. Many of
these tests are failing due to lack of MPU regions or free partition
slots available, even when HW stack protection is disabled when
building with userspace support.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
When testing k_busy_wait(100), don't require that at least 100µs of CPU
time be consumed by the thread itself; some of that time may be used
elsewhere in the system. Instead, just make sure that at least 80µs is
accounted to the thread and allow 20µs to get used elsewhere.
Signed-off-by: Keith Packard <keithp@keithp.com>
Swith integration_platforms from native_posix(_64)
to native_sim(_64).
And replace it also in a comment.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This test needs to include zephyr/kernel/mm/demand_paging.h, not
zephyr/kernel/mm.h, due to its use of k_mem_pin().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This moves including of demand_paging.h out of kernel/mm.h,
so that users of demand paging APIs must include the header
explicitly. Since the main user is kernel itself, we can be
more discipline about header inclusion.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
qemu_x86_tiny has very limited memory resources; if too much text is
included in this test, it will not have enough remaining memory to run
it.
When using picolibc before 1.8.5, the only way to get 'long long' support
was to use the full version, including floating point support. This is too
large for this testcase.
Reduce the size of the printf code by switching to the version without
64-bit integer support. This allows the test to pass when using older
picolibc versions, such as that included with SDK version 0.16.3.
Signed-off-by: Keith Packard <keithp@keithp.com>
This enables tests/kernel/mem_protect/mem_protect to be tested
on Xtensa.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This test requires architecture specific code to work.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
In minimal mode, format modifiers are not supported, leading to a lack
of width and precision support.
long long values are presented correctly in either long long or floating
mode.
Signed-off-by: Keith Packard <keithp@keithp.com>
This moves the k_* memory management functions from sys/ into
kernel/ includes, as there are kernel public APIs. The z_*
functions are further separated into the kernel internal
header directory.
Also made a quick change to doxygen to group sys_mem_* into
the OS Memory Management group so they will appear in doc.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Change the stdev tolerance stdev from 10 to 33 when npcx timer is used.
This is because the clock source of npcx event timer, which is used to
generate the timeout interrupt, is running at 32.768 KHz.
(i.e. 1 count = ~30.5 us.) The conversion from the absolute system timer
to the event timer count might have -30.5 ~ 30.5 deviation.
The tolerance setting is under the assumption that test sampes are
evenly located at 1030.5 and 969.5 for the worst case.
Fixes#59594
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
`test_isr_dynamic` for `CONFIG_GEN_SW_ISR_TABLE=n` was somehow
overlooked in commit b7f1e98724.
I'm disabling the irq at the end of the test. The babblesim for the
`nrf5340bsim_*` target walked into a timeout otherwise.
Signed-off-by: Greter Raffael <rgreter@baumer.com>
Relocate new and existing internal software-managed table
access functions from the public `sw_isr_table.h` into a
private header that should only be accessed internally.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Validate the following functions in the sw_isr_table:
- z_get_sw_isr_table_idx
- z_get_sw_isr_device_from_irq
- z_get_sw_isr_irq_from_device
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Disable the quadspi mpu region of the nucleo_f746zg
when testing the samples/userspace/shared_mem
or tests/kernel/mem_protect/userspace
The stm32f7 cortex M7 has 8 MPU regions and the one for quadspi prevents
the testcase to PASS.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Replace combination of printk() and TC_PRINT() to LOG_DBG() disabled
by default so that it does not affect execution time.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Most of the local functions are static, make code consistent by making
remaining functions static as well.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Since userspace is not enabled change ZTEST_USER to ZTEST to not
confuse people, other tests are also ZTEST.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The test_multi_thread_send_get() test sends and receives mbox messages
with K_FOREVER as timeout, so k_sleep() is not needed here.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
k_mbox_get() / k_mbox_put() get timeout as is, so there is no need for
extra code. Also check that k_mbox_put() actually sends message.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Added test to verify that the value of atomic_t will be the same
in case of overflow if incremented in atomic and non-atomic manner
Signed-off-by: Alexander Razinkov <alexander.razinkov@syntacore.com>
Added test to verify the spinlock acquisition fairness
in relation to the CPUs contending for the spinlock.
This test is only enabled for Ticket Spinlocks which
required to provide such kind of fairness.
Signed-off-by: Alexander Razinkov <alexander.razinkov@syntacore.com>
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>