Commit Graph

36999 Commits

Author SHA1 Message Date
Sebastian Huber
7d59c6e03c dtc: Update VERSION 2025-03-10 22:44:01 +00:00
Ayush Singh
f85c80bb82 libfdt: Add fdt_setprop_namelen_string()
Macro using fdt_setprop_namelen() internally similar to
`fdt_setprop_string()`.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Message-ID: <20241205-setprop-namelen-v2-4-0d85a3d2e7b1@beagleboard.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Ayush Singh
149d5b1297 libfdt: Add fdt_setprop_namelen()
Allow specifying name length in setprop similar to
`fdt_get_property_namelen` functions.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Message-ID: <20241205-setprop-namelen-v2-3-0d85a3d2e7b1@beagleboard.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Ayush Singh
b42a20221a libfdt_internal: fdt_find_string_len_()
Allow specifying string length to `fdt_find_string_`.
fdt_find_string_() now internally uses this function.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Message-ID: <20241205-setprop-namelen-v2-2-0d85a3d2e7b1@beagleboard.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Ayush Singh
c8a2404c20 libfdt: add fdt_get_property_namelen_w()
Similar to the non-namelen variant, it is implemented in terms of
fdt_get_property_namelen()

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Message-ID: <20241205-setprop-namelen-v2-1-0d85a3d2e7b1@beagleboard.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Bingwu Zhang
c1c2f18e4a libfdt: Remove extra semi-colons outside functions
When compiling with -Werror -Wpedantic, both GCC and Clang fails, saying
that these semi-colons are redundant, so remove them.

Signed-off-by: Bingwu Zhang <xtexchooser@duck.com>
Message-ID: <20241116101228.164707-6-xtex@envs.net>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Rasmus Villemoes
cea524f01e libfdt.h: whitespace consistency fixups
In these cases, spaces are used for indentation/alignment while the
surrounding lines use tab. Fix it up for consistency.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Rasmus Villemoes
f82a2d0ae7 libfdt.h: typo and consistency fixes
Most of these are plain typos. Exceptions:

- "devicetree" is only used in that form in the grammar and in mailing
  list references; all other instances, in particular all in prose,
  use "device tree".

- I don't know what "nodeequested" was supposed to be, the sentence
  reads just fine without it.

- "inexistant" is a rare form of nonexistent.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Pierre-Clément Tosi
45be19a34a libfdt: fdt_path_offset_namelen: Reject empty path
Reject empty paths and negative lengths, according to the DT spec v0.4:

    The convention for specifying a device path is:
        /node-name-1/node-name-2/node-name-N

    The path to the root node is /.

This prevents the access to path[0] from ever being out-of-bounds.

Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Message-ID: <20231010092822.qo2nxc3g47t26dqs@google.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Pierre-Clément Tosi
1ce89bdf14 libfdt: fdt_get_alias_namelen: Validate aliases
Ensure that the alias found matches the device tree specification v0.4:

    Each property of the /aliases node defines an alias. The property
    name specifies the alias name. The property value specifies the full
    path to a node in the devicetree.

This protects against a stack overflow caused by

    fdt_path_offset_namelen(fdt, path, namelen)

calling

    fdt_path_offset(fdt, fdt_get_alias_namelen(fdt, path, namelen))

leading to infinite recursion on DTs with "circular" aliases.

This fix was originally written by Mike McTernan for Android in [1].

[1]: 9308e7f977

Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Acked-by: Mike McTernan <mikemcternan@google.com>
Message-ID: <20231010092725.63h7c45p2fnmj577@google.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Pierre-Clément Tosi
48ba49052f libfdt: Fix fdt_appendprop_addrrange documentation
According to the documentation, the function should default to the very
common property name <reg> when none is "specified". However, neither
passing NULL (ends up calling strlen(NULL) and segfaults) nor ""
(appends a property with an empty name) implements this behavior.

Furthermore, the test case supposed to cover this default value actually
passes the value to the function, somewhat defeating its own purpose:

    /* 2. default property name */

    // ...

    err = fdt_appendprop_addrrange(fdt, 0, offset, "reg", addr, size);
    if (err)
            FAIL("Failed to set \"reg\": %s", fdt_strerror(err));
    check_getprop_addrrange(fdt, 0, offset, "reg", 1);

Finally, nothing in the implementation of the function seems to attempt
to cover that use-case.

As the feature can't ever have been used by clients and as the resulting
reduced readability of the caller seems (IMO) to outweigh any potential
benefit this API would bring, remove the erroneous documentation instead
of trying to fix the function.

