Commit Graph
1672 Commits
Author SHA1 Message Date
Sebastian Huber 998f33a14f score: Recognize the clang analyzer
Define RTEMS_STATIC_ANALYSIS for the clang analyzer. For example, this
helps to reduce false positives related to dead branches.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 15:04:51 +00:00
Mazen Adel Elmessady b7233f9f03 cpukit: fix compilation error for BSPs that use wkspaceinitmulti.h
fix compilation error for BSPs that use wkspaceinitmulti.h
like the arm/altcycv_devkit
2026-08-18 21:40:08 +03:00
Mazen Adel Elmessady 1be9a4d989 cpukit/include: Refactor heapimpl.h
This commit splits heapimpl.h
to heapimpl.h and heapfirstfitimpl.h.
By moving first-fit-specific definitions into
heapfirstfitimpl.h and keeping only generic
heap helper definitions in heapimpl.h.

Updates:
rtems/rtos/rtems#5620
2026-08-15 20:52:02 +03:00
Samuel Viegas 2aca6495ae score: Use uintptr_t type for TLS DTV generation number
- Change TLS_Dynamic_thread_vector
generation_number from uint32_t to uintptr_t.

- Using a machine-word type resolves the FIXME concern
about correctness across architectures, since uintptr_t
is guaranteed to match size on both 32-bit and 64-bit
targets.

Updates #4827
2026-08-13 18:21:38 -05:00
Samuel Viegas 05bd049a02 rtems/msgq: Reject oversized MP queues and add mp11 coverage
- Removed #if 1 clause and error comment section.

- Updated the RTEMS_INVALID_SIZE doxygen comments for
queue create and construct directives.

- Added mp11 checks for oversized global message
queues to verify both rtems_message_queue_create()
and rtems_message_queue_construct() return
RTEMS_INVALID_SIZE when size is
max_packet_payload_size + 1.

- Updated mp11 documentation and expected output
to include these checks.

Updates #4819.
2026-08-13 18:17:41 -05:00
Samuel Viegas 9b8e36803b cpukit/include/rtems/confdefs: Improved comments on #pragmas section
- Added a description to the _CONFIGURE_ASSERT_NOT_NULL() macro
definition in doxygen format.

- Improved comment section above the #pragmas to ignore warnings.

Updates #4831.
2026-08-13 18:12:26 -05:00
Chris Johns ec42cadd3b libfs/pipe: Add pipe and pipe2 indirect handler calls
- Add a default pipe2 which retuns an error.

- Add pipe and pipe2 handler register calls so implementations
  with different file descriptors can use these calls.

Closes #5673
2026-08-13 17:33:34 -05:00
Pavel Pisa 25a479d5e6 cpukit/dev/can: correct round-robin on same priority Tx
When the device is open multiple times and data
are sent to driver by multiple FIFOs/edges then
round-robin between same priority prevents
one application blocking whole bandwidth.

The problem has been introduced during switch
from original uLUt/LinCAN to NewLib provided TAILQ

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2026-08-13 17:30:05 -05:00
Sang Woo Kim 4bb46046ad libcsupport: Duplicate onto a free descriptor with fcntl(F_DUP2FD)
duplicate2_iop() assumed its target is open.  A free target stayed on
the iop free list with no LIBIO_FLAGS_OPEN and no reference, so the
call answered success while the new descriptor answered EBADF to
everything and a later allocation handed the same iop out again.
Claim the target from the free list, release the previous location
when the target was open, publish LIBIO_FLAGS_OPEN only after the
open handler agreed, and answer the descriptor for a target that is
the source itself.

Closes #5670
2026-08-11 14:43:40 +10:00
Sang Woo Kim 1e5da72852 libcsupport: Honour the file descriptor minimum of fcntl(F_DUPFD)
vfcntl() never read the third argument: the duplicate was the next
free iop, whatever the caller asked for, an out-of-range minimum was
not refused, and a full table answered -1 with errno unset.  POSIX
wants the lowest available descriptor at or above the argument, EINVAL
for a negative or out-of-range argument and EMFILE for a full table.
The free list is kept in close order, so rtems_libio_allocate_minimum()
walks it for the lowest qualifying entry.

