Commit Graph

37097 Commits

Author SHA1 Message Date
Matt Joyce
af4fd0b70b rtems/score/armv7m.h: Edit NVIC struct definition.
Adjust ARMV7M_NVIC structure definition to account for changes
introduced to ARMV8M NVIC.
2025-07-02 23:41:01 -04:00
Matt Joyce
104aea035d cpukit/arm.h: Add ARMV8_M Definitions
Some fixes where necessary to not handle ARMv8M identical to (for
example) ARMv8A. ARMv8M is more similar to ARMv7M.

Co-authored-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
2025-07-02 23:41:01 -04:00
Matt Joyce
f095049c7c bsps/arm/include: Add include to core_cm33.h CMSIS
Include armv7m_cachel1.h in core_cm33.h file to allow access to
cache functions.

Co-authored-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
2025-07-02 23:41:01 -04:00
Matt Joyce
8f56c7a2d4 bsps/arm/include: Silence warning in CMSIS file
Avoid a warning about missing void.

Co-authored-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
2025-07-02 23:41:01 -04:00
Matt Joyce
d6de06569f bsps/arm/include: Add CMSIS files for ARMV8M
Files are imported from https://github.com/ARM-software/CMSIS_5 revision
55b19837f5703e418ca37894d5745b1dc05e4c91

Like already checked in RTEMS commit
6b2318acef, the project still don't have a
NOTICE file.
2025-07-02 23:41:01 -04:00
Matteo Concas
19f12d2dca 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.

Update #5274
2025-07-01 16:53:36 -05:00
Sepehr Ganji
20850e7e73 libfs/fatfs: Add rtems-README file
The rtems-README file contains the process for
importing the source, and the hash and changelog
of the current version.
2025-07-01 12:00:56 -06:00
Sepehr Ganji
328189f15f libfs/fatfs: Import FatFS
This adds the FatFS source code version R0.15b (Jun 21, 2025) to libfs.
The code is imported from https://elm-chan.org/fsw/ff/archives.html.
2025-07-01 12:00:56 -06:00
Bhavya Shah
e618b20215 imfs/imfs_statvfs: Added the statvfs functionality to IMFS module
- Modified the psximfs01 test to validate the functionality
- Modified the IMFS_fs_info_t keeping the jnode counter
- Added imfs_statvfs.c which sets the statvfs struct fields for imfs
2025-07-01 09:16:31 -05:00
Kinsey Moore
21b5d7c4e8 cpukit/atomic: Deprecate ATOMIC_VAR_INIT
ATOMIC_VAR_INIT has been deprecated in GCC 15. This updates the usage to
be equivalent to the pre-deprecation implementation.

Closes #5285
2025-07-01 02:35:07 +00:00
Jeremy Lorelli
9cfe726b0d bsps/beatnik: Use standard C99 designated initializers 2025-06-30 16:25:03 -05:00
Jeremy Lorelli
4b05acde6f bsps/mvme3100: Use standard C99 designated initializers 2025-06-30 16:25:03 -05:00
Jeremy Lorelli
2483cf035b bsps/i386: Fix incorrect size specifier on instruction
This was causing an assembler warning.
2025-06-30 09:43:07 -07:00
Kinsey Moore
c26259ee2e bsps/shared/serial/pl011: Avoid unnecessary reads
Avoid reading from the pl011 data register unnecessarily. There is no
need to preserve the contents of this register as it is not normal
memory. This unnecessary read causes console spam when running under the
Xen hypervisor when the read FIFO is empty since the read is not
expected.
2025-06-26 23:29:24 +00:00
Matteo Concas
5e0a68d3ab 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.
2025-06-26 02:40:05 +00:00
huangshuhua
af8c087fb0 cpukit/aio_misc:Add error handling for calloc failure 2025-06-26 02:37:47 +00:00
Matteo Concas
ae361faeba 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 #5258
2025-06-26 02:32:39 +00:00
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