Commit Graph
38114 Commits
Author SHA1 Message Date
Yang Zhang ba0b035a21 posix: fix mmap boundary check
The inclusive comparison against st_size incorrectly rejects mappings
ending exactly at the file boundary.

This patch:
1.Changes >= to > to allow valid mappings up to the file size.
2.Uses subtraction-based logic to prevent potential integer overflow.
build/2026-03-04
2026-06-11 17:32:31 -05:00
Gedare Bloom 899e6a7ac3 libtests/fdt02: make test functions static 2026-06-11 17:27:34 -05:00
Gedare Bloom bea812233c libtests/fdt02: add get uint testing
Updates #5607
2026-06-11 17:27:34 -05:00
Gedare Bloom 9b815f7446 libtests/fdt02: add index entry testing
Updates #5607
2026-06-11 17:27:34 -05:00
Gedare Bloom 7d60e5681f libtests/fdt02: add memreserve testing
Updates #5607
2026-06-11 17:27:34 -05:00
Gedare Bloom e3dc884685 libtests/fdt01: make test functions static 2026-06-11 17:25:15 -05:00
Gedare Bloom 9aa0c138b6 cpukit/rtems-fdt: return offset 0 for the root node
Fixes #5612
2026-06-11 17:25:15 -05:00
Gedare Bloom fc29c5d1e8 cpukit/rtems-fdt: fix rtems_fdt_supernode_atdepth_offset
rtems_fdt_supernode_atdepth_offset() passes the handle instead of the
blob to fdt_supernode_atdepth_offset()
2026-06-11 17:25:15 -05:00
Gedare Bloom 9cc24daf62 testsuites/fdt01: add test for depth and supernode_depth
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom 8bfb4e3009 testsuites/fdt01: update doc file
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom e9101393dc testsuites/fdt01: add test for rtems_fdt_prop_map
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom 19c8a21678 testsuites/fdt01: add test for rtems_fdt_getprop_address_map
Updates #4150
2026-06-11 17:25:15 -05:00
Gedare Bloom d08cf78230 testsuites/fdt01: add path and alias tests
Updates #4150
2026-06-11 17:25:15 -05:00
Cheng Mingming a241e49bda cpukit/dev/flash: Fix region bitmap clear size
rtems_flashdev_register() cleared the region allocator bitmap with
memset( table->bit_allocator, 0, alloc_array_len ) where alloc_array_len
held the number of uint32_t words.  Since bit_allocator is a uint32_t
array, only one byte per word was zeroed, leaving the rest of the bitmap
uninitialised.  Stale bits can make
rtems_flashdev_find_unallocated_region() report region slots as
allocated and fail REGION_SET with ENOMEM while slots are actually free.

Rename RTEMS_FLASHDEV_BITALLOC_LENGTH to RTEMS_FLASHDEV_BITALLOC_WORD_LENGTH
to make the word count explicit, add RTEMS_FLASHDEV_BITALLOC_BYTE_LENGTH for
the size in bytes, and clear the whole bitmap using the byte length.
2026-06-10 09:42:54 +08:00
Avi Weiss c207718440 bsps/arm/tms570: Add missing DCAN TIOC 'in' bit macro
The 'in' field (bit 0) is missing from the DCAN TIOC macros. It looks
like the auto-gen did not pick it up as it's broken onto the next page
in both the 3137 and 4357 TRMS.
2026-06-09 13:33:59 -05:00
Avi Weiss a10de2c21d bsps/arm/tms570: reg_lin.h and reg_sci.h header macro fixes
Clean up some typos and fill in missing comments.
2026-06-09 10:25:32 +02:00
Avi Weiss 30d055a20b bsps/arm/tms570: fix misnamed LIN/SCI interrupt macro names
The generated LIN and SCI headers used a generic CLEARINTLVL_8 macro for
the TX interrupt level clear bit, and used CE names for bit 25, which is
the overrun-error interrupt.

