Commit Graph

1563 Commits

Author SHA1 Message Date
Chris Johns
6269686dfb rtemscxx: Support building on Unix
This lets you develop unittests on Unix.
2025-10-14 14:43:26 +11:00
Gedare Bloom
523b97ed40 cpukit/rtems: regenerate basedefs with fallthrough
Regenerate basedefs from specifications with RTEMS_FALL_THROUGH().
2025-10-13 19:02:19 +00:00
Joel Sherrill
34f9c5690d cpukit: Address unused parameter warnings
Add "(void) param;" annotation to address unused parameter warnings.
Found with GCC's warning -Wunused-parameter.
2025-10-10 21:59:38 +00:00
Kinsey Moore
38e8e5c286 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.
2025-10-02 20:12:51 -04:00
Joel Sherrill
fd0123a7ef cpukit/include/rtems/rtems/timerimpl.h: Used unsigned type for mask
This addresses an issue found by the GCC -Wsign-compare warning.
The code was using a signed type for a bit mask.
2025-09-26 22:29:56 +00:00
Joel Sherrill
86f00b3183 cpukit/include/.../*.h: Address unused parameter warnings
These files are included multiple times and any warning in these
results in many warning instances. Found with GCC's warning
-Wunused-paramter.
2025-09-25 14:41:34 -05:00
Kinsey Moore
75e7f5cb80 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.
2025-09-22 10:04:58 -05:00
Jeremy Lorelli
d8ba01ec52 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.
2025-09-20 08:57:16 +10:00
Joel Sherrill
38c0f48f53 cpukit/include/rtems/score/basedefs.h: Add RTEMS_FALL_THROUGH()
The RTEMS_FALL_THROUGH macro was needed to provide a portable
way to annotate that a case in a switch statement intentionally
does not have a break statement. It is known as "falling through"
and a common bug.

Adding this macro enabled addressing -Wimplicit-fallthrough warnings.
2025-09-19 19:02:25 +00:00
Joel Sherrill
fd9f54ed23 pipe support: Update attribution email and relicense to 2-BSD
Wei Shen gave permission to relicense and asked to change the
email address to match that used on GitHub.

Updates #3053.
2025-09-18 09:26:39 -05:00
Mazen Adel Elmessady
f929bcba5b cpukit/posix: Added pthread clock functions
Added pthread_cond_clockwait(), pthread_mutex_clocklock()
pthread_rwlock_clockrdlock() and pthread_rwlock_clockwrlock()
that are new in POSIX Issue 8. Also added tests.
The implementation used the timed versions of these functions
as a reference.

Updates
rtems/programs/gsoc#69
2025-09-10 19:56:50 +00:00
Mazen Adel Elmessady
c6606de311 cpukit/posix: Add clock support to thread queue timeouts
Added new functions to thread queue infrastructure to support
clock-specific timeout operations, making it easier to integrate
POSIX Issue 8 clock functions.

Updates
rtems/programs/gsoc#69
rtems#24
2025-09-06 16:16:12 +00:00
Kinsey Moore
b898aa6203 cpukit/flashdev: Correct page/sector references 2025-09-05 13:13:19 -05:00
Bhavya Shah
4646d614c3 cpukit/libfs/imfs: Fix the maximum file size calculation
Fixes #5319
2025-09-04 18:26:46 -05:00
Martin Erik Werner
b19d1c49ed cpukit: Correct region documentation notes
Update the rtems_region_get_information() and
rtems_region_get_information() documentation with various more or less
minor wording fixes:

* "obtain a diagnostic information." ->
  "obtain diagnostic information."

* "This method forms am O(n)" ->
  "This directive performs an O(n)"

* "scan of the free in the region" ->
  "scan of the free blocks in the region"

* "many used blocks and a much smaller number of used blocks" ->
  "many used blocks and a much smaller number of free blocks"

These changes were generated from rtems-central.
2025-09-04 15:46:44 +00:00
Joel Sherrill
a162a5cdcf cpukit/include/*: Fix old style declaration
Newer C versions require that the storage-class specifier like
static or _Thread_Local be the first thing in a declaration.
2025-09-03 09:15:17 -05:00
Sebastian Huber
79ca48adcc rtems: Use single '`' for code phrases
These files are generated from specification items.  Use Markdown
format.
2025-09-02 16:54:57 +00:00
Sebastian Huber
33e3b09c16 rtems: Use '-' instead of '*' for Doxygen lists
These files are generated from specification items.  The Markdown
formatting tool used for the documentation sources requires the use
of '-' for lists instead of '*'.
2025-09-02 16:54:57 +00:00
Sebastian Huber
d07bf743a3 rtems: Add missing copyright
Add copyright for rtems_barrier_get_number_waiting().
2025-09-02 16:54:57 +00:00
Kinsey Moore
94251a25fb cpukit: Remove telnetd
The telnet server library is being moved from the primary RTEMS
repository to the rtems-net-services repository.

Updates #5290
2025-08-26 14:42:42 -04:00
Joel Sherrill
51a2ee5e33 cpukit/*: Add SPDX for RTEMS legacy license
These may still be relicensed but adding SPDX is needed.

Updates #4805.
2025-08-22 10:14:12 -05:00
Martin Erik Werner
cf388ecb03 cpukit: Reword chain get wait routine->directive
Based on discord comment from Sebastian Huber suggesting that directive
would be appropriate terminology for referring to an "RTEMS API
function".
2025-08-21 13:06:07 -05:00
Martin Erik Werner
cec22d9b66 cpukit: Correct rtems_chain_get_with_wait() doc.
The Doxygen documentation for rtems_chain_get_with_wait() appears to be
incorrect based on a copy-paste from rtems_chain_get_with_notification().

Correct the documentation to describe the get and wait mechanism.
2025-08-21 13:06:07 -05:00
Sebastian Huber
6477324b4c rtems: Fix Doxygen comments
Use matching parameter names.
2025-08-21 17:16:10 +00:00
Lucian Silistru
45b1495a8a record: Avoid dependency on object link order
For the application configuration option
CONFIGURE_RECORD_INTERRUPTS_ENABLED, define
bsp_interrupt_get_dispatch_table_slot() in the application configuration
to avoid issues with the object link order within the RTEMS libraries.

Enable this option in an associated test.

Close #5244.
2025-08-12 13:18:30 -05:00
Joel Sherrill
3470ea15f1 cpukit/include: Move SPDX line to top of file
The RTEMS Software Engineering Guide specifies that the SPDX license
annotation shouldbe the first line of the file and not part of the
copyright/license comment block.
2025-08-11 19:06:32 +00:00
Amar Takhar
3fcf78156d cpukit: Remove utf8proc and add to build
This also moves the header from <utf8proc/utf8proc.h> to <utf8proc.h>  This
follows what the upstream project uses and keeps us from having to modify
upstream source to put it in a subdirectory.
2025-07-31 18:07:34 -05:00
Amar Takhar
e9870fa74f cpukit: Remove uuid and add to build
Did the best I could handling the location of uuid.h
2025-07-31 18:01:42 -05:00
Amar Takhar
9ff0fd6f5b cpukit: Delete zlib and add to build
Includes had to be added to jffs2 and cpukit.
2025-07-31 17:51:28 -05: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
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
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
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
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
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
Chris Johns
deb26068f0 machine/timecounters: Add missing _Timecounter_ decls
Add:

 - _Timecounter_Getboottime
 - _Timecounter_Getboottimebin

Closes #5211
2025-05-08 22:37:32 +00:00
Chris Johns
e640d6b602 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:28:24 +11:00
Gedare Bloom
b66b0d9804 rtems/event: regenerate from central 2025-03-19 02:09:21 +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
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
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