This clarifies the flashdev out of band read and write interfaces and
updates any consumers of those interfaces. This was partially refactored
at one point and the refactoring didn't extend to the consumers as it
should have.
The mailbox property interface frequently needs to walk variable-sized
property tags contained within a mailbox property message. Add
rpi_get_next_tag() to encapsulate the required pointer arithmetic.
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.
Closes rtems/rtos/rtems#5643
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.
Closes rtems/rtos/rtems#5644
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.
Closes rtems/rtos/rtems#5642
Add smpspinwait01 to thoroughly exercise the new _CPU_Spin_wait()
architectural hint and compiler memory barrier in concurrent SMP
environments.
The test validates:
- Read-Shared bus contention: Verifies that a master core broadcast
wake to secondary cores spinning on a shared cache line cleanly
transitions to exclusive ownership without bus lockups.
- Compiler memory barrier enforcement: Spins on a non-volatile
shared flag to prove RTEMS_COMPILER_MEMORY_BARRIER() prevents
compiler optimization levels >= -O2 from hoisting loads into
core-local registers, avoiding SMP deadlocks.
- MESI cache-line bouncing: Executes a multi-core ring token pass
for 5,000 iterations per core. This forces continuous Modified-to-
Invalid cache invalidation traffic across the interconnect while
cores execute the architecture-specific spin-wait hint.
This patch introduces the `_CPU_Spin_wait()` function to the `no_cpu`
architecture template and adds the corresponding Doxygen documentation
for the CPU Architecture Supplement.
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load. This
function is part of the Deterministic Hedged Read Library API.
When creating utf8 or default converters, if memory allocation or
initialization fails, 'self' becomes NULL. Returning '&self->super'
results in a NULL pointer dereference, which is Undefined Behavior
in C. This updates the code to explicitly check for NULL before
returning.
The previous fix has exposed more breakage if internal
SRAM self-tests is run when code starts from Flash
or external memory. The previous negated option has
disabled SRAM self-test in these cases and enabled
it for code running from SRAM which lead to code
self-clear.
But when code is running from Flash and full safety
should be achieved then then SRAM test run through
nested function
/* ESRAM Single Port PBIST */
tms570_pbist_run_and_check( 0x08300020U,
(uint32_t) PBIST_March13N_SP )
lead to situation when lr and r3 could not be
restored in return from this function.
Memory content has been overwritten by tests.
When this problem has been solved then next
problem is that memory with enabled ECC has
been unsynchronized and attempt to load already
overwritten lr and r3 in tms570_start_hook_0
has led to data-abort and fatal error with error
pin set till next power cycle.
The solution is to synchronize, reinitialize
internal SRAM after PBIST test.
Yer another problem is run of ECC failure detection
tms570_check_tcram_ecc
It fails with unrecoverable data abort as well
because for proper function it requires special
support in data-abort exception handler which
is not present on RTEMS.
Closes rtems/rtos/rtems#5547
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
This commit adds 'HAS_UBOOT' conditional to 'bsp_uboot_getenv' to match
the bsp.h file.
This fixes the following errors:
error: home/tester/bsps/powerpc/shared/u-boot/uboot_getenv.c:73:13:
error: no previous prototype for 'bsp_uboot_getenv'
[-Werror=missing-prototypes]
Updates #5481
Previous commit removed the stale reserved PACT1 macro and added
TMS570_PBIST_PACT_ENABLE for enabling the PBIST internal clocks.
Use the new macro in tms570_selftest.c instead of raw writes.
The supported LS31x and LC43x variants define only PACT0 in the
PBIST PACT register. Bits 31:1 are reserved.
Remove the stale TMS570_PBIST_PACT_PACT1 macro. Add
TMS570_PBIST_PACT_ENABLE so callers can enable the PBIST
internal clocks without using a raw literal.
calls to tms570_irq_set_priority protect against requesting a
priority < 2, but not against inputs with vector < 2.
for example calling tms570_irq_set_priority(ESM_HIGH, 10)
will not only get through the guard, it will attempt to write
to CHANCTRL0 (which gets blocked by hardware), puts whatever
was there (apparently hardcoded INT-REQ0) into channel 10,
and returns success.
So the channel 10 request dissappeared from the VIM channel
map completely - yet this call returns RTEMS_SUCCESSFUL
TRM (for both TMS570LS31x and TMS570LC43x) states:
NOTE: CHAN0 and CHAN1 are hard wired to INT_REQ0 and
INT_REQ1, so they cannot be remapped.
This commit puts a guard to fail on requests with vector < 2.
uboot_environment and uboot_environment_size are configured through
build options UBOOT_ENV_BASE and UBOOT_ENV_SIZE.
Support for powerpc/qoriq is added.
For qoriq boards with u-boot, user can use the same environment
access fuctions shared with other bsps like gen83xx.
Closes#5481
The RTC driver used the unsupported BSD-style %b conversion with
only the diagnostic register value. This did not provide the
intended bitmask decoding.
Print the diagnostic register as a two-digit hexadecimal value
instead and remove the unused RTCDG_BITS definition.
The block logic uses realloc to resize memory used by libdebugger
when creating a snapshot of threads. Thread registers take a
reference to the block and if a realloc changes the base address
any references are invalid. Add rebase handler support to blocks
that is called when the block base changes and add a handler to
thread register blocks to rebase a thread's registers.
Exclude threads using both types of names they can have. This lets
all names be reported in extra thread info packets.
Closes#5635
More i2c drivers from cpukit to bsps/shared to allow them use BSP
infrastructure if needed. The framework code i2c-bus.c and i2c-dev.c
kept at its original location.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Move CAN controllers from cputik to bsps/shared directory. This will
allow to use BSP level interface which may be needed for some
controllers. Generic CAN stack implementation is still kept in the
original directory as this shoudl be independent from the low level
driver interface.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Extend the existing open() O_NOFOLLOW coverage to verify that a hard
link to a regular file is still resolved to its target, while symbolic
links remain subject to the O_NOFOLLOW check. This is the regression
test for the do_open() fix that uses RTEMS_FS_FOLLOW_HARD_LINK instead
of zero for the O_NOFOLLOW case.
The test writes a known marker to the regular file, creates a hard link
to it, opens the hard link with O_NOFOLLOW, and then checks both the
inode identity and the file contents read back through the descriptor.
Reading the contents is the part that actually distinguishes a correct
resolution from the bug. In the IMFS a hard link is a distinct node
(IMFS_node_control_hard_link) whose fstat handler forwards to the target
(IMFS_stat_hard_link), but whose read and mmap handlers are the default
ones that fail with ENOTSUP. When open() wrongly clears the follow flags
for O_NOFOLLOW, path evaluation stops at the hard link node instead of
resolving it, yet fstat() still reports the target's mode and inode. A
test that only checks st_mode/st_ino therefore passes even with the bug
present. Reading the marker back forces the descriptor to refer to the
real regular file, so the test fails (read returns ENOTSUP) unless the
hard link was actually followed.
When O_NOFOLLOW is used, open() should only prevent following
symbolic links. Hard links are still ordinary directory entries and
should continue to resolve to the target object.
Switch the follow flags from zero to RTEMS_FS_FOLLOW_HARD_LINK so the
path evaluator keeps hard links working while suppressing symbolic link
following.
Add a validation test for rtems_barrier_get_number_waiting() based on an
action requirement.
Update #5336.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de
The CAN/CAN FD stack requires a worker task per configured queue.
Empirical profiling confirms the CAN worker task utilizes ~404 bytes
of stack space on 32-bit architectures.
This patch introduces CONFIGURE_MAXIMUM_CAN_QUEUES to dynamically
inject the required CAN worker tasks into the master _CONFIGURE_TASKS
pool. Because the 404-byte usage falls below RTEMS_MINIMUM_STACK_SIZE,
provisioning them as standard system tasks automatically guarantees
sufficient stack space overhead.
Additionally, this patch removes the hardcoded +0x1000 stack padding
in rtems_task_create to prevent workspace exhaustion, and adds the
spcan01 test to verify the CONFIGURE_MAXIMUM_CAN_QUEUES macro behavior.
Closes#5193
Drop dependency on C library for div(). The _mktime_div() implementation
is in line with glibc, musl, and FreeBSD.
Update #5143.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
The fsclose01 test program contains general test cases for fclose(). It
does not depend on a particular filesystem.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>