36959 Commits

Author SHA1 Message Date
Jeremy Lorelli
a0a80f08ca bsps/m68k: Add -D_LDBL_EQ_DBL=1 workaround to ABI_FLAGS
This is to workaround a difficult bug in newlib related to
configure-time generation of this flag in newlib.h. Since there is no
multi-lib mechanism for headers, _LDBL_EQ_DBL ends up in newlib.h, which
is installed architecture wide. The default -mcpu= setting for the 68k
toolchain does support long double, so this flag is not defined in
newlib.h.

However, Coldfire targets lack support for long double, leading to some
undesirable behavior in the C/C++ standard headers. ieeefp.h has
numerous sanity checks that will #error and <cmath> from C++ will fail
to compile.

It doesn't look like this issue will ever be fixed in newlib, so we'll
just define this manually as a workaround.

Closes #5435
2026-01-26 23:03:49 -08:00
Kinsey Moore
4d38bf6ec0 cpukit/posix/aio: Override AIO_LISTIO_MAX from newlib
Newer versions of newlib do not define AIO_LISTIO_MAX, so override this
value for the RTEMS implementation.

Closes #5227
2026-01-21 10:55:05 -06:00
Kinsey Moore
ac41d58472 cpukit/sapi/src/interrtext.c: Add missing definition
This adds a missing text description for an internal error and updates
the spinternalerror02 test to check for the correct end of internal
error definitions.

Closes #5410
2026-01-21 10:55:05 -06:00
Preetam Das
7f064c49bd bsps/aarch64: Add missing ISB after SCTLR write
A write to the sctlr_el1 register is a 'context-changing operation'
and thus requires a pipeline flush for the change to actually take
effect on subsequent instructions.

The isb instruction gurantees this, and ensures mmu is enabled
immediately.

Closes #5422
2026-01-16 01:36:50 +05:30
Kinsey Moore
be446b02d0 bsps/shared/dev/flash: Add a flashdev simulation backend
This adds a backend for flashdev that simulates a flash device with
adjustable delays to simulate real flash devices and offers
configurable flash parameters. This also migrates the JFFS2
filesystem tests to the flashdev framework and eliminates the
purpose-built simulated flash in the testsuite in favor of a more
generic and widely usable solution.

Closes #5403
6.2
2025-12-04 14:09:04 -06:00
Kinsey Moore
fa6c222bdc cpukit/jffs2,spec: Add summary support to the build
This adds summary support to the build with a global option to enable
this support and necessary changes to the imported summary support
source to integrate it into the build system and resolve errors.

Closes #5398
2025-12-03 15:49:01 -06:00
Kinsey Moore
d0974e6bae cpukit/jffs2: Import summary support and direct write helpers
This imports the unmodified summary.c and writev.c support files from
upstream matching the current version of other imports.

Updates #5398
2025-12-03 15:49:01 -06:00
Kinsey Moore
7860fc419a bsps/shared/xnandpsu: Parameterize number of active chipselects
This makes the number of active chipselects a BSP configuration
parameter. The name of the macro in upstream source is misleading and
suggests that the driver can support up to the selected value when in
actuality it requires that number of chips to be present. If this number
of chips is not present, the driver will hang on initialization waiting
for a chip to respond that does not exist.

Closes #5397
2025-12-03 08:25:57 -06:00
Kinsey Moore
f4b34af047 bsps/shared: Add XNandPsu flashdev backend
Add a flashdev backend supporting the XNandPsu peripheral on ZynqMP
systems.

Updates #5397
2025-12-03 08:25:57 -06:00
Kinsey Moore
dd210293e0 cpukit,spec: Swap JFFS2 to zlib CRC32
Move JFFS2 from the Cygwin implementation of CRC32 to the zlib
implementation which can take advantage of hardware acceleration and
reduces code duplication. Synthetic benchmarks on AArch64 hardware show
approximately a 17x improvement in CRC32 calculation speed and
real-world testing with JFFS2 shows a 1% improvement in mount times, a
5% improvement in data write times, and a 9% improvement in garbage
collection times.

A test was written to compare hash generation between the two algorithms
and a partition was created with one and then remounted with the other
with no errors.

Closes #5396
2025-11-24 15:49:09 -06:00
Kinsey Moore
23accdc0bb cpukit/flashdev: Return error for missing callbacks
When a callback does not exist, the Flashdev API should return error
where possible instead of success. When the API returns success for
missing callbacks, the Flashdev API client code may end up using
uninitialized variables as if they were filled by the API.