Closes #5668
2026-08-11 14:43:40 +10:00
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
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
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 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
Aaron Nyholm ed072a2501 iodev: Add iodev driver
Add iodev driver and related test
2026-06-25 17:37:09 -05:00
Vijay Banerjee e09a580116 confdefs: Add configure macro for libi2c
Add CONFIGURE_APPLICATION_NEEDS_LIBI2C_DRIVER define

Update #5387
2026-06-25 09:51:58 -05:00
Vijay Kumar Banerjee c185664998 libi2c: Use rtems thread api
Replace custom mutex handling with rtems thread API

Update #5387
2026-06-25 09:51:58 -05:00
Sebastian Huber 141b39c1a4 cpukit: Format list items using -
The `mdformat` tool used for the documentation formatting uses `-`
instead of `*` for list items. Harmonize the format especially for the
files generated from specification items.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-18 13:31:39 +02:00
Sebastian Huber 7bc1fefaa8 score: Use unsigned type for processor masks
Using signed integers for bit fields may result in undefined or
implementation-defined behaviour.  Use an unsigned type instead.

Requires a matching Newlib version.

Update #4864.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-11 17:52:59 -05:00
Gedare Bloom faded1b847 rtems-fdt: refactor rtems_fdt_load to separate gzip
Updates #5607
2026-06-05 23:23:51 +00:00
Shivam Deolankar 99ea420b1b cpukit: Move FatFs core to contrib and update build integration
Move the upstream FatFs sources from cpukit/libfs/src/fatfs to
contrib/fatfs.Keep the RTEMS integration layer (rtems-fatfs-*.c and
rtems-diskio.c) in libfs. Introduce a wrapper header under rtems/fatfs
and update internal sources to use it.

Update the build specification to reference the new location without
introducing global include paths.

Fixes #5433
2026-06-01 18:37:44 +00:00
Gedare Bloom 0194d301f3 rtems-fdt: add unprotected valid handle check
The change to avoid deadlock could introduce a race condition on the
blobs chain and the handle. Refactor the rtems_fdt_valid_handle() to
create an internal unprotected version, and call it with the global
rtems_fdt_lock() held.
2026-05-28 18:55:53 -06:00
Gedare Bloom 296d3872ff libmisc/rtems-fdt: add rtems-fdtimpl.h
Refactor implementation details to rtems-fdtimpl.h to allow further
refactoring of the main source file and access to internal structures
for testing.
2026-05-28 18:55:53 -06:00
Gedare Bloom 1b743eb9d7 cpukit/libdebugger: reformat to LLVM style
Closes #5343
2026-05-08 09:19:53 -05:00
Michal LencandPavel Pisa df346b439b can: add support for SJA1000 CAN controller
This commit adds support for a stand alone SJA1000 CAN controller. This
is classical CAN only capable controller, so no FD support here. The
driver's implementation is similar to CTU CAN FD, thus interrupt handler
triggers a semaphore in main worker thread that takes care of handling
interrupts and receiving and sending messages.

The controller utilizes its one TX buffer for sending messages with
abort function available if higher priority message is present in
the software queue.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
2026-04-27 21:26:51 -05:00
Michal Lenc 8ac4b4c412 can/ctucanfd: add can prefix to rtems_ctucanfd_initialize
This commit renames function rtems_ctucanfd_initialize to
rtems_can_ctucanfd_initialize. It standardizes the naming for CAN
controllers to always begin with rtems_can_ (similar to virtual
controller or sja1000 at the moment under review).

This is an API breaking change.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-04-12 07:33:41 -05:00
Sebastian Huber e876fa1d27 score: Fix _Thread_Dispatch_unnest()
Commit ddd6f3d962 accidentally changed a
decrement into an increment.

Update #5505.
Fix #5517.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-03-11 10:12:24 +01:00
Sebastian Huber ddd6f3d962 score: Do not use deprecated volatile operation
C++20 deprecated some volatile operations including increments.

Fix #5505.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-03-06 11:30:16 -06:00
Abdullah Wasiq 7b4e86f158 cpukit/score: Remove unneeded LM32 placeholder comments
Remove LM32 placeholders
2026-03-06 11:01:47 -06:00
Chandan U b63c42158d cpukit: clear wait node chain state after priority extract
_Priority_Plain_extract() sets the extracted priority node to
off-chain before it is reused by thread queue flush.