Add the missing CLR_TX_INT_LVL names, use OE consistently for bit 25,
and remove the duplicate CLEARINTLVL definitions.
2026-06-09 09:42:28 +02:00
Gedare Bloom 1fff7e564b testsuites/libtests: add fdt02 for more rtems-fdt tests
Closes #5607.
2026-06-05 23:23:51 +00:00
Gedare Bloom faded1b847 rtems-fdt: refactor rtems_fdt_load to separate gzip
Updates #5607
2026-06-05 23:23:51 +00:00
Avi Weiss 097cfabe0a bsps/arm/tms570: fix CLKCNTL preprocessor macro name
Minor fix for clarity - the actual register name is CLKCNTL - macro
should match to avoid confusion in future.
2026-06-05 10:32:25 -05:00
Matteo Concas 344e05b0e0 grlib: Fix errors introduced by format changes
Closes #5609
2026-06-05 10:52:05 +02:00
Avi Weiss 836bc11831 bsps/arm/tms570: Remove undefined/functionless macro TMS570_BALL_D16_
TMS570_BALL_D16_ was probably mistranscribed or auto-generated at some
point. It has no function attached on the end, and is not usable.
2026-06-04 18:34:02 -05:00
Avi Weiss c85be5d89b bsp/arm/tms570: add unsigned (U) suffix for bit shifts in bspreset.c
Add U suffix for clarity and safety. Capitalise the lower-case instances
so the file is consistent.
2026-06-04 18:18:20 -05:00
Avi Weiss 22c960abca bsp/arm/tms570: Apply RTEMS clang-format to bspreset.c
Apply RTEMS preferred formatting as part of ESM bug fix. Formatting
makes future maintenance easier.
2026-06-04 18:18:20 -05:00
Avi Weiss e946b47d17 bsp/arm/tms570: Fix ESM IOFFHR channel off-by-one bug in bsp_reset
Only enter the if block to clear the channel when IOFFHR != 0. Then
subtract 1 inside there to get the correct channel (e.g. IOFFHR == 1
maps to channel 0).
2026-06-04 18:18:20 -05:00
Avi Weiss 59a0057ee1 bsp/arm/tms570: Replace ref to old TMS570_MMR_SELECT_GMII_SEl macro
Commit 3a0dcd5ee9 cleaned up the
TMS570_MMR_SELECT_GMII_SEL somewhat, creating the
TMS570_MMR_SELECT_MII_MODE and TMS570_MMR_SELECT_RMII_MODE
macros.

There remains one reference to the TMS570_MMR_SELECT_GMII_SEL macro
in the 3137 code. This commit replaces it with TMS570_MMR_SELECT_MII_MODE
which preserves the same encoding as the pinmux was at the time (and is
correct): TMS570_PIN_AND_FNC(TMS570_BALL_WITH_MMR(29, 3), 0)
2026-06-04 18:17:02 -05:00
Avi Weiss cbf1b49b14 bsp/arm/tms570: irq.h function header comment corrections
Some copy-paste corrections on the get/set function headers.
2026-06-04 18:16:29 -05:00
Avi Weiss 8bcc2158c0 bsp/arm/tms570: Correct IRQ channel macro definition typos
Some transcription errors from the Interrupt Request Assignments
table in the datasheet are corrected here.
2026-06-04 18:16:29 -05:00
Avi Weiss 0dbf8d675f bsp/arm/tms570: Minor typo corrections and clean up header includes 2026-06-04 18:13:15 -05:00
Avi Weiss 93167df1c0 bsp/arm/tms570: apply RTEMS clang format to tms570-pom.c 2026-06-04 18:13:15 -05:00
Avi Weiss 5e2f3ee8e0 bsp/arm/tms570: Guard write of ETO field in POMGLBCTRL to LS31x variant
LS31x variants have this ETO field in POMGLBCTRL but the LC43x
variants do not.

Guard the write so LC43x variants aren't trying to program a
non-existent field.
2026-06-04 18:13:15 -05:00
Avi Weiss 6c11754712 bsp/arm/tms570: Code cleanup (add U suffix + remove unused header)
Minor code cleanup while fixing an initialisation bug in this file.
2026-06-04 18:11:28 -05:00
Avi Weiss da293f1660 bsp/arm/tms570: Minor typo corrections for init_esm.c
Minor typo correction and standardise comment format.
2026-06-04 18:11:28 -05:00
Avi Weiss 092293c05e bsp/arm/tms570: Fix ESM bug to enable error pin + interrupt channels
Error pin and interrupt channels are write-one-to-set so setting all
to zero does not have the desired effect to enable them. We need to
write FFs (all ones).
2026-06-04 18:11:28 -05:00
Avi Weiss f55dd4fbf7 bsp/arm/tms570: Handle eFuse errors explicitly in system_hw_init
Status (error) returns 1 and 3 from tms570_efc_check are Class 1 and 2
i.e. very serious errors and should be dealt with explicitly in
tms570_system_hw_init.