Reported-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Message-ID: <20230831123918.rf54emwkzgtcb7aw@google.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Yan-Jie Wang
71c63c9cd1 libfdt: Fix a typo in libfdt.h
The function mentioned in the comment, fdt_finished(), should be
changed to fdt_finish().

Signed-off-by: Yan-Jie Wang <yanjiewtw@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Rasmus Villemoes
bfaebcc352 improve documentation for fdt_path_offset()
The current documentation doesn't mention the possibility of passing a
non-absolute path and having that treated as an alias. Add that
information, along with an example (which will further be expanded in
a subsequent patch), and clarify when -FDT_ERR_BADPATH can be returned.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Rasmus Villemoes
98975f5e93 add fdt_get_symbol() and fdt_get_symbol_namelen() functions
The fdt_get_symbol_namelen() function will be used in a subsequent
patch.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Rasmus Villemoes
e3ce2b63ba use fdt_path_getprop_namelen() in fdt_get_alias_namelen()
Simplify the code by making use of the new helper.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Rasmus Villemoes
981699bef0 add fdt_path_getprop_namelen() helper
Add a wrapper for fdt_getprop_namelen() allowing one to specify the node
by path instead of offset.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Kees Cook
de9953c6a0 libfdt: Replace deprecated 0-length arrays with proper flexible arrays
Replace the 0-length arrays in structures with proper flexible
arrays. This will avoid warnings when building under GCC 13 with
-fstrict-flex-arrays, which the Linux kernel will be doing soon:

In file included from ../lib/fdt_ro.c:2:
../lib/../scripts/dtc/cpukit/dtc/libfdt/fdt_ro.c: In function 'fdt_get_name':
../lib/../scripts/dtc/cpukit/dtc/libfdt/fdt_ro.c:319:24: warning: 'strrchr' reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
  319 |                 leaf = strrchr(nameptr, '/');
      |                        ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2025-03-10 22:44:01 +00:00
