Commit Graph
38223 Commits
Author SHA1 Message Date
Kinsey Moore 098ba8472d cpukit/flashdev: Clarify interface and update consumers
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.
2026-07-27 12:15:22 +10:00
Shaunak Datar baeeb5db18 bsps/aarch64/raspberrypi: Update framebuffer interface to use new macros
Update the framebuffer interface to use the new tag specific offset
macros.
2026-07-24 18:06:11 +00:00
Shaunak Datar f01ecf0d2d bsps/aarch64/raspberrypi: Add offset macros for property tags
Add tag specific offset macros to the property tag interface.
2026-07-24 18:06:11 +00:00
Shaunak Datar 916ae1e223 bsps/aarch64/raspberrypi: Update the framebuffer interface to new macros
Update the framebuffer interface to use the new macros added to the
mailbox.h for the property tags.
2026-07-24 18:06:11 +00:00
Shaunak Datar 626034a530 bsps/aarch64/raspberrypi: Add size macros for the property tag interface
Update the mailbox header to include macros for the size of each
property tag.
2026-07-24 18:06:11 +00:00
Shaunak Datar 7e9b5d7d9d bsps/aarch64/raspberrypi: Add framebuffer driver
Add a framebuffer driver for the Raspberry Pi 4 BSP using the VideoCore
mailbox property tags interface.
2026-07-24 18:06:11 +00:00
Shaunak Datar 140dc98f71 bsps/aarch64/raspberrypi: Add framebuffer specific mailbox property tags
Add the mailbox property tags required by the framebuffer driver.
2026-07-24 18:06:11 +00:00
Shaunak Datar 5ffebbf757 bsps/aarch64/raspberrypi: Add mailbox property tag iterator helper
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.
2026-07-24 18:06:11 +00:00
Wayne Thornton 2eba833517 cpukit/score/.../cpu.h: Add _CPU_Spin_wait to i386
Added _CPU_Spin_wait() assembly function to i386 architecture
and updated smpspinwait01.yaml to build test for i386
2026-07-24 08:13:39 -06:00
Wayne Thornton b562938eeb cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_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
2026-07-23 17:09:23 -06:00
Wayne Thornton a1635abadd cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_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
2026-07-23 16:40:26 -06:00
Wayne Thornton 95b8aa4b10 [arm] cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_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
2026-07-23 16:25:04 -06:00
Wayne Thornton 33205ab2ef testsuites/smptests: Modify smpspinwait01 test to use Classic API
As a result of review comments, changes made to test in order
to utilize RTEMS_BARRIER_CREATE and other Classic API functions
2026-07-23 16:09:49 -06:00
Wayne Thornton 8e7ba95423 testsuites/smptests: Add smpspinwait01 test
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.
2026-07-23 08:12:13 -06:00
Wayne Thornton 286d1a039d score/cpu: Add _CPU_Spin_wait() to no_cpu template
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.
2026-07-23 08:12:13 -06:00
Wayne Thornton 4e9ee786f6 cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_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.
2026-07-23 08:12:13 -06:00
Avi Weiss 2731c65d39 cpukit/contrib/inlude/sys/exec_elf.h: add missing macro parentheses
Missing parentheses from macro defintion.

Note: the upstream (NetBSD) is already corrected.
2026-07-23 08:55:59 -05:00
Yang Zhang 51f2c6757b dosfs: Avoid NULL pointer dereference UB
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.
2026-07-23 13:51:31 +00:00
Pavel Pisa edb1a8bdcd bsps/arm/tms570: fix self-test to work when internal SRAM is tested
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>
2026-07-22 17:31:59 +02:00
Vijay Banerjee 4840472319 shared/u-boot: Cleanup unused function
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
2026-07-20 10:36:24 -05:00
Avi Weiss cad4022a15 bsps/arm/tms570: selftest.c file comment typo correction
No code changes.
2026-07-15 15:42:36 +00:00
Avi Weiss 705cff7a90 bsps/arm/tms570: fix misnamed PBIST RINFOU register
Minor fix for clarity - the actual register name is RINFOU, not
RINFOUL.
2026-07-15 15:42:36 +00:00
Avi Weiss 08b4006896 bsps/arm/tms570: update pbist header comment typos
Comment fixes only.
2026-07-15 15:42:36 +00:00
Avi Weiss f03c755152 bsps/arm/tms570: use PBIST PACT enable macro in selftest
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.
2026-07-15 15:42:36 +00:00
Avi Weiss a9a381a38a bsps/arm/tms570: remove reserved PBIST PACT bit macro
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.
2026-07-15 15:42:36 +00:00
Avi Weiss 305224bb62 bsp/arm/tms570: documentation updates (out-of-date @retvals)
Some retval's have come out of date after refactors. Correct them.

