Commit Graph

37080 Commits

Author SHA1 Message Date
Chris Johns
df1d85c0f8 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
2025-06-26 00:53:51 +00:00
ShaunakKDatar
fb1d9c8aca bsp/aarch64/raspberrypi: Add I2C Support
- Implements polling-based I2C communication.
- Supports three independent I2C master controllers.
- Adds support for 10-bit addressing mode.
2025-06-25 23:42:14 +05:30
Aaron Nyholm
b00a9d9993 bsp/include/jffs2_flashdev: Added CPP guards
Closes #5280
2025-06-25 04:08:55 +00:00
Joel Sherrill
1b4f88baa3 mips/rbtx4938/include/bsp/irq.h: Fix redefinition of TX4938_IRQ_ACLCPMC
See the issue for a discussion and a link to CPU manual.

Closes #5278.
2025-06-24 20:34:37 +00:00
Joel Sherrill
fc0542fa7a bsps/powerpc/*/include/bsp.h: Remove stray semi-colon
The gen5200, gen83xx, and tqm8xx BSP families have multiple variants
which produced the same stray semi-colon warning from GCC 15 for
using LINKER_SYMBOLS() with a semi-colon at the end of the line.

Closes #5277.
2025-06-24 20:25:08 +00:00
Joel Sherrill
8937b04a70 testsuites/sptests/sp06/task2.c: Eliminate old-style prototypes
GCC 15 is noisy about these. They have been deprecated since C90
but still lurk.

Updates #5275
2025-06-24 20:23:34 +00:00
Joel Sherrill
6b0d16f7dd testsuites/benchmarks/dhrystone/*: Eliminate old-style prototypes
GCC 15 is noisy about these. They have been deprecated since C90
but still lurk.

Updates #5275
2025-06-24 20:23:34 +00:00
Joel Sherrill
28cef0e987 bsps/.../motorola_powerpc/bootloader/zlib.c: Fix old-style prototypes
This zlib source is a hacked down version just for the decompression
phase for the bootloader used by this family of BSPs. The proper
fix is to redo the hackery with a new version of zlib. But that
is risky so this is just addressing the warnings.

Updates #5276
2025-06-24 20:22:26 +00:00
Shaunak Datar
d4755476bc bsp/aarch64/raspberrypi4: Add PWM peripheral support
This commit adds support for the PWM peripheral on the aarch64/raspberrypi BSP.
2025-06-20 20:53:28 +05:30
Joel Sherrill
0ab6c7bc58 zlib/: Update to 1.3.1
This is necessary to compile cleanly with GCC 15 which discourages
use of old-style prototypes.

Closes #5263
2025-06-19 23:57:32 +00:00
Joel Sherrill
6876262a44 bsps/mips/hurricane/clock/ckinit.c: Address type mismatch
GCC 14 generates an error for the wrong signature function being
passed in. The underlying type was a void * so adjusting the
signature of the ISR handler was not an option. Added cast.

Closes #5272
2025-06-19 23:37:39 +00:00
Joel Sherrill
734208a49b bsp/shared/atomics: New directory
Provide missing GCC atomics helpers as part of BSPs where GCC
does not know how to provide it since the CPU's ISA has no
atomic instructions. The implementation provided in
bsps/shared/atomics/__atomic_test_and_set.c should work
on any single core CPU.

The BSPs that need thie function tend to have older cores. This
is the list of BSPs:

arm - csb336, csb337, csb637, edb7312, gumstix, kit637_v6, lpc24xx_ea,
  lpc24xx_ncs_ram, lpc24xx_ncs_rom_ext, lpc24xx_ncs_rom_int,
  lpc24xx_plx800_ram, lpc24xx_plx800_rom_int, lpc32xx_mzx,
  lpc32xx_mzx_stage_1, lpc32xx_mzx_stage_2, lpc32xx_phycore,
  rtl22xx, rtl22xx_t, smdk2410
m68k - av5282, mcf5329
mips - jmr3904
moxie - moxiesim
nios2 - nios2_iss
riscv - grv32i, grv32im, niosvc10lp, noel32im, rv32i, rv32im,
sparc - ut699
2025-06-19 23:30:57 +00:00
Joel Sherrill
4106647891 bsps/arm/*: Add linker args to specify __sync_synchronize variant
GCCC 14 introduced a linking warning about not knowing which
__sync_synchronize implementation to use. The BSPs impacted
are updated in this commit. The suggested correction is to
use -specs to pick up a GCC specific specs file which changes
__sync_synchronize to the desired implementation
__sync_synchronize_MECHANISM. Using this solution ties
the code to GCC 14+ since the spec files are not in GCC 13.
This solution maps __sync_synchronize to a RTEMS specific
__sync_synchronize implementation which avoids using of a
GCC extension and requiring GCC 14+,

Closes #5268
2025-06-19 22:58:18 +00:00
Shaunak Datar
1c9e91d25b bsp/aarch64/raspberrypi: Fix the formatting for raspberrypi.h
Change the formatting of the include/bsp/raspberrypi.h file to comply
with the RTEMS formatting guideline. No functional changes are made.
2025-06-19 22:47:57 +00:00
Kinsey Moore
a0957ef636 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.
2025-06-18 13:37:53 -05:00
Joel Sherrill
7eb39e3e8d bsps/powerpc/*/include/tm27.h: Use formatter suggestions
Applied suggested formatting changes to the following files which
were modified for technical reasons in the previous commit.

    bsps/powerpc/gen5200/include/tm27.h
    bsps/powerpc/mvme5500/include/tm27.h
    bsps/powerpc/psim/include/tm27.h
