Commit Graph

36110 Commits

Author SHA1 Message Date
Sebastian Huber
8266a8a335 bsps/leon3: Move code blocks
Move code blocks to simplify C preprocessor usage.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
abb2f8bd66 bsps/leon3: Use custom CPU counter implementation
Merge the timecounter and CPU counter support for the leon3 BSP family.
Remove now unused functions from the CPU counter support of the erc32
and leon3 BSPs.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
ff533cec9d bsps/leon3: Simplify clock and CPU counter
Share the timecounter instance between the clock and the CPU counter.
This greatly simplifies the clock driver since we have to do the device
selection only in one place, the CPU counter support.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
3f03a6d2ef bsps/leon3: Make GPTIMER fall back mandatory
Using the auto reload counter which generates the clock ticks for the
timecounter or CPU counter is quite difficult and only works in
uniprocessor configurations.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
b6dc4b4707 sparc: Move CPU counter implementation
Enable a BSP-specific CPU counter implementation.

Update #4954.
2023-10-20 11:16:54 +02:00
Sebastian Huber
8fe0fc4721 bsps/leon3: Optional IRQ(A)MP timestamp support
This is necessary to run the tests on SIS with profiling enabled.

Update #4954.
2023-10-20 11:16:53 +02:00
Sebastian Huber
95cf6e57be bsps/leon3: Update due to register API changes 2023-10-20 11:16:53 +02:00
Sebastian Huber
c15132aafd mpci: Hide implementation details
This improves the standard compatibility of API headers.  It fixes
errors like this if RTEMS_MULTIPROCESSING is enabled:

cpukit/include/rtems/score/processormask.h: In function 'uint32_t _Processor_mask_Find_last_set(const Processor_mask*)':
cpukit/include/rtems/score/processormask.h:339:21: error: 'flsl' was not declared in this scope
  339 |   return (uint32_t) __BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );
      |                     ^~~~~~~~~
2023-10-20 11:16:53 +02:00
Tian Ye
a738d69bcf bsps/aarch64: Disable use of TTBR1
Force use of addresses that would be translated by TTBR1 to cause a
translation fault. RTEMS on AArch64 does not use TTBR1 and so attempted
translation of that address range could cause unexpected behavior in the
form of other exception types since TTBR1 is never set.
2023-10-18 10:14:42 -05:00
Kinsey Moore
e7cb79c39d cpukit: Remove unused includes 2023-10-13 19:02:15 -05:00
Kinsey Moore
5b22003411 bsps: Remove unused includes 2023-10-13 19:02:15 -05:00
Sebastian Huber
406ad8a5ae powerpc/t32mppc: Improve terminal settings 2023-10-13 09:51:29 +02:00
Sebastian Huber
ed2817c4c6 powerpc/t32mppc: Remove obsolete config options 2023-10-13 09:51:29 +02:00
Sebastian Huber
8290784378 powerpc/t32mppc: Fix console driver
Make sure that the message buffers are not garbage collected by the
linker.
2023-10-13 09:51:29 +02:00
Kinsey Moore
0a1d0dce3b cpukit/jffs2: Correctly init jffs2_inode_info
The repeated reinitialization of jffs2_inode_info must be done by the
members of the struct to avoid altering others.
2023-10-12 18:56:43 -05:00
Kinsey Moore
d7aa1ab86f cpukit/jffs2: Implement JFFS2 spinlocks
This provides a non-noop implementation of spinlocks for JFFS2 in terms
of RTEMS mutexes. POSIX spinlocks are not appropriate for the types of
actions that occur during a held JFFS2 spinlock and can cause bad
dispatch level conditions.
2023-10-12 18:56:43 -05:00
Kinsey Moore
c5476e2b8c bsps/xilinx-zynqmp: Unify JFFS2 OOB write locking
Ensure that a single locking session is carried over OOB writes
including the OOB read that is sometimes required. This removes the
possibility of another write occurring between the read and write that
would make the write incorrect.
2023-10-12 18:56:43 -05:00
Joel Sherrill
b9f7eb2a92 fat_fat_operations.c: Fix incorrect indentation 2023-10-12 18:56:29 -05:00
Sebastian Huber
43b74b142e validation: Support powerpc in test case
Update #4955.
2023-10-12 16:33:37 +02:00
Sebastian Huber
f7632d0dad testsuites/unit: Fix build error on aarch64
Update #3716.
2023-10-12 15:22:22 +02:00
Sebastian Huber
429727cdf3 testsuites/unit: Add tests for compiler builtins
Explicitly test the 64-bit integer division and modulo operations.  They
are essential for the timekeeping services.  On most 32-bit targets,
they need a software implementation.

