Commit Graph

4336 Commits

Author SHA1 Message Date
Ryan Long
0bd6514aa2 cpukit/libdl: Add support for AArch64
rtl-mdreloc-aarch64.c and elf_machdep.h came from NetBSD.

Updates #4682
2022-07-29 08:32:47 -05:00
Sebastian Huber
8a864bc62c score: Use PTHREAD_CANCELED for _Thread_Cancel()
The rtems_task_delete() directive is basically just a combined pthread_cancel()
and pthread_join().  In addition, it removes the PTHREAD_DETACHED state.  The
exit value returned by pthread_join() of threads cancelled by
rtems_task_delete() should reflect this by getting a PTHREAD_CANCELED value
instead of NULL which could be a normal exit value.

Close #4680.
2022-07-28 07:53:04 +02:00
Sebastian Huber
31036f1dc8 score: Use priority inheritance for thread join
Threads may join the thread termination of another thread using the
pthread_join() or rtems_task_delete() directives.  The thread cancel operation
used a special case priority boosting mechanism implemented by
_Thread_Raise_real_priority().  The problem was that this approach

* is not transitive,

* does not account for priority adjustments of the calling task
  while waiting for the join,

* does not support clustered scheduling, and

* does not detect deadlocks.

All these problems are fixed by using a priority inheritance thread queue for
the join operation.

Close #4679.
2022-07-28 07:52:59 +02:00
Sebastian Huber
5810a08b57 Use __asm__ for standard C compatibility 2022-07-27 17:01:14 +02:00
Sebastian Huber
7fe6d60bf0 score: Remove PRIORITY_PSEUDO_ISR thread priority
The uniprocessor schedulers had some special case logic for the
PRIORITY_PSEUDO_ISR priority.  Tasks with a priority of PRIORITY_PSEUDO_ISR
were allowed to preempt a not preemptible task.  If other higher priority task
are made ready while a PRIORITY_PSEUDO_ISR task preempts a not preemptible
task, then the other tasks run before the not preemptible task.  This made the
RTEMS_NO_PREEMPT mode ineffective.

Remove the PRIORITY_PSEUDO_ISR special case logic.  This simplifies the
uniprocessor schedulers.  Move the uniprocessor-specific scheduler support to
the new header file <rtems/score/scheduleruniimpl.h>.

