AcpiInitializeTables() runs from bsp_start(), long before there is a
heap for AcpiInitializeSubsystem() to create the mutex objects from.
The handle of a predefined mutex is a null pointer until then, so every
table which the table manager installs early reported that it could not
acquire the table mutex and then that it could not release it.
Treat a null handle as done rather than as a bad parameter. There is a
single thread of execution at that point and nothing to serialize.
The errors were not visible so far because the ACPICA output goes to the
standard output, whose buffer is discarded at the end of a test run.
Routing it to printk() makes them appear, 19001 lines in one suite run.
Close#5705.
Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
The four fatal validation suites open their test report at
RTEMS_SYSINIT_BSP_EARLY, so the report spans the whole system
initialization and every line the BSP prints during it lands inside the
report and breaks its hash.
Seven messages did, and each of them announces a normal outcome: no
video mode was requested, the interrupt controller has an ELCR, the PCI
BIOS interface works, the legacy UART ports exist, the machine has no
PCI to PCI bridge, and the console is the one which the command line
asked for. The messages for a failure stay.
The last one read the in service and the interrupt request register of
the 8259A and printed both when they disagreed about the line being
unmasked. A line which requests service and is not yet in service is
the normal state of a device with work pending, so it fired on the
clock and the console at every boot.
bootverbose is what a FreeBSD driver consults when the user asks for a
verbose boot. The copy here defined it as one.
Close#5698.
Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
The I/O mapped SJA1000 is required to support Kvaser CanS/D/Q boards
which have emulation in mainline QEMU.
The I/O space mapping is enabled by RTEMS_CAN_SJA1000_ARCH_WITH_IO_PORTS
option set in hw_options during initialization.
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
Close the flash file before returning from these 5 early setup failure
paths. Otherwise the file descriptor and selected flash region remain
allocated.
Open works correclty with the read_only argument but mount
ignores and always uses READ_WRITE.
Use RTEMS_FILESYSTEM_READ_ONLY when read_only is true so the
filesystem rejects write operations and does not perform erase
operations when under a read-only mount.
The RX overflow handling uses CAN_ERR_ID_LOSTARB, which is an
err_frame.header.can_id mask, as an err_frame.data index.
Correct it to use CAN_ERR_DATA_BYTE_TRX_CTRL as intended.
The Error Active frame populates the TX and RX error counter bytes
but does not set CAN_ERR_ID_CNT.
Set CAN_ERR_ID_CNT so consumers know the counter fields are valid.
The Error Active frame populates the TX and RX error counter bytes
but does not set CAN_ERR_ID_CNT.
Set CAN_ERR_ID_CNT so consumers know the counter fields are valid.
The RX overflow handling writes REG_COMMAND_CDO to CTUCANFD_TX_COMMAND
instead of CTUCANFD_COMMAND.
This writes the CDO bit to the transmit-command register (which is
reserved) so the data-overrun condition is not actually cleared.
Use CTUCANFD_COMMAND instead.
The RX overflow handling uses CAN_ERR_ID_LOSTARB, which is an
err_frame.header.can_id mask, as an err_frame.data index.
Correct it to use CAN_ERR_DATA_BYTE_TRX_CTRL as intended.
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>
Fix this error:
xnandpsu_onfi.c: In function 'XNandPsu_OnfiParamPageCrc':
xnandpsu_onfi.c:62:13: error: variable 'DataByteCount' set but not used
[-Werror=unused-but-set-variable=]
62 | u32 DataByteCount = 0U;
| ^~~~~~~~~~~~~
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
In rtems_gpio_define_pin_group(), several malloc() calls did not
check their return values. This could lead to NULL pointer
dereferences in later initialization steps.
The previous error handling also leaked memory and hardware pin
resources if an intermediate step.
This patch refactors the error handling path to address these issues.
Fix parity handling in zynq_uart_set_attributes() by clearing existing
parity bits before setting a new mode instead of always ORing PAR_NONE,
which caused incorrect or ignored parity; also fix inverted PARODD logic
and add ZYNQ_UART_MODE_PAR_MASK to manage the parity field correctly.
Fixes#5554
This code was flagged as maybe-uninitialized when compiling at -Og.
The underlying problem was functional code in an assert(). If
compiled with asserts disabled, there would have been no mutex
lock/unlock. Changed the macros to obtain and release the mutex
independent of assert() being enabled or not and switched to using
the RTEMS assert _Assert() which lets this check follow the
RTEMS_DEBUG setting.
- Constify bsp_interrupt_entry_find()
- bsp_interrupt_entry_find does not modify
the object referenced by arg, it only compares
pointer values against it.
- changed the parameter type from void* to
const void* in both declaration and
definition to make it correct and safer.
Update #4816
In SMP systems, the interrupt handler may run concurrently with tasks
trying to transmit. Properly protect the transmit state through the
device lock. Simplify the transmit process.
Close#5552.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
GCC 16 flagged this while GCC 15 did not. Because the variable was
used only when ACPI_DEBUG_PRINT() was defined to print, there was
no way to conditionalize the presence of the variable.
Added the "(void) NumCarats" hint to avoid the warning.
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>
This adds a BSP-level function that returns the calculated PSCI
target_cpu parameter for a given cpu_index. BSPs can override this
function to use the correct affinity level for the calculation.
Also updates _CPU_SMP_Start_processor() to make use of this
function and remove code duplication.
The function cast from more parameters to fewer parameters is generally
unsafe as the additional parameters will be undefined values that happen
to be in the right registers if it is ever called. Instead of casting
the function pointer, provide a dummy function pointer when the original
function pointer is non-NULL since it is only ever used for a
NULL-check.
This warning occurs when comparing a signed variable to an unsigned one.
This addresses warnings that only occurred on 64-bit targets. For the
ones which only appeared on 64-bit targets, the cause was frequently
a mismatch when comparing a combination off_t, ssize_t, and int.
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.