Update #3716.
2023-10-12 14:11:03 +02:00
Sebastian Huber
2cb3d75d9e validation: Test CPU performance
Measure the runtime of 1000 no-operation instructions.  This may help to
investigate runtime measurement variations which do not result from code
generation or source code changes.

The runtime measurement of a function which does nothing and just
returns gives an estimate of the measurement overhead.

Update #3716.
2023-10-12 14:10:57 +02:00
Sebastian Huber
1781b517dd validation: Check thread dispatching detail
Update #3716.
2023-10-12 14:10:45 +02:00
Sebastian Huber
1c36971d92 sparc: Fix stack corruption
Fix a potential stack corruption in uniprocessor configurations during
start multitasking.

The system initialization uses the interrupt stack.  A first level
interrupt shall never interrupt a context which uses the interrupt
stack.  Such a use would lead to stack corruption and undefined system
behaviour.  Unfortunately, in uniprocessor configurations this was the
case.  Multiprocessing is started using _CPU_Context_restore().  The
caller of this function (_Thread_Start_multitasking()) uses the
interrupt stack.  Later we have in cpukit/score/cpu/sparc/cpu_asm.S:

        mov     %g1, %psr                     ! restore status register and
                                              ! **** ENABLE TRAPS ****

        ld      [%o1 + G5_OFFSET], %g5        ! restore the global registers
        ld      [%o1 + G7_OFFSET], %g7

        ! Load thread specific ISR dispatch prevention flag
        ld      [%o1 + ISR_DISPATCH_DISABLE_STACK_OFFSET], %o2
        ! Store it to memory later to use the cycles

        ldd     [%o1 + L0_OFFSET], %l0        ! restore the local registers
        ldd     [%o1 + L2_OFFSET], %l2
        ldd     [%o1 + L4_OFFSET], %l4
        ldd     [%o1 + L6_OFFSET], %l6

        ! Now restore thread specific ISR dispatch prevention flag
        st      %o2, [%g6 + PER_CPU_ISR_DISPATCH_DISABLE]

        ldd     [%o1 + I0_OFFSET], %i0        ! restore the input registers
        ldd     [%o1 + I2_OFFSET], %i2
        ldd     [%o1 + I4_OFFSET], %i4
        ldd     [%o1 + I6_FP_OFFSET], %i6

        ldd     [%o1 + O6_SP_OFFSET], %o6     ! restore the output registers

Between the ENABLE TRAPS and the restore of the output registers, we
still use the stack of the caller and interrupts may be enabled.  If an
interrupt happens in this code block, the interrupt stack is
concurrently used which may lead to a crash.

Fix this by adding a new function _SPARC_Start_multiprocessing() for
uniprocessor configurations.  This function first sets the stack pointer
to use the stack of the heir thread.

Close #4955.
2023-10-12 14:10:40 +02:00
Chris Johns
25a4dff56e bsp/i386/pc686: Clean up warnings 2023-10-04 13:17:13 +11:00
Sebastian Huber
a1fc6555a6 libtest: Include missing header file
This fixes the build if RTEMS_PROFILING is enabled.
2023-10-02 07:31:20 +02:00
Kinsey Moore
f3f8aa5b9b cpukit/aarch64: Resolve warnings with ILP32 ABI
Casts from uint64_t to void* must go through a uintptr_t cast to avoid
warnings when building with the ILP32 ABI since this is otherwise an
implicit truncation to 32bits for a pointer.
2023-09-26 09:02:48 -05:00
Kinsey Moore
99c637fbd9 cpukit/jffs2: Avoid use of off-chain semantics
This reworks the JFFS2 delayed work queue to avoid use of
on-chain/off-chain semantics since they vary in behavior under
RTEMS_DEBUG and are not guaranteed to be safe to use in SMP systems.
This adds all delayed work structs to the chain on FS init and does not
remove them until umount.

Updates #4956
2023-09-26 09:02:48 -05:00
Kinsey Moore
41d43cef6c bsps/xnandpsu: Ensure buffer cache sync
When a buffer is modified by both hardware components such as DMA and by
software components, the buffer cache state must be kept in sync so that
data is not accidentally thrown away during future invalidations.
2023-09-26 09:02:48 -05:00
Kinsey Moore
2b5526aa5e bsps/xnandpsu: Don't rely on usleep for polling
When polling hardware registers in high performance situations, don't
rely on usleep or other standard sleep functions since they will
necessarily rely on kernel ticks to be woken up. This can easily cause
an immense reduction in throughput.
2023-09-26 09:02:48 -05:00
Sebastian Huber
5a21b1d133 validation: Compatibility for other RTEMS versions
Make some performance tests compatible to other RTEMS versions which do
not allow changing the priority of a task which owns a priority
inheritance mutex.