Close #2365.
2022-07-26 11:26:22 +02:00
Kinsey Moore
10ef7087f6 aarch64: Use page table level 0
This alters the AArch64 page table generation and mapping code and MMU
configuration to use page table level 0 in addition to levels 1, 2, and
3. This allows the mapping of up to 48 bits of memory space and is the
maximum that can be mapped without relying on additional processor
extensions. Mappings are restricted based on the number of physical
address bits that the CPU supports.
2022-07-21 12:26:35 -05:00
Sebastian Huber
12a03bea4f score: Fix unlimited objects support
Commit 21275b58a5 ("score: Static
Objects_Information initialization") introduced an off-by-one error in the
maintenance of inactive objects.

Close #4677.
2022-07-18 09:33:16 +02:00
Sebastian Huber
e0942613f1 score: Fix _Objects_Active_count()
With unlimited objects the object maximum may be larger than the sum of active
and inactive objects.

Update #4677.
2022-07-18 09:33:16 +02:00
Sebastian Huber
1bf878f7ff score: Extend memory dirty/zero actions
Dirty or zero also the part of the .noinit section used by RTEMS.

Close #4678.
2022-07-15 10:46:02 +02:00
Sebastian Huber
80090639a6 score: Use RTEMS_SMP in _Thread_Create_idle()
Conditional expressions with inline functions are not optimized away if
optimization is disabled.  Avoid such expressions to prevent dead
branches.
2022-07-07 08:48:26 +02:00
Sebastian Huber
6e74cebb62 score: Conditional _Thread_Priority_replace()
This function is only used in SMP configurations.
2022-07-07 08:46:48 +02:00
Kinsey Moore
22015c0251 cpukit/aarch64: Remove _CPU_ISR_install_vector
This function was never actually used and is dead code.
2022-07-05 15:35:56 -05:00
Sebastian Huber
03e4d1e931 score: Add _CPU_Use_thread_local_storage()
At some point during system initialization, the idle threads are created.
Afterwards, the boot processor basically executes within the context of an idle
thread with thread dispatching disabled.  On some architectures, the
thread-local storage area of the associated thread must be set in dedicated
processor registers.  Add the new CPU port function to do this:

void _CPU_Use_thread_local_storage( const Context_Control *context )

Close #4672.
2022-07-04 08:30:42 +02:00
Sebastian Huber
4f87edbb75 gcov: Add functions to dump the gcov information
Update #4670.
2022-07-04 08:29:52 +02:00
Sebastian Huber
39c09b3b3d riscv: Include missing header file 2022-06-24 13:15:00 +02:00
Sebastian Huber
5dffbc424e score: Make SMP only code explicit
Conditional expressions with inline functions are not optimized away if
optimization is disabled.  Avoid such expressions to prevent dead
branches.  It helps also during code review to immediately see if a loop
is used or not.
2022-06-23 10:28:49 +02:00
Sebastian Huber
94df3a7a6d kern_tc.c: Provide a weak hardpps() implementation
The real implementation of hardpps() is defined in kern_ntptime.c.  Use it only
if the NTP support is needed by the application.

Update #2349.
2022-06-23 09:47:48 +02:00
Sebastian Huber
cd50bea678 score: Use right clock for threadq timeouts
Use CLOCK_REALTIME and CLOCK_MONOTONIC for relative thread queue timeouts
instead of CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE.  This fixes an
issue with clock_nanosleep() in combination with clock_gettime().

Close #4669.
2022-06-23 09:20:11 +02:00
Chris Johns
5262b9c2ab score/cpu: Silence ARM and AARCH64 GCC 12 false trigger array warning
The false trigger is covered in:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

GCC 11 and 12 has been patched for constant pointer casts above
4K. This code casts a constant pointer within the first 4K
page. As a result the patch disables the warning.

Updates #4662
2022-06-15 12:57:28 +10:00
Gabriel Moyano
11621c9c52 kern_tc.c: Update pps_event() for uniprocessor configurations
Since pps->capgen equal to zero is not a special value in uniprocessor configurations, there is no need to check for this condition.

Update #2349
2022-06-10 11:12:03 +02:00
Sebastian Huber
c93f0f01e5 arm: Fix PMSA regions for contiguous sections
Sections with identical attributes may be contiguous with a respective
begin and end address which is not on a minimum region boundary.  The
begin address is aligned down to the region base address.  The end
address is aligned up to the region end address.  Account for this in
the check for contiguous sections.

Update #4202.
2022-06-08 09:10:20 +02:00
Sebastian Huber
0b9497a6dd arm: Fix PMSA region mapping with 0x0 end address
A section may span up to the end of the address range.  In this case the
end address is zero.  Use the base address to check if a region should
be before another region.

Update #4202.
2022-06-08 09:10:12 +02:00
Sebastian Huber
a26b9936ff arm: Fix typo 2022-06-03 08:37:14 +02:00
Sebastian Huber
044e8b6b97 score: Fix pps_fetch()
Return early only if there was a timeout, otherwise return the PPS info.

Update #2349.
2022-05-27 11:30:51 +02:00
Sebastian Huber
495f8363de score: Reformat for code coverage
Close #2349.
2022-05-23 09:09:08 +02:00
Gabriel Moyano
b3e4f5809d timepps.h: PPS_SYNC defined by default
Update #2349.
2022-05-23 09:09:01 +02:00
Gabriel Moyano
b304603b62 kern_ntptime.c: Add define in order to remove warning
Update #2349.
2022-05-23 09:08:59 +02:00
Gabriel Moyano
13513b8104 kern_tc.c: Enable PPS API support
Update #2349.
2022-05-23 09:08:57 +02:00
Gabriel Moyano
c34d3aecb1 kern_tc.c: Add definitions required by PPS API
Update #2349.
2022-05-23 09:08:55 +02:00
Gabriel Moyano
ac4ea53664 score: Rename tc_getfrequency()
Rename tc_getfrequency() to _Timecounter_Get_frequency().

Update #2349.
2022-05-23 09:08:52 +02:00
Gabriel Moyano
95c747d9e7 kern_tc.c: Replace FreeBSD event mechanism by adding pointers to function
Update #2349.
2022-05-23 09:08:50 +02:00
Gabriel Moyano
bf61753a92 kern_tc.c: Add atomic dependencies required by the PPS API
Update #2349.
2022-05-23 09:08:48 +02:00
Gabriel Moyano
a3930e8c49 kern_ntptime.c: Add lmax() qmin() definitions
Update #2349.
2022-05-23 09:08:46 +02:00
Gabriel Moyano
9b4212c7b0 kern_ntptime.c: Disable freebsd features
Update #2349.
2022-05-23 09:08:29 +02:00
Sebastian Huber
89c498ccda score: Add SPDX License Identifier
Remove URL in copyright notice.

Update #3053.
2022-05-18 11:34:53 +02:00
Sebastian Huber
5a165982ec score: Fix SMP priority affinity scheduler yield 2022-05-13 13:16:57 +02:00
Tian Ye
901bc146b0 score: Add SMP priority affinity scheduler yield 2022-05-12 09:02:26 +02:00
Ryan Long
feffc4546a score/src: Add file headers and licenses
These files had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:06 -05:00
Ryan Long
45a78fdbf5 sparc64-syscall.h: Add file headers and licenses
This file had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Ryan Long
cce7074279 cpukit/microblaze: Add file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyright and license.
2022-05-04 09:12:01 -05:00
Sebastian Huber
8b18037f20 heap: Fix heap statistics with protection enabled
Close #4644.
2022-04-28 09:16:54 +02:00
Joel Sherrill
6f40354dba Remove duplicate SPDX lines accidentally added 2022-04-08 08:41:50 -05:00
Ryan Long
5efcd021ef x86_64/elf_machdep.h: Replace stub with NetBSD version
The other ports included that architecture's version of this file from
NetBSD. This patch follows that pattern.

closes #4641
2022-04-08 08:36:24 -05:00
Joel Sherrill
ffaaae2cf5 cpukit/score/cpu/moxie: Change license to BSD-2
Permission received from Anthony Green.

Updates #3053.
2022-04-01 10:02:30 -05:00
Joel Sherrill
628bd9b682 cpukit/: Update Eric Norum contact info and normalize file headers 2022-03-24 10:01:51 -05:00
Sebastian Huber
36615183d6 smp: Add fatal error
Add SMP-specifc SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR
fatal error.  This fatal error helps to diagnose a broken SMP startup
sequence.  Without this error a context switch using the NULL pointer
for the thread control block happens which may be difficult to debug.
2022-03-24 11:10:49 +01:00
Sebastian Huber
d0de6fdfa8 score: Add _IO_Relax()
This function may be used to burn a couple of processor cycles with
minimum impact on the system bus.  It may be used in busy wait loops.
Since it is a global function, it is possible to wrap it in device
driver test code.
2022-03-24 11:10:48 +01:00
Kinsey Moore
3e3393ac1e cpukit/aarch64: Add Per_CPU_Control accessor
Add an architecture-specific implementation for
_CPU_Get_current_per_CPU_control() to reduce overhead for getting the
current CPU's Per_CPU_Control structure.
2022-03-12 11:55:11 -06:00
Sebastian Huber
74d3abc1db arm: Fix PMSA section to region mapping
Fix move of regions.  Allow sections to be contained in a region (may
happen due to region alignment).
2022-03-11 09:24:57 +01:00
Sebastian Huber
ca74566f7e arm: Add _AArch32_PMSA_Map_sections_to_regions()
This simplifies unit testing.
2022-03-11 09:24:57 +01:00