Closes #5392
2025-11-10 12:36:33 -06:00
Kinsey Moore
2c8973005d bsps/shared/xqspi_flash.c: Add support for sector information
Updates #5392
2025-11-10 12:35:56 -06:00
Aaron Nyholm
e82e11ff4a testsuites/fstests/fsclose01: Fix expected flags
close() now holds a reference to the IOP this changes the
expected flags in the test. This change reflects that.
Updates #5311
2025-11-05 19:50:18 +00:00
Aaron Nyholm
6b86b9fd13 cpukit/close.c: Open flag corrected for busy closes
Fix closing while busy. Previously open flag in the iop would be unset despite
close returning EBUSY.
Updates #5311
2025-11-05 19:50:18 +00:00
Aaron Nyholm
482746182f bsps/shared/jffs2_flashdev.c: Fixed fatal heap error on failed mount
Removed double free of mount_data and instance.
Closes #5382
2025-10-28 15:16:41 +11:00
Kinsey Moore
665b09e692 bsps/jffs2_flashdev: Return correct value for OOB size
Return the actual out of bounds size per page instead of the ioctl
return status. JFFS2 will happily operate with an OOB size of 0 and
instead put cleanmarkers in the normal page space of the flash.

Closes #5379
2025-10-23 15:34:51 -05:00
Kinsey Moore
36a3845d9c bsps/qspi: Make flashdev control structure private
These structures are not required to be exposed to users for any
functionality and users of the API have no way to make use of them.

Closes #5375
2025-10-16 11:31:23 -05:00
Aaron Nyholm
f4328001c7 cpukit/close.c: Fix reference counting under concurrent access.
Fixes issue with IOP being freed during close call.
Updates #5311
2025-10-10 09:40:59 +11:00
Jeremy Lorelli
074cb8f337 libchip/ds1375: Refactor to use i2c-rtc driver
Previously this RTC was using the file system-based i2c interface in
/dev. Since the RTC is initialized pretty early on during system init,
we call open() before stdin/stdout/stderr have been opened. RTEMS
assumes that stdin == 0, stdout == 1, etc., and fails when that isn't
the case. In particular, when stdin != 0, RTEMS assumes that it wasn't
configured with a console driver and skips opening stdout/stderr,
leading to confusing issues with the standard I/O streams.

Closes #5284
2025-10-09 17:19:04 -05:00
Jeremy Lorelli
7d44e6de7e cpukit: Raise internal error if we cannot open stdin with fileno 0
If someone manages to open a file before rtems_libio_post_driver is run,
open() may allocate a file number other than 0 for stdin. This leads to
a silent failure of the logic in rtems_libio_post_driver, and confusing
behavior because your BSP behaves as if it doesn't have a console.

Instead of failing silently, raise an internal error if open() succeeds
but gives us an unexpected file number for stdin.

Updates #5284
2025-10-09 17:18:44 -05:00
Kinsey Moore
cdcc886ddc bsps/dev/spi/xqspipsu_flash_config.h: Make flash config table static
This is now used by multiple files and can cause a multiple definitions
error when linking. Make the structure static to avoid this problem.

Closes #5372
2025-10-08 15:36:23 -05:00
Kinsey Moore
b19119212d spec/bsps/aarch64/xilinx-zynqmp: Add XQspiPsu flashdev backend
Closes #5371
2025-10-08 16:45:28 +00:00
Kinsey Moore
32e76ed96d bsps/shared/dev/flash/jffs2: Add support for NAND
This adds support for NAND to the JFFS2 flashdev adapter.

Closes #5369
2025-10-08 16:44:11 +00:00
Matteo Concas
10154a6eca bsps/noelv: Align instruction in bsp_reset()
Closes #5368
2025-10-03 11:40:45 +02:00
Kinsey Moore
df40ffa9dc cpukit/jffs2/gc.c: Prevent live lock for split reads
In some cases a file read is not completed in a single call into the
JFFS2 layer and the inode is left in the READING state. When this
happens, it's possible for a garbage collection pass to be initiated
before completion of the read. In some such cases, the garbage
collection pass is executed in a tight loop that expects granular
locking to allow forward progress of the read between collection passes.
With RTEMS monolithic locking of the JFFS2 layer, forward progress is
not possible in this situation since the monolithic lock is never
released inside the loop.

The solution is to have the garbage collection pass return failure when
no progress is possible due to a bad inode state. This allows the read
to complete and the collection pass can be attempted at a later time.

Closes #5365
2025-10-02 19:15:09 -05:00
Kinsey Moore
1c3cd25ebd cpukit/flashdev: Add full support for NAND devices
This extends the flashdev API to support the additional calls required
by NAND device backends. This also adds region-relative IOCTLs to
prevent reimplementation of offset logic in top-end flashdev/filesystem
adapters.

Closes #5350
2025-10-02 20:13:29 -04:00
Sebastian Huber
f42ad92071 validation: Move storage class qualifier
Backport storage class qualifier rearrangment required by more recent C
language standard revisions.