Kinsey Moore
ece058c6a3 bsps/m68k/shared: Remove unreferenced gdb stub
Closes #5213
2025-03-10 22:32:30 +00:00
Joel Sherrill
9e7371709d m68k (VBR): Change definition and use of m68k_get_vbr() to fix warning
GCC 14 is pickier and flagged this use of a linker symbol.
2025-03-05 16:19:33 +00:00
Joel Sherrill
68baf9eead libmisc/shell/*: Relicense to 2-BSD
Many files in this directory were by persons and organizations
that have previously given relicensing permission. git history
was used to confirm authorship and contributions on files which
had unclear or missing copyrights.

Update #3053.
2025-03-01 20:21:56 +00:00
Gedare Bloom
0149e6e749 spdx: add 2-BSD SPDX tags on relicensed files
Updates the recently merged relicensed files with the 2-Clause BSD
SPDX annotation.

Closes #5208.
2025-03-01 04:14:54 +00:00
Gedare Bloom
e463f8c968 powerpc: Relicense to 2-BSD
This batch of relicensing was enabled by the combination of Eric
Valette and Andy Dachs giving permission.

Updates #3053
2025-03-01 00:40:17 +00:00
yang.zhang
ad81baf160 cpukit/posix: signal() should return SIG_ERR on error
When signum is invalid, return SIG_ERR, and set errno to
indicate the cause.
2025-02-28 16:23:16 +00:00
Joel Sherrill
52b9cc90cb bsps/sparc/leon3/start/setvec.c: Fix set_vector() warning
This was flagged by GCC 14
2025-02-24 16:47:52 -06:00
Joel Sherrill
04db5eaee1 bsps/shared/start/setvec.c: Fix warning across multiple BSPs
GCC 14 flags this method with a warning.
2025-02-24 16:46:58 -06:00
Joel Sherrill
330d011318 m68k/shared/cache/cache-*.c: Remove unused variants
With the removal of multiple m68k and Coldfire BSPs, these cache
implementatoin variants were no longer referenced.

Updates #5031
2025-02-12 22:09:41 +00:00
Joel Sherrill
807584adfd m68k/shared/fpsp: Remove obsolete m68040 FP Support Code
The Motorola MC68040 did not completely implement IEEE754 in hardware.
The FPSP code was required to complete the support. With no more
MC68040 BSPs in RTEMS, this code can be removed.

Updates #5031
2025-02-12 12:51:58 -06:00
Chris Johns
8d78a68ece Revert "build: Provide LDFLAGS for pkg-config"
This reverts commit 237570e605
2025-02-11 05:49:15 +00:00
Gedare Bloom
078baccade rtemscxx: replace URLs with emails in copyright
Updates #4636.
2025-02-11 04:02:43 +00:00
Joel Sherrill
d33aba4a8d bsps/arm/shared/cp15/arm920-mmu.c: Fix array overwrite
An extern for the linker symbol _ttbl_base was declared incorrectly
and gcc reported an overwrite of the four byte area by 16K. Switched
to using the standard linker symbol macros and the warning was
removed.
2025-02-10 15:47:10 +00:00
Joel Sherrill
a7dd196f01 csb337/umon/tfsDriver.c: Fix warning for possible string too long
GCC detected this.
2025-02-10 15:47:10 +00:00
Joel Sherrill
56c8d65b30 csb337/umon/tfsDriver.c: Fix warning for ioctl cmd parameter
The cmd parameter was uint32_t and should have been ioctl_command_t.
2025-02-10 15:47:10 +00:00
Gedare Bloom
8e6ded473c rtems: update licenses to 2BSD
This is an update of many lingering embedded brains GmbH licenses from
the RTEMS License to the 2-BSD license where possible depending on the
joint copyrights.

Updates #3053.
2025-02-10 15:44:09 +00:00
Sebastian Huber
294761ca8d posix: Improve clock_gettime()
Return CPU usage values for CLOCK_PROCESS_CPUTIME_ID and
CLOCK_THREAD_CPUTIME_ID.
2025-02-10 15:37:18 +00:00
Joel Sherrill
5a9484e6cb m68k/mvme147: Remove obsolete BSP family
Updates #5031
2025-02-10 08:49:24 -06:00
Amar Takhar
a02b560f61 gitlab: Add ignore file
This uses TOML as the file will be hand curated.  This isn't the final version
but gets us started there are still more tools to add eventually the format
will be settled getting the data in was the most important part.
2025-02-08 08:34:12 -05:00
Gedare Bloom
0055b067d2 rtems: update IMD licenses to 2BSD
This is an update of IMD (precursor to embedded brains) licenses from
the RTEMS License to the 2-BSD license where possible depending on the
joint copyrights.

Updates #3053.
2025-02-08 03:46:59 +00:00
Sebastian Huber
2b035f7b90 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 #5172.
2025-02-07 16:16:26 -07:00
Sebastian Huber
237570e605 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 #5169.
2025-02-07 12:13:18 -06:00
Kinsey Moore
f4c179c610 bsps/shared/dev/spi: Fix undefined function warning
This adds the appropriate header to resolve a warning about a missing
declaration for the fls() function.
2025-02-07 17:58:16 +00:00
Gedare Bloom
efa431e9ce powerpc: replace OARcorp URL with rtems.org URL 2025-02-07 15:11:11 +00:00
Jan Sommer
ab21dcba06 grlib/occan: Fix baud rate calculation
Fixes #5166
2025-02-07 15:08:07 +00:00
Gedare Bloom
23fa41ecae cpukit: relicense shell and telnetd files
These files are mostly authored by Fernando Ruiz Casas.

Updates #3053.
2025-02-07 15:01:13 +00:00
Kinsey Moore
52c3ddfc3c riscv: Correct spelling of hart
RISC-V cores are called harts and have a hart ID (hartid).
2025-02-07 14:59:53 +00:00
Gedare Bloom
613f701b8c m68k: Relicense mcf3272.h to 2BSD
Update license for contributions from Jay Monkman in MIPS BSPs.

Updates #3053.
2025-02-07 14:57:34 +00:00
Gedare Bloom
bc941aa99b mips/csb350: Relicense to 2BSD
Update licenses for contributions from Jay Monkman in MIPS BSPs.

Updates #3053.
2025-02-07 14:57:34 +00:00
Gedare Bloom
9a1efe6f91 bsps/shared: relicense to 2BSD
Updates #3053.
2025-02-07 14:53:18 +00:00
Gedare Bloom
e27d41a38a bsps/rtc: add copyright and relicense based on git history
Updates #3053.
2025-02-07 14:53:18 +00:00
Joel Sherrill
b30d88cb87 m68k/mcf5225x: Remove obsolete BSP family
Updates #5031
2025-02-07 14:19:00 +00:00
Joel Sherrill
46e90be362 m68k/mrm332: Remove obsolete BSP family
Confirmed with Robominds

Updates #5031
2025-02-07 14:15:27 +00:00