These returns indicate that serious eFuse failures are either present
or cannot be ruled out and start-up should halt.
2026-06-04 18:10:31 -05:00
Sebastian Huber 37163afc97 build: Add explicit dependencies
Tests using the bld.cc() and bld.cxx() rules do not profit from the
automatic compiler dependency generation provided by the gccdeps.py waf
plugin.

Add "cpukit/include/rtems/score/cpuopts.h" as a hard-coded dependency to
these tests to account for configuration changes.  This fixes linker
errors, for example if the configuration changed the RTEMS_SMP option.

Close #5482.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-04 18:06:08 -05:00
Gedare Bloom e0818a6658 rtems-fdt: hold handle ref until end of rtems_fdt_prop_value
Fixes #5608
2026-06-03 20:17:45 -06:00
Matteo Concas 5e89997b25 grlib: Reformat headers with clang-format 2026-06-03 12:13:16 -05:00
Matteo Concas 7a2a99e0ef grlib: Reformat source with clang-format 2026-06-03 12:13:16 -05:00
Matteo Concas 84a696fba4 bsps/noel: Reformat headers with clang-format 2026-06-03 12:13:16 -05:00
Matteo Concas c056874472 bsps/noel: Reformat source with clang-format 2026-06-03 12:13:16 -05:00
Matteo Concas 9b0db1bb54 bsps/sparc: Reformat headers with clang-format 2026-06-03 12:13:16 -05:00
Matteo Concas aa904d80af bsps/sparc: Reformat source with clang-format 2026-06-03 12:13:16 -05:00
Gedare Bloom da105bb04f cpukit/rtems-fdt: release internally generated handles
rtems_fdt_prop_value() and rtems_fdt_prop_map() create a handle to
search for a path, but do not drop the handle if successful.

Fixes #5599
2026-06-03 08:28:15 -05:00
Gedare Bloom fd3d811a9c cpukit/rtems-fdt: test and fix index search by offset
The rtems_fdt_subnode_offset and rtems_fdt_get_name try to binary
search the entries index by the DTB offset, but the index is sorted
by alphabetically by the name, so the search is broken. Replace these
searches by directly calling the libfdt functions. Since the DTB offset
is known, the performance hit for invoking the libfdt should not be too
much.

Closes #5606.
2026-06-02 20:53:34 -05:00
Moksh Panicker 19c75efc9e sptests/sp13: Exercise rtems_message_queue_construct() in task1
sp13 already constructs Q3 using rtems_message_queue_construct()
in init.c but task1.c never sends to, receives from, or deletes
the constructed queue.

Extend task1.c to send a message to Q3, receive it back, and
delete the queue after the variable-size loop completes. This
exercises the full lifecycle of a queue created with static
storage and storage_free set to NULL.

Verified on arm/realview_pbx_a9_qemu with QEMU 9.0.2,
RTEMS 7.0.0.a413333f2f04130e82e15addba402887222c345f, GCC 15.2.0.
2026-06-02 20:51:58 -05:00
Avi Weiss 2308b1e588 bsp/arm/tms570: Correct typos in bspstarthooks-hwinit.c 2026-06-02 20:16:45 -05:00
Avi Weiss 370df09442 bps/arm/tms570: Guard parity self-tests for 4357 ECC-protected modules
RAM parity self-tests run on several RAM modules, which work fine for
the 3137 variants, but on 4357 variants some of those modules use
an ECC memory protection scheme.

This commit turns the relevent ones off for 4357 until proper ECC
self-tests are created.
2026-06-02 20:16:45 -05:00
Matteo Concas 0c6605b58b grlib: Add 64 bit compatibility
Work towards having GRLIB be a part of the NOEL BSPs
It is not "true" 64 bit as the devices themselves are still
on a 32bit bus.
2026-06-02 12:49:33 -05:00
Chris Johns 156d429516 spec/ftd01: Fix the DTB python generation code
Closes #5605
2026-06-02 15:28:03 +10:00