Close #5337.
2025-10-03 09:45:31 +10:00
Chris Johns
d45d353abb libdebugger: Add SMP support for ARM
Make the aarch64 SMP support a separate file and share it between
aarch64 and arm.

Closes #5348
2025-09-25 07:29:52 -05:00
Kinsey Moore
b05ae8a6d4 bsps/shared/dev/flash: Enforce maximum JFFS2 filesystem size
The maximum size of JFFS2 is 4GB minus the block size of the flash.
Enforce this limitation when setting up a filesystem on a flashdev
region that is larger than the maximum.

This also resolves some off-nominal memory leaks.

Closes #5347
2025-09-22 20:48:39 -05:00
Kinsey Moore
d0190f0718 cpukit/flashdev: Add unregister call and private data destructor
This adds an API call allowing for unregistration to include destruction
of private data that is not managed by the flashdev framework. This also
updates the existing consumers of flashdev to use the new private data
destructor callback.

Closes #5346
2025-09-22 19:00:36 -05:00
mez3n
a79d702be6 rtems: Add rtems_barrier_get_number_waiting()
Backport commit 528095cd24.

Close #5336.
2025-09-20 08:06:16 +10:00
Sebastian Huber
d27c444b8d rtems: Backport Doxygen changes
The conversion to Markdown for the documentation sources resulted in
changes of Doxygen comments of generated sources. Backport these
changes.

Close #5338.
2025-09-12 04:43:04 +02:00
Kinsey Moore
a79813c96e cpukit/libdebugger/server: Use generic TLS accessor
This updates the libdebugger server to use a generic TLS area access
mechanism so that it works across all supported architectures.

Closes #5313
2025-07-31 11:10:56 +10:00
Chris Johns
0cf6de01df cpukit/libio: Support close with IOP references held
- Provide an option for a file system to support close wtih
  references held. This can happen in more complex file systems
  and file descriptor handling with more complete reference
  handling implementations where an fd can hold other fds and
  close can be call on any fd and succeed.

- Fix open IOP leaks in the error paths.

- Provide better definition of the IOP flags to help clarify
  the code.

Fixes #5201
Closes #5311
2025-07-26 21:23:36 -05:00
Kinsey Moore
1240e8f81b cpukit/libdebugger: Add support for TLS variables
This adds support for the "vGetTLSAddr" GDB query which retrieves the
address of a TLS variable by offset from the beginning of the TLS memory
space for the given thread. This offset does not include the size of the
thread control block which is at the beginning of every TLS area as used
by RTEMS. Notably, the returned address is big-endian rather than the
little-endian typical with other responses.

This functionality does not include retrieval of addresses for TLS
variables hosted in loadable modules, only TLS variables in the host
binary.

Closes #5271
2025-07-24 20:31:40 -05:00
Kinsey Moore
b1dbd9eeae bsps/dev/spi/xqspipsu-flash-helper: Explain source
This adds a missing header block and better explains the provenance of
the xqspipsu-flash-helper files and their copyright status.

Closes #5309
2025-07-23 15:18:13 -05:00
Kinsey Moore
84d4c11c30 bsps/include/dev/spi: Add missing extern and guard
This adds missing extern "C" declarations and a missing header guard.

Updates #5309
2025-07-23 15:17:59 -05:00
Matteo Concas
e7fa90ab0c cpu/riscv: Add Smdbltrp extension compatibility
If the Double Trap Extension is implemented, the
MDT bit of the mstatus (or mstatush in RV32)
register will be set when a trap is to be taken.

The MIE (Machine Interrupt Enable) bit can only
be set to 1 if the MDT bit is zero.

Thus, we need to clear MDT first if we want to
enable interrupts when dispatching a thread.

MDT is also cleared in register a1 before
restoring the interrupt frame as writing 1 to MDT
will cause MIE to be set to 0. In RV64 this
happens regardless of the value written to MIE in
the same write.

In RV32, MDT is in the mstatush so we do not need
to clear during restore as this register is not
restored.

With this change all 60 SMP tests pass (compared
to 20/60 before the fix). The tests have been run
on hardware using two RV64 CPUs that implement
the double trap extension.

Close #5288

(cherry picked from commit 19f12d2dca)
2025-07-03 10:07:39 +02:00
Matteo Concas
dd490c5c2d bsps/noelv: Fix using console in polled mode
Before, the console driver needed
`BSP_CONSOLE_USE_INTERRUPTS` to be defined or it
would not build. The intent was to use polled
mode if the macro was equal to zero.

This change makes it so interrupt mode is used if
the macro is defined and polled mode is used if
the macro is not defined.

(cherry picked from commit 5e0a68d3ab)