No code/logic changes, doxygen only.
2026-07-12 15:46:17 +03:00
Avi Weiss 3d5a8ed674 bsp/arm/tms570: apply snake_case to variable names in irq.c
Apply snake_case formatting to names in irq.c for clarity, to
align with RTEMS style guide and to ease future maintenance.
2026-07-12 15:46:17 +03:00
Avi Weiss 8244f83e3d bsp/arm/tms570: add leading underscore to CPP macro paramaters
Add leading underscore to preprocessor macro paramater names
as per RTEMS style guide.
2026-07-12 15:46:17 +03:00
Avi Weiss 34510f3ec2 bsp/arm/tms570: apply RTEMS clang_format to irq.c
Ease future maintenance by standardising the formatting
according to RTEMS guidelines.

No logic changes in this commit, only clang-format applied.
2026-07-12 15:46:14 +03:00
Avi Weiss e07f69641b bsp/arm/tms570: protect against vector < 2 in irq_set_priority
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.
2026-07-12 15:45:29 +03:00
Chris Johns 155f798c0a libdebugger: Add TCB to extra thread info
Closes #5639
2026-07-09 16:43:02 +00:00
Ran Hong b4e6231d23 bsps/powerpc: Update and add the u-boot support
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
2026-07-09 13:43:33 +00:00
Chris Johns 020b094c5f libmisc/cpuuse: Fix thread names in top
- Show classic and POSIX thread names working around the mess we now
  have with the name management in threads

Closes #5637
2026-07-09 09:22:33 +10:00
Yang Zhang 0c6821f020 bsps/pc386: Fix RTC diagnostic format
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.
2026-07-08 20:32:25 +00:00
Chris Johns 11d1425d3f libdebugger: Format AARCH64 supportin the libdebugger style
Fix some of the spelling.
2026-07-08 02:08:20 -04:00
Chris Johns c98f9f6ce4 libdebugger: Align the warning formatting with libdeugger
Fix some of the spelling.
2026-07-08 02:08:20 -04:00
Chris Johns 3b0de038c7 libdebugger: Fix corruption of thread registers with 32 or more threads
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
2026-07-08 02:08:20 -04:00
Michal Lenc 7f98bd8469 i2c: move drivers from cpukit to bsps/shared
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>
2026-07-02 18:33:01 -05:00
Michal Lenc 5ebf57e2af can: move drivers from cpukit to bsps/shared
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>
2026-07-02 18:33:01 -05:00
Cheng Mingming 641f589b37 psxfile01: Add hard link O_NOFOLLOW regression
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.
2026-07-02 18:30:03 -05:00
Cheng Mingming 4ef704aac4 cpukit/libcsupport: Keep hard links with O_NOFOLLOW
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.
2026-07-02 18:30:03 -05:00
Sebastian Huber 5ea6c565f6 validation: Test rtems_barrier_get_number_waiting()
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
2026-07-02 17:55:53 -05:00
M Mithilesh 77eda6f760 cpukit/confdefs: Add CAN stack resource calculation
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
2026-07-02 17:36:27 -05:00
Sebastian Huber 0a0b69aeb0 contrib/cpukit/posix-newlib: Use local div()
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>
2026-07-02 17:24:27 -05:00
Sebastian Huber dfa323c7d5 cpukit: Reformat header with clang-format
Reformat `<rtems/extension.h>` with clang-format.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-07-02 21:18:50 +00:00
Sebastian Huber 184957d88d fstests: Remove duplicate test program
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>
2026-07-01 04:12:42 +02:00
Chris Johns 2f16291408 powerpc/beatnik: Convert MOTLoad GEV variables into env variables
Closes #5573
2026-06-27 09:46:32 +10:00
Sebastian Huber dd5b257aaf libi2c: Fix unused parameter error
Fix the following errors:

```
cpukit/libi2c/libi2c.c: In function 'rtems_i2c_init':
cpukit/libi2c/libi2c.c:162:29:
error: unused parameter 'minor' [-Werror=unused-parameter]
  162 |   rtems_device_minor_number minor,
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
cpukit/libi2c/libi2c.c:163:29:
error: unused parameter 'arg' [-Werror=unused-parameter]
  163 |   void                     *arg
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
```

Update #5387.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-26 04:17:08 +02:00
Aaron Nyholm ed072a2501 iodev: Add iodev driver
Add iodev driver and related test
2026-06-25 17:37:09 -05:00
Vijay Banerjee 4a513030e2 mvme3100: Initialize libi2c at device driver order
To use the libi2c, application needs to be configured with

 #define CONFIGURE_APPLICATION_NEEDS_LIBI2C_DRIVER

Update #5387
2026-06-25 09:51:58 -05:00