Update #3716.
2023-09-26 09:40:20 +02:00
Sebastian Huber
3fa6e41c4c validation: Simplify partition performance test
Do not depend on <rtems/chain.h>.

Update #3716.
2023-09-26 09:40:10 +02:00
Sebastian Huber
a986262380 validation: Check stack of interrupted context
Check the stack of the interrupted context during the multitasking
start.

Update #4955.
2023-09-26 08:08:06 +02:00
Sebastian Huber
b3e4c41941 arm: Use a valid signed integer constant
Enumerators are restricted to signed integers in some C standards.
2023-09-26 08:04:30 +02:00
Sebastian Huber
535999041a psx13: Fix use of uninitialized variable warning 2023-09-26 08:04:30 +02:00
Sebastian Huber
ee63681aeb tests: Add header for RTEMS test printer
The <rtems/test-info.h> header file is required for every RTEMS test
program.  Move the RTEMS test printer support to a dedicated header file
<rtems/test-printer.h>.  This removes an unnecessary dependency to the
RTEMS printer support in <rtems/test-info.h>.

Tests using the RTEMS Testing Framework no longer depend on the
<rtems/printer.h>.
2023-09-26 08:04:30 +02:00
Kinsey Moore
3f3c646dea bsps/xqspipsu: Add SFDP config space read ability
This adds a function to allow reading of the SFDP configuration space
that describes attributes of NOR flash chips.
2023-09-23 09:42:30 -05:00
Kinsey Moore
853429c3f8 bsps/xqspipsu: Break out RDID
Expose a function to read the NOR flash chip ID information beyond the
minimum 3 bytes for the lookup table.
2023-09-23 09:42:30 -05:00
Sebastian Huber
109479e874 build: Remove enabled-by special case
Doing the enabled-by processing just for the ldflags and just for the
link custom commands is confusing.  Use an option instead which is
intended to be used for such use cases.
2023-09-22 07:59:11 +02:00
Sebastian Huber
de25f012b7 libdl: Use _CPU_Get_TLS_thread_pointer()
Update #4920.
2023-09-15 10:44:08 +02:00
Sebastian Huber
49a88a73a8 score: Add _CPU_Get_TLS_thread_pointer()
Add _CPU_Get_TLS_thread_pointer() to get the thread pointer which is
used to get the address of thread-local storage objects associated with
a thread.

Update #4920.
2023-09-15 10:44:08 +02:00
Sebastian Huber
580a457724 build: Add target to build scripts
Document that the build scripts in the testsuites produce a test program.
2023-09-15 10:44:08 +02:00
Sebastian Huber
2111497c0f rtems: rtems_configuration_get_interrupt_stack_size()
Fix rtems_configuration_get_interrupt_stack_size() for some code models.

The _ISR_Stack_size symbol has an arbitrary absolute address and may not
be representable in the code model used by the compiler.

Update #4953.
2023-09-15 10:44:08 +02:00
Sebastian Huber
206bbeb31b score: Fix TLS support for some code models
Store symbols with an arbitrary absolute address such as _TLS_Size,
_TLS_Alignment, _TLS_Data_size, and _TLS_BSS_size in an object to avoid issues
with some code models.

Update #4953.
2023-09-15 10:44:08 +02:00
Sebastian Huber
36b330910d bsp/stm32h7: Exclude some tests 2023-09-15 10:44:08 +02:00
Sebastian Huber
92fc82b54d arm/lm3s69xx: Exclude monitor test program
It is too big with GCC 13.
2023-09-15 10:44:08 +02:00
Sebastian Huber
5f8415b92e validation: Add RTEMS_DEFINE_GLOBAL_SYMBOL() test
Update #4953.
2023-09-14 14:25:49 +02:00
Sebastian Huber
1e7733aca6 sp37: Check ISR level of system init 2023-09-14 07:59:18 +02:00
Sebastian Huber
5dc43a04ef build: Merge regulator build into library item
There is no need to use a separate build object item.
2023-09-13 07:56:38 +02:00
Sebastian Huber
d7a6e80398 tests: Improve RTEMS_DEFINE_GLOBAL_SYMBOL() tests
Use a symbol value relative to an existing symbol address to make the
test work on more code models.

Update #4953.
2023-09-13 07:45:35 +02:00