Commit Graph

13215 Commits

Author SHA1 Message Date
Sebastian Huber
c538079ec1 aarch64: Remove trapped FP exceptions support
Whether a floating-point implementation supports trapping of
floating-point exceptions is implementation defined.  At least Qemu,
Cortex-A53, and Cortex-A72 do not support them.
2024-10-11 01:27:48 +02:00
Sebastian Huber
2b36492366 aarch64: Move exception frame support
The exception frame handling support is optional.
2024-10-11 01:27:48 +02:00
Sebastian Huber
8d6e8f153c aarch64: Split exception support
Resuming a non-interrupt exception is optional.
2024-10-11 01:27:48 +02:00
alessandronardin
d604ec899d posix/aio_misc.c: Added comment explaining coverity false positive.
Added comment in rtems_aio_handle() explaining why the Coverity
issue 1592927 is a false positive.
2024-10-05 19:28:27 +00:00
Kinsey Moore
a9055cbf10 cpukit/aarch64: Fix spelling 2024-10-03 03:02:54 +00:00
Sebastian Huber
559d90bb10 arm: Improve CPU_Exception_frame
Add a registers member to allow an indexed access to the registers.
2024-10-02 05:24:30 +02:00
Sebastian Huber
11b772c867 arm: Add support for PMSAv7 2024-10-02 05:24:30 +02:00
Sebastian Huber
4ca49fc200 score: Remove _Per_CPU_State_wait_for_non_initial_state()
This function is unused.
2024-09-29 23:13:32 +00:00
Sebastian Huber
d8822514e7 score: Add _SMP_Wait_for_ready_to_start_multitasking() 2024-09-29 23:13:32 +00:00
Sebastian Huber
296d7150f0 score: Set boot CPU properties before others
This allows other CPUs to figure out the boot CPU.
2024-09-29 23:13:32 +00:00
Sebastian Huber
7bd4725942 score: Use _Per_CPU_Get()
The _Per_CPU_Get() may be more efficient if
_CPU_Get_current_per_CPU_control() is available.
2024-09-29 23:13:32 +00:00
Alex White
38bafce42d Add aarch64 cpukit paravirtualization support 2024-09-27 20:01:34 +00:00
alessandronardin
653dbdcdbf posix/aio_misc.c: Added returns on error path in rtems_aio_init()
Coverity CID 1619695

Added returns on error path in rtems_aio_init().
Without them the code could access uninitialized memory.

Closes #5132.
2024-09-26 19:09:35 +02:00
alessandronardin
617808b979 posix/aio_misc.c/aio_init(): lock before accessing data
Coverity CID 1592924

added lock before accessing data.

Closes #5129.
2024-09-25 17:48:11 +00:00
alessandronardin
de196e0586 posix/aio_misc.c: changed malloc call into calloc
Coverity CID 1512510

Changed a call to malloc() into a call to calloc()
to avoid access to uninitialized memory.

Closes #5131.
2024-09-25 17:47:28 +00:00
Kinsey Moore
8f8d0c806b cpukit/libdl/arm: Add support for trailing Thumb to ARM calls
This expands the size of an ARM trampoline from 8 bytes to 10 bytes to
support THM_JUMP24 tail calls that require a BX instruction to change
modes.
2024-09-24 19:57:08 -05:00
Kinsey Moore
701e8b2d63 cpukit/libdl/arm: Obey instruction encoding requirements for Thumb BLX
Calls from Thumb code into ARM code require the use of a BLX instruction
and an optional offset prefix instruction. The BLX instruction encoding
requires that the least significant bit be 0 in all cases while the BL
instruction for Thumb-to-Thumb calls includes that bit as part of the
offset. This ensures that bit 0 of the BLX is set to 0 as required by
the instruction encoding specification.
2024-09-24 19:57:08 -05:00
Sebastian Huber
6003ea9d94 aarch64: Add _AArch64_Get_current_processor_for_system_start()
This allows BSPs to customize how the current processor index is
determined during system start.