Close #5283
2025-06-27 09:41:33 +02:00
Matteo Concas
d010f6ae8b bsps/sparc/leon3: Fix GPTIMER timer index logic
The old logic would lead to an error when
multiprocessing was enabled and
`LEON3_GPTIMER_BASE` was defined due to
`leon3_timer_core_index` being undefined.

The new logic fixes this and keeps the same
intent:
 - If multiprocessing is not enabled, the timer
   index is 0
 - If multiprocessing is enabled and
   `LEON3_GPTIMER_BASE` is defined, the timer
   index is twice the CPU boot index
 - If multiprocessing is enabled and
   `LEON3_GPTIMER_BASE` is not defined, we
   fallback to the old logic using the GPTIMER
   core index.

Close #5281
2025-06-25 08:22:13 +02:00
Kinsey Moore
3d8b56f10c cpukit/libdebugger: Prevent hang on memory access
When memory is accessed by the remote debugging client, the access is
sandboxed with setjmp/longjmp and appropriate exception handlers to
prevent the attempted access from causing a failure of the debugger or
otherwise altering execution. The existing implementation works as
expected when the context executing the memory access and the exception
context resulting from a failed access do not share a stack.

In the case of AArch64, a failed access when the debugger is already in
exception context causes a re-entry into exception context where the
machine state is pushed onto the same stack that was in use where the
exception occurred. When setjmp is called inside a stack frame and the
exception occurs outside that stack frame, the stack frame is unwound
before the exception occurs and the exception entry overwrites the area
previously occupied by the stack frame housing the setjmp and corrupting
the link register that is stored there. After restoration of state using
longjmp(), this corrupted link register information is loaded from the
stack frame and undesired behavior occurs.

In the instance of this bug that was encountered, the corrupted link
register contained an unaligned pointer which caused an unending cascade
of prefetch abort exceptions presenting as a hard hang.

Closes #5273
2025-06-18 13:53:35 -05:00
Chris Johns
cb3fba0447 bsps/shared/dev/ide: Initalise ATA request links as off chain
- Fixes the asserts when building with RTEMS_DEBUG

Closes #5254
2025-05-28 13:01:00 +10:00
Chris Johns
6335d7e48a machine/timecounters: Add missing _Timecounter_ decls
Add:

 - _Timecounter_Getboottime
 - _Timecounter_Getboottimebin

Closes #5212
2025-05-09 08:37:01 +10:00
Chris Johns
f769b20c98 cpukit/libdl: Fix loading symbols from an object file at runtime
- Assume a relocation record with a symbol name with a length of
  0 is resolved. ARM seems to create a symbol with no name for
  R_ARM_V4BX relocation records.

- Move the addition of the rtems_rtl_base_sym_global_add symbol
  to the global symbol table to the weak
  rtems_rtl_base_global_syms_init call. If symbols are
  embedded the support for runtime loading symbols is over
  loaded. This change is required so the base object has a
  valid global symbol table attached to track dependencies.

Fixes #5234
2025-04-01 12:31:32 +11:00
Matteo Concas
9dae9f5fe8 spec: Install missing header files for GRLIB and SPARC
The following files will be installed during SPARC/GRLIB builds:
- bsps/include/grlib/apbuart-regs.h
- bsps/include/grlib/gptimer-regs.h
- bsps/include/grlib/irqamp-regs.h
- bsps/sparc/include/grlib/io.h

Closes issue #5232
2025-03-26 17:43:13 +01:00
Amar Takhar
b4149b2282 gitlab: Add link to CI
This runs only the commit message and merge request checker.

Required so we can have 'all pipelines must pass' enabled due to a bug in
Gitlab
2025-02-12 22:22:24 -05:00
Chris Johns
87bf49b715 Revert "build: Provide LDFLAGS for pkg-config"
This reverts commit e36ba91110
2025-02-11 05:38:19 +00:00
Sebastian Huber
e421c922a8 bsp/qoriq: Ignore spurious interrupts
For example, with edge triggered external interrupts we may see spurious
interrupts.   Ignore them instead of issuing a fatal error.

Use eieio to synchronize access to the IACK and EOI registers.

Use a loop to immediately services the next pending interrupt without
having to go through the exception epiloge and prologue.

Close #5173.
2025-02-07 16:18:23 -07:00
Sebastian Huber
e36ba91110 build: Provide LDFLAGS for pkg-config
Some pkg-config variants perform transformations on the --libs options.
This may lead to completely broken linker options.  Provide the LDFLAGS
as a variable.  Remove "Ldflags:" since this is an unsupported field.

Update #5165.
2025-02-07 18:28:01 +00:00
Jan Sommer
a0e4be53f4 grlib/occan: Fix baud rate calculation
Fixes #5205
2025-02-07 08:50:42 -07:00