Updates #5491
2026-03-06 10:57:56 -06:00
Chandan U 0a5cf46ac3 cpukit: Fix assertion failure in semaphore delete
Clear semaphore flags in Debug mode before freeing object.
This ensures Object.Node.previous is NULL to satisfy _Chain_Is_node_off_chain.

Updates #5491
2026-03-06 10:57:56 -06:00
Chandan U 8112383356 cpukit: fix off-chain state checks and pointer clearing
Semaphore wait nodes store flags in the left part of previous.
So _Chain_Is_node_off_chain() is not safe in all semaphore paths.
Use node->next == NULL where needed for semaphore wait nodes.

Updates #5491
2026-03-06 10:57:56 -06:00
Shivam Deolankar 110dcaf3df cpukit/error: Make RTEMS_ERROR_* shifts 16-bit host clean
Cast the literal 1 to rtems_error_code_t before shifting to avoid
undefined behavior on systems with a 16-bit int.

Include <limits.h> for CHAR_BIT.
Signed-off-by: Shivam Deolankar <shivam.deolankar@gmail.com>
2026-03-06 04:07:22 +00:00
Matteo Concas a41583c375 cpukit/drvmgr: Don't include implementation header files
Not how RTEMS is designed, can cause problems further down.

Closes #5501
2026-03-05 11:32:08 +01:00
82a4e3dfc2 cpukit: Support dates later than 2100
These changes eliminate the year 2100 as a limit for TOD. The new
limit is the year 4096. This limit is not due to any RTEMS limitation
but just before the year 4183 when the rounding error in the length
of the year adds up to an entire day. See
https://de.wikipedia.org/wiki/Schaltjahr for details.

There are still limits on Classic APIs which use the 32-bit rtems_interval
type. This corresponds to the Score Watchdog_Interval type. This impacts
delays, timeouts, and Classic API "after" timers.

Closes #5143

Co-authored-by: Joel Sherrill <joel@rtems.org>
Co-authored-by: Gedare Bloom <gedare@rtems.org>
2026-03-02 10:04:32 -06:00
Gedare Bloom 59ef829a34 cpukit/rfs: use InsertBraces
Updates #5342.
2026-02-05 14:43:37 -07:00
Gedare Bloom 42b507dca0 cpukit/rtl: add missing parenthesis
Fixes #5480
2026-02-05 14:41:47 -07:00
Gedare Bloom b7b0eb1142 cpukit/libdl: format with InsertBraces
Updates #5344
2026-02-05 14:40:30 -07:00
Gedare Bloom 0512135fb1 cpukit/dev/can: fix typo in format directive
Updates #3860
2026-02-05 14:57:03 -06:00
Gedare Bloom 3480dc3644 cpukit/librtemscxx: reformat
Fixes #5453.
2026-02-05 14:55:29 -06:00
Gedare Bloom 41df32a43c cpukit/libmisc: reformat stringto
Fixes #5472.
2026-02-05 14:50:37 -06:00
Gedare Bloom 706eab69db cpukit/include: reformat headers
Using OAR style for posix and rtems headers at global scope
2026-02-05 14:06:45 -06:00
Gedare Bloom 332d42027f cpukit/include: reformat linux to OAR style
These are linux support header files, not imports from linux.

fixes #5479.
2026-02-05 14:01:17 -06:00
Gedare Bloom 4ac38c5427 cpukit/libdrvmgr: reformat
Fixes #5446
2026-02-05 14:00:25 -06:00
Gedare Bloom f7737a09b0 cpukit/libpci: reformat
Fixes #5452
2026-02-05 12:14:40 -07:00
Gedare Bloom 149df22aeb cpukit/dev: reformat io files
Closes #5443.
2026-02-05 10:46:11 -07:00
Gedare Bloom 1b17076054 cpukit/dev/spi: reformat
Updates #5443.
2026-02-05 10:46:11 -07:00
Gedare Bloom 4ced2b7f33 cpukit/dev/serial: reformat
Updates #5443.
2026-02-05 10:46:11 -07:00
Gedare Bloom 0e85986583 cpukit/dev/i2c: reformat
updates #5443.
2026-02-05 10:46:11 -07:00