Define RTEMS_STATIC_ANALYSIS for the clang analyzer. For example, this
helps to reduce false positives related to dead branches.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
This commit splits heapimpl.h
to heapimpl.h and heapfirstfitimpl.h.
By moving first-fit-specific definitions into
heapfirstfitimpl.h and keeping only generic
heap helper definitions in heapimpl.h.
Updates:
rtems/rtos/rtems#5620
- Change TLS_Dynamic_thread_vector
generation_number from uint32_t to uintptr_t.
- Using a machine-word type resolves the FIXME concern
about correctness across architectures, since uintptr_t
is guaranteed to match size on both 32-bit and 64-bit
targets.
Updates #4827
- Removed #if 1 clause and error comment section.
- Updated the RTEMS_INVALID_SIZE doxygen comments for
queue create and construct directives.
- Added mp11 checks for oversized global message
queues to verify both rtems_message_queue_create()
and rtems_message_queue_construct() return
RTEMS_INVALID_SIZE when size is
max_packet_payload_size + 1.
- Updated mp11 documentation and expected output
to include these checks.
Updates #4819.
- Added a description to the _CONFIGURE_ASSERT_NOT_NULL() macro
definition in doxygen format.
- Improved comment section above the #pragmas to ignore warnings.
Updates #4831.
- Add a default pipe2 which retuns an error.
- Add pipe and pipe2 handler register calls so implementations
with different file descriptors can use these calls.
Closes#5673
When the device is open multiple times and data
are sent to driver by multiple FIFOs/edges then
round-robin between same priority prevents
one application blocking whole bandwidth.
The problem has been introduced during switch
from original uLUt/LinCAN to NewLib provided TAILQ
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
duplicate2_iop() assumed its target is open. A free target stayed on
the iop free list with no LIBIO_FLAGS_OPEN and no reference, so the
call answered success while the new descriptor answered EBADF to
everything and a later allocation handed the same iop out again.
Claim the target from the free list, release the previous location
when the target was open, publish LIBIO_FLAGS_OPEN only after the
open handler agreed, and answer the descriptor for a target that is
the source itself.
Closes#5670
vfcntl() never read the third argument: the duplicate was the next
free iop, whatever the caller asked for, an out-of-range minimum was
not refused, and a full table answered -1 with errno unset. POSIX
wants the lowest available descriptor at or above the argument, EINVAL
for a negative or out-of-range argument and EMFILE for a full table.
The free list is kept in close order, so rtems_libio_allocate_minimum()
walks it for the lowest qualifying entry.
Closes#5668
This clarifies the flashdev out of band read and write interfaces and
updates any consumers of those interfaces. This was partially refactored
at one point and the refactoring didn't extend to the consumers as it
should have.
More i2c drivers from cpukit to bsps/shared to allow them use BSP
infrastructure if needed. The framework code i2c-bus.c and i2c-dev.c
kept at its original location.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Move CAN controllers from cputik to bsps/shared directory. This will
allow to use BSP level interface which may be needed for some
controllers. Generic CAN stack implementation is still kept in the
original directory as this shoudl be independent from the low level
driver interface.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
The CAN/CAN FD stack requires a worker task per configured queue.
Empirical profiling confirms the CAN worker task utilizes ~404 bytes
of stack space on 32-bit architectures.
This patch introduces CONFIGURE_MAXIMUM_CAN_QUEUES to dynamically
inject the required CAN worker tasks into the master _CONFIGURE_TASKS
pool. Because the 404-byte usage falls below RTEMS_MINIMUM_STACK_SIZE,
provisioning them as standard system tasks automatically guarantees
sufficient stack space overhead.
Additionally, this patch removes the hardcoded +0x1000 stack padding
in rtems_task_create to prevent workspace exhaustion, and adds the
spcan01 test to verify the CONFIGURE_MAXIMUM_CAN_QUEUES macro behavior.
Closes#5193
The `mdformat` tool used for the documentation formatting uses `-`
instead of `*` for list items. Harmonize the format especially for the
files generated from specification items.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Using signed integers for bit fields may result in undefined or
implementation-defined behaviour. Use an unsigned type instead.
Requires a matching Newlib version.
Update #4864.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Move the upstream FatFs sources from cpukit/libfs/src/fatfs to
contrib/fatfs.Keep the RTEMS integration layer (rtems-fatfs-*.c and
rtems-diskio.c) in libfs. Introduce a wrapper header under rtems/fatfs
and update internal sources to use it.
Update the build specification to reference the new location without
introducing global include paths.
Fixes#5433
The change to avoid deadlock could introduce a race condition on the
blobs chain and the handle. Refactor the rtems_fdt_valid_handle() to
create an internal unprotected version, and call it with the global
rtems_fdt_lock() held.
This commit adds support for a stand alone SJA1000 CAN controller. This
is classical CAN only capable controller, so no FD support here. The
driver's implementation is similar to CTU CAN FD, thus interrupt handler
triggers a semaphore in main worker thread that takes care of handling
interrupts and receiving and sending messages.
The controller utilizes its one TX buffer for sending messages with
abort function available if higher priority message is present in
the software queue.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
This commit renames function rtems_ctucanfd_initialize to
rtems_can_ctucanfd_initialize. It standardizes the naming for CAN
controllers to always begin with rtems_can_ (similar to virtual
controller or sja1000 at the moment under review).
This is an API breaking change.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Clear semaphore flags in Debug mode before freeing object.
This ensures Object.Node.previous is NULL to satisfy _Chain_Is_node_off_chain.
Updates #5491
Semaphore wait nodes store flags in the left part of previous.
So _Chain_Is_node_off_chain() is not safe in all semaphore paths.
Use node->next == NULL where needed for semaphore wait nodes.
Updates #5491
Cast the literal 1 to rtems_error_code_t before shifting to avoid
undefined behavior on systems with a 16-bit int.
Include <limits.h> for CHAR_BIT.
Signed-off-by: Shivam Deolankar <shivam.deolankar@gmail.com>
These changes eliminate the year 2100 as a limit for TOD. The new
limit is the year 4096. This limit is not due to any RTEMS limitation
but just before the year 4183 when the rounding error in the length
of the year adds up to an entire day. See
https://de.wikipedia.org/wiki/Schaltjahr for details.
There are still limits on Classic APIs which use the 32-bit rtems_interval
type. This corresponds to the Score Watchdog_Interval type. This impacts
delays, timeouts, and Classic API "after" timers.
Closes#5143
Co-authored-by: Joel Sherrill <joel@rtems.org>
Co-authored-by: Gedare Bloom <gedare@rtems.org>