Update #5064.
2024-09-20 06:17:09 +02:00
zhengxiaojun
5e5214b786 bsp/aarch64:Fix _CPU_SMP_Get_current_processor()
Fix _CPU_SMP_Get_current_processor(), since read from register MPIDR_EL1
(the least significant byte) is not always right,for example the least
significant byte of MPIDR_EL1 is always zero for cortex-a55.

aarch64 has a thread ID register TPIDR_EL1 available for for OS management
purposes. RTEMS stores per-CPU control in TPIDR_EL1 when the core startup,
so we can use _Per_CPU_Get_index() to get current processor index.

update #5064
2024-09-19 19:15:10 +08:00
Sebastian Huber
518d27fa75 libtest: Fix format specifier
This fixes a ttest01 failure.
2024-09-19 04:34:55 +02:00
Sebastian Huber
cf47b09c6a doxygen: Add console drivers group 2024-09-17 01:53:58 +00:00
alessandronardin
333a1aee2b posix/aio_misc-c/rtems_aio_completed_list_op(): Path with no lock release.
Coverity CID 1619144

In rtems_aio_completed_list_op() memory was getting freed without releasing
a lock.

This commit should also solve coverity issues 1619145, 1619143 and 1619142
since they all seem to be generated by rtems_aio_completed_list_op().

Closes #5127
2024-09-14 11:46:56 +02:00
zhengxiaojun
29a0d99bfd cpukit/libmisc/shell:fix command df overflow
- change type unsigned to uint64_t, it might overflowed if
    the size is greater the 4GB.
  - increase buffer size is to eliminate the compiler's warning
    that the buffer might be too small
2024-09-13 21:30:43 +00:00
alessandronardin
31c91be2ea posix/aio: updated documentation after changes to lio_listio()
updated the doxygen comment in aio.h
updated the description in spec/build/cpukit/optposix.yml
2024-09-13 21:30:02 +00:00
Mohamed Hassan
e91c136f67 libmisc/stackchk: fix Doxygen file comment
revert back to the original RTEMS Doxygen guidelines by adding @file and @ingroup
2024-09-13 00:56:13 +00:00
Sebastian Huber
ce1fb41a6c kvprintf(): Fix '+' conversion handling
For example, printf("%+i", 1) prints "+1".  However, kvprintf() did
print just "1" for this example.  According to PRINTF(3):

  A sign must always be placed before a number produced by a signed
  conversion.

For "%+r" radix conversions, keep the "+" handling as it is, since this
is a non-standard conversion.  For "%+p" pointer conversions, continue
to ignore the sign modifier to be in line with libc.

This change allows to support the ' conversion modifier in the future.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1310
2024-09-12 23:34:28 +00:00
Sebastian Huber
48618b1060 ntptime: Use time_t for tv_sec related variables
The struct timespec tv_sec member is of type time_t.  Make sure that all
variables related to this member are of the type time_t.  This is important for
targets where long is a 32-bit type and time_t a 64-bit type.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1373
2024-09-12 17:26:27 +00:00
Joel Sherrill
3aa1f1faee poll.h and sys/poll.h were in both RTEMS and Newlib
Remove the copies in RTEMS. Most POSIX headers are in Newlib.

CLoses #5126
2024-09-12 04:57:43 +00:00
Sebastian Huber
a9bff015f6 stackchk: Avoid implementation header in API
Update #5047.
2024-09-12 02:26:15 +00:00
Sebastian Huber
4abed2b422 stackchk: Fix Doxygen file comment
Update #5047.
2024-09-12 02:26:15 +00:00
Sebastian Huber
5b1c17f85a confdefs: Fix extensions.h
Resurrect proper file comment.  Order copyrights according to template.  Remove
white space at the end of line.  Do error checks early.  Define objects under
optional extern "C".

Update #5047.
2024-09-12 02:26:15 +00:00
alessandronardin
d670dafaa4 posix/lio_listio.c: corrected return when RTEMS_POSIX_API is undefined
Modified the body of lio_listio(), to make sure it return -1 and sets
errno to ENOSYS, when RTEMS_POSIX_API is not defined.