2025-06-11 14:19:06 -05:00
Joel Sherrill
0f99dd5d25 bsps/powerpc/*/include/tm27.h: Correct IRQ installation structure
The gen5200, mvme5500, and psim BSP families had an implementation of
tm27.h which used stub functions with casts as null handlers to fill
in the IRQ structure. The IRQ structure as also missing a field. The
change was to use a set of appropriately signatured stub functions
and correct the structure initialization.

This code likely has produced warnings for a long time but with
GCC 14, these warnings turned into errors.

Closes #5266
2025-06-11 13:11:27 -05:00
Kinsey Moore
4848d7ab73 aarch64/raspberrypi4: Perform reset using watchdog
This updates the AArch64 Raspberry Pi BSP to use the watchdog to perform
the system reset instead of attempting to use the PSCI reset which isn't
present on the Raspberry Pi platform.
2025-06-10 21:25:35 -05:00
Kinsey Moore
ecaa780c85 spec/aarch64/raspberrypi: Rework linker script
This reworks the linker script configuration to be more comprehensible
and to remain within the 1GB guaranteed available on all Pi4 systems and
accounting for the memory dedicated to the GPU and the memory dedicated
to the low level firmware.
2025-06-10 21:25:35 -05:00
Mohd Noor Aman
7f30da6ec4 bsps/aarch64/raspberrypi: Add SMP Support 2025-06-10 21:25:35 -05:00
Joel Sherrill
08807c3c1f paranoia/paranoia.c: Update to ANSI signature
As of GCC 15, use of K&R signatures is an error.

Closes #5262.
2025-06-10 18:58:39 +00:00
Joel Sherrill
1873615777 spmisc01/init.c: Eliminate use of keyword unreachable
In C23 and later, unreachable is a keyword. GCC 15 defaults to C23.

Closes #5261.
2025-06-10 18:55:22 +00:00
Matteo Concas
8915b72068 grlib/pci: Use unsigned integer for interrupt number
Closes Coverity 1642585
2025-06-10 18:53:04 +00:00
Jeremy Lorelli
12455d8a93 bsps/powerpc: Undef BSP_SHARED_HANDLER_SUPPORT before defining it again
Fixes a redefinition warning
2025-06-10 18:39:46 +00:00
Jeremy Lorelli
f354bfc07f m68k/uC5282/bspstart.c: Refactor/cleanup of some bsp start code
* Cleaned up the uC5282 ISR stuff to make the casts and whatnot more
  readable. Also made the offsets relative to the VBR (which is at 0x0
  for this BSP) to silence a GCC warning.

* Refactored the default exception handler to map a struct to the stack
  instead of taking the address of pc and under-indexing it. The
  compiler was not particularly happy about the previous implementation.
2025-06-10 17:55:04 +00:00
Joel Sherrill
b495d9433a cpu/arm/__tls_get_addr.c: Use internal _Assert()
Updates #5238.
2025-06-10 15:02:48 +00:00
Prithvi Tambewagh
12f5c780c2 leon: Include leon.h to resolve undefined leon_r32_no_cache
Include leon.h in bsp.h for providing reference to leon_r32_no_cache - leon3 BSP
2025-06-10 15:01:02 +00:00
Amar Takhar
8bf1511496 yamlfmt: Format all yaml files
yamlfmt will become a hard error as our files are already clean except for these
minor issues.
2025-06-07 11:58:28 -04:00
Amar Takhar
c87906d13c m68k/uC5282: Fix typo in spcxx01
Introduced in !433

Refs #5259
2025-06-07 11:48:31 -04:00
Chris Johns
5b687c4da5 cpukit/libfs: Clean up the libfs mount handlers
- Remove the `fsmount_me_t` handler moving its signature to `mount_t`.

- The `mount_t` signature with the `data` lets file systems handle
  options and that means the shell `mount` command can mount
  more file systems.

- Clean up the `mount` call's handling of the `mount_t` and
  `fsmount_me_t` structures.
2025-06-05 23:39:10 +00:00
Chris Johns
1dd2299be2 cpukit/libfs/imfs: Clean white space 2025-06-05 23:39:10 +00:00
Joel Sherrill
968a7af3c1 m68k/uC5282: Disable spcxx01
Disable this test until issue #5217 is resolved.

Updates #5230
2025-06-05 23:37:15 +00:00
Chris Johns
b0eb259377 bsps/shared/dev/ide: Initalise ATA request links as off chain
- Fixes the asserts when building with RTEMS_DEBUG

Closes #5253
2025-06-05 23:19:48 +00:00
Joel Sherrill
a9cf40113a sparc/include/.../cpuimpl.h: Correct global file scope register use
The register keyword was never more than a suggestion but in more
recent versions of C and C++, it has been reduced to a reserved
keyword with no semantics. GCC has a documented extension for
global register variables. Add the __extension__ keyword to avoid
warnings.

See Issue #5250 for a more detailed discussion including a link
to a discussion on the GCC mailing list.

The use of g6 as a pointer to the per CPU information is documented
in the SPARC chapter of the CPU Supplement Guide.

Closes #5250.
2025-05-29 23:39:03 +00:00
Lucian Silistru
7ec18af86c bsps/riscv: use lw to load _SMP_Processor_configured_maximum on rv64
_SMP_Processor_configured_maximum is 32 bit, LREG macro is ld on rv64,
lw on rv32. Changing the load to explicit 'lw' to always load 4 bytes

Closes #5251
2025-05-29 22:49:11 +00:00
Chris Johns
ef07c0c540 waf: Build all BSPs with -k with errors
Closes #5252
2025-05-29 17:57:38 +10:00
Amar Takhar
34c362fee1 ascii: Remove non-ASCII characters
We will soon be enforcing ASCII-only characters for source.
2025-05-22 19:35:12 +00:00
Amar Takhar
662ad275f7 ascii: Remove non-ASCII characters from names
There are only the 3 names in our entire source that use non-ASCII characters.
Our documentation can still use any type of character.  We want to limit source
to ASCII for safety reasons.
2025-05-22 19:35:12 +00:00
Amar Takhar
b714e4a809 ascii: Remove non-ASCII characters
We will soon be enforcing ASCII-only characters for source.
2025-05-22 19:35:12 +00:00
Amar Takhar
7a4a42d23b ignore: Add missing files and new ones
* Add missing jffs2 files
* Ignore yaml/* as it's an import
* Add files for fstests that need to skip the char test
2025-05-22 14:41:47 -04:00
Amar Takhar
b2b8b2604a encoding: Fix encoding for 3 files
board_memories: WINDOWS-1250
aes.c: ISO-8859-3
sdramc.c: WINDOWS-1250

These have been converted to utf-8 with the broken characters fixed.  The
original encoding is wrong and has been corrupted.  Now they are ASCII.
2025-05-21 20:06:29 -04:00
Amar Takhar
70ad0926b0 readme: Convert to ASCII
Convert table to ASCII
2025-05-20 13:05:47 -04:00
alessandronardin
ab7f9193eb posix/aio: modified insertion of sync requests
now sync requests are appended at the end of the appropriate queue

Closes #5176
2025-05-13 10:39:08 +02:00
alessandronardin
1c9d74cfac posix/aio: Free requests after handling
Requests in rtems_aio_handle were not being freed after they were handled
causing resource leaks. This commit adds the necessary free for the
requests after processing.

Closes #5175
2025-05-13 10:34:44 +02:00
mez3n
528095cd24 cpukit/rtems: add rtems_barrier_get_number_waiting()
Closes rtems/programs/gsoc#9
Added rtems_get_number_waiting according to the issue
rtems/programs/gsoc#9, including tests and documentation.
2025-05-12 17:00:14 +00:00
Jeremy Lorelli
0017330fc6 spec: Remove missing headers from m68k BSPs
These headers were removed in b30d88cb87
2025-05-09 15:37:47 -07:00
yang.zhang
76f9a25ea0 cpukit/posix: sigtimedwait() only clear a signal when EINTR
When a thread is unblocked from sigtimedwait, it maybe ETIMEOUT or
EINTR. If ETIMEOUT, there is no pending signals, never and is not
necessary to call _POSIX_signals_Clear_signals because of the_info->si_signo
is -1.

Should validate the signal passed into _POSIX_signals_Clear_signals.
2025-05-08 22:47:01 +00:00
Chris Johns
7c79f8c63d waf: Handle no version label in VERSION with releases
No version label in the VERSION file broke with
releases.

Closes #5186
2025-05-08 22:44:43 +00:00
Chris Johns
deb26068f0 machine/timecounters: Add missing _Timecounter_ decls
Add:

 - _Timecounter_Getboottime
 - _Timecounter_Getboottimebin

Closes #5211
2025-05-08 22:37:32 +00:00
Joel Sherrill
db35b8c722 psignalclearsignals.c: Eliminate used before initialized warning
There were independent checks at lock/unlock time on whether the
signal clearing logic executed in a critical section. Refactored
so the two checks are now one.

Closes #5239
2025-05-08 22:31:30 +00:00