calls to tms570_irq_set_priority protect against requesting a
priority < 2, but not against inputs with vector < 2.
for example calling tms570_irq_set_priority(ESM_HIGH, 10)
will not only get through the guard, it will attempt to write
to CHANCTRL0 (which gets blocked by hardware), puts whatever
was there (apparently hardcoded INT-REQ0) into channel 10,
and returns success.
So the channel 10 request dissappeared from the VIM channel
map completely - yet this call returns RTEMS_SUCCESSFUL
TRM (for both TMS570LS31x and TMS570LC43x) states:
NOTE: CHAN0 and CHAN1 are hard wired to INT_REQ0 and
INT_REQ1, so they cannot be remapped.
This commit puts a guard to fail on requests with vector < 2.
uboot_environment and uboot_environment_size are configured through
build options UBOOT_ENV_BASE and UBOOT_ENV_SIZE.
Support for powerpc/qoriq is added.
For qoriq boards with u-boot, user can use the same environment
access fuctions shared with other bsps like gen83xx.
Closes#5481
The RTC driver used the unsupported BSD-style %b conversion with
only the diagnostic register value. This did not provide the
intended bitmask decoding.
Print the diagnostic register as a two-digit hexadecimal value
instead and remove the unused RTCDG_BITS definition.
The block logic uses realloc to resize memory used by libdebugger
when creating a snapshot of threads. Thread registers take a
reference to the block and if a realloc changes the base address
any references are invalid. Add rebase handler support to blocks
that is called when the block base changes and add a handler to
thread register blocks to rebase a thread's registers.
Exclude threads using both types of names they can have. This lets
all names be reported in extra thread info packets.
Closes#5635
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>
Extend the existing open() O_NOFOLLOW coverage to verify that a hard
link to a regular file is still resolved to its target, while symbolic
links remain subject to the O_NOFOLLOW check. This is the regression
test for the do_open() fix that uses RTEMS_FS_FOLLOW_HARD_LINK instead
of zero for the O_NOFOLLOW case.
The test writes a known marker to the regular file, creates a hard link
to it, opens the hard link with O_NOFOLLOW, and then checks both the
inode identity and the file contents read back through the descriptor.
Reading the contents is the part that actually distinguishes a correct
resolution from the bug. In the IMFS a hard link is a distinct node
(IMFS_node_control_hard_link) whose fstat handler forwards to the target
(IMFS_stat_hard_link), but whose read and mmap handlers are the default
ones that fail with ENOTSUP. When open() wrongly clears the follow flags
for O_NOFOLLOW, path evaluation stops at the hard link node instead of
resolving it, yet fstat() still reports the target's mode and inode. A
test that only checks st_mode/st_ino therefore passes even with the bug
present. Reading the marker back forces the descriptor to refer to the
real regular file, so the test fails (read returns ENOTSUP) unless the
hard link was actually followed.
When O_NOFOLLOW is used, open() should only prevent following
symbolic links. Hard links are still ordinary directory entries and
should continue to resolve to the target object.
Switch the follow flags from zero to RTEMS_FS_FOLLOW_HARD_LINK so the
path evaluator keeps hard links working while suppressing symbolic link
following.
Add a validation test for rtems_barrier_get_number_waiting() based on an
action requirement.
Update #5336.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de
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
Drop dependency on C library for div(). The _mktime_div() implementation
is in line with glibc, musl, and FreeBSD.
Update #5143.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
The fsclose01 test program contains general test cases for fclose(). It
does not depend on a particular filesystem.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_qspi.c:
In function 'alt_qspi_read':
bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_qspi.c:747:12:
error: variable 'data' set but not used
[-Werror=unused-but-set-variable=]
747 | char * data = (char *)dst;
| ^~~~
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
This patch fixes the timeval subtraction logic in psxmsgq01/init.c
which previously failed to borrow from the seconds component when
the microsecond difference was negative.
This bug resulted in negative microsecond values and an off-by-one
incorrect seconds count during timed queue verifications.
Additionally, this patch removes the associated "FIXME: This is wrong."
comment.
Remove SPARC_Clear_and_unmask_interrupt(). This functionality is
available through the Interrupt Manager:
- rtems_interrupt_clear()
- rtems_interrupt_vector_enable()
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
The SPARC_Clear_and_unmask_interrupt() is a no-operation except for
interrupt traps. In __gnat_install_handler_common(), handler for
interrupt traps are installed in another block at line 100.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Calling SPARC_Clear_and_unmask_interrupt() after installing an interrupt
handler with rtems_interrupt_handler_install() has two issues:
1. It is superfluous, since rtems_interrupt_handler_install() already
enables the interrupt vector.
2. While interrupts are disabled, clearing the interrupt may lead to a
lost edge triggered interrupt.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
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>
Remove test-specific magic value CPUUSE_SOFT_TICKS and replace it with
SOFTWARE_TIMECOUNTER_INTERVAL defined by the validation test support
API.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
For some interrupt controllers like the RISC-V PLIC, a maximum interrupt
priority value of UINT32_MAX is valid. Adjust the validation tests to
take this into account.
In general, all the present interrupt controller API validation tests
have a structural issue. They contain the loop over all interrupt
vectors directly in the action requirement. This is not the right
approach. It is better to use an action requirement which produces a
test run function by defining a test header through the `test-header`
attribute. Then call the test run function for all interrupt vectors.
This approach allows to using the `${.:skip}` feature.
In this commit, this is new approach is applied to the interrupt get/set
priority validation tests.
Close#5578.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
In the interrupt clear validation test case, raise the interrupt only if
it can be done.
Update #4846.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Correct wording according to ISVV finding:
RTEMS-SMP-REQ-VER-020 - Colliding descriptions
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.