The psxenosys test has been modified to test for lio_listio() only
when RTEMS_POSIX_API is not defined. In the test all the puts() have
been removed. If kept they would have made the output of the test depending
on the build configuration, making the content of psxenosys.scn inconsistent.
Removing the puts() makes the .scn file valid regardless of the build
configuration.

Additionally, rtems_aio_notify() in aio_misc.c has been modified,
simplifying it and reducing the part inside the ifdef.

Closes #5125
2024-09-10 08:41:53 +02:00
Joel Sherrill
fe6b7bc3cb score/cpu/arm/cpu.c: Fine tune paravirtualization for interrupt set/get level 2024-09-10 02:45:07 +00:00
Kinsey Moore
bcf0cee545 cpukit/stackchk: Explicitly cast from void* to uintptr_t 2024-09-06 01:15:21 +00:00
alessandronardin
acd2a24d64 cpukit/posix/src/aio_misc.c: Fix for illegal memory access.
CID 1618881:  Memory - illegal accesses  (USE_AFTER_FREE)
2024-09-05 23:13:25 +00:00
alessandronardin
1b6684ee2b cpukit/posix/aio*: Added support for lio_listio()
This commit adds support for lio_listio().
psxaio05 has been added to test the new method.
To avoid code duplication, the body of aio_read and aio_write has been
moved in two helper methods. In this way i can use it also in lio_listio().

In addition to that, a limit on the number of total aio operation enqueued
has been added.

Updates rtems/programs/gsoc#29
2024-09-02 18:16:30 +02:00
Kinsey Moore
ad51286e2b cpukit/stackchk: Remove additional offset of SANITY_PATTERN_SIZE_WORDS
This offset is already accounted for by Stack_check_Usable_stack_start()
called from Stack_check_Visit_stack() and adding it a second time can
cause interaction beyond the bounds of the stack.
2024-08-28 13:42:37 +00:00
Sebastian Huber
cb0a530503 arm: Fix FIQ default handler
Save the registers of the previous context and not the banked registers
of the FIQ mode.
2024-08-28 04:19:40 +02:00
Sebastian Huber
2598428809 arm: Add _CPU_Exception_resume() 2024-08-28 04:19:39 +02:00
Sebastian Huber
5f75cbaa74 arm: Fix system call default exception handler 2024-08-28 04:19:39 +02:00
Sebastian Huber
eb8a39e115 arm: Simplify default exception handling
Writes to the execution state bits of the CPSR through MRS instructions
are ignored.
2024-08-28 04:19:39 +02:00
Sebastian Huber
7915631552 arm: Simplify default exception handling
Do not clear the VFP context pointer twice.
2024-08-28 04:19:39 +02:00
Sebastian Huber
2174ec336a arm: Remove _ARMV4_Exception_reserved_default()
The default exception handler uses the Save Program Status Register
(SPSR), however, if _ARMV4_Exception_reserved_default() would get
called, the state of this register is unpredictable.  Replace potential
calls to _ARMV4_Exception_reserved_default() with an undefined
instruction.
2024-08-28 04:19:39 +02:00
Sebastian Huber
ea0e89b9a0 arm: Remove unused _ARMV4_Exception_irq_default() 2024-08-28 04:19:39 +02:00
Sebastian Huber
bd48d10b4e arm: Mark _ARM_Exception_default() as no return
Remove dead code.
2024-08-28 04:19:39 +02:00
Sebastian Huber
1d5149e392 arm: Do not alter saved PSR in default FIQ handler
Make sure we save the real PSR of the previous context to the exception
frame.
2024-08-28 04:19:39 +02:00
Joel Sherrill
3cb090e341 aio_fsync.c: Use calloc() to ensure memory is initialized
Coverity CID 1512532

Closes #5102.
2024-08-27 23:55:36 +00:00
Matheus Pecoraro
acf7c725ca x86_64: Add TLS support 2024-08-27 21:20:48 +00:00
Matheus Pecoraro
018e7ad407 x86_64: x86_64 port doxygen and license cleanup 2024-08-27 21:16:58 +00:00
Matheus Pecoraro
e93bbe6534 x86_64/amd64: Add SMP support
Adds SMP support for the x86_64 amd64 BSP.
2024-08-27 21:16:58 +00:00