summaryrefslogtreecommitdiffstats
path: root/cpukit/score (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rtems: Use _Objects_Free_nothing() for msg queuesSebastian Huber2021-05-111-5/+3
| | | | | | | | Use _Objects_Free_nothing() for rtems_message_queue_construct() to avoid unreachable code in _CORE_message_queue_Close() in case only user-provided message buffers are used. Update #4007.
* score: Rename _Stack_Free_nothing()Sebastian Huber2021-05-111-5/+5
| | | | | | | Rename _Stack_Free_nothing() in _Objects_Free_nothing() to make it reusable for the message queue buffers. Update #4007.
* score: Make _Once_Lock() and _Once_Unlock() staticSebastian Huber2021-05-041-16/+16
| | | | These two functions are no longer used outside of _Once().
* score: Add _Thread_Dispatch_direct_no_return()Sebastian Huber2021-05-022-2/+5
| | | | | | | | | | The __builtin_unreachable() cannot be used with current GCC versions to tell the compiler that a function does not return to the caller, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151 Add a no return variant of _Thread_Dispatch_direct() to avoid generation of dead code.
* Use alias for rtems_task_self() and pthread_self()Sebastian Huber2021-04-301-0/+53
| | | | This may reduce the code size a bit.
* objectextendinformation.c: Ensure information->object_blocks is not NULLRyan Long2021-04-291-0/+11
| | | | | | CID 26033: Dereference after null check in _Objects_Extend_information(). Closes #4326
* Return status code for _Thread_Start()Sebastian Huber2021-04-271-3/+3
| | | | | This avoids having conditional statements to get the API-specific status code.
* Return status code for _Scheduler_Set_affinity()Sebastian Huber2021-04-274-18/+18
| | | | | This avoids having conditional statements to get the API-specific status code.
* rtems: Change rtems_task_get_affinity() statusSebastian Huber2021-04-271-1/+1
| | | | | | | | | In case the processor set is not large enough to contain the processor affinity set of the task return RTEMS_INVALID_SIZE instead of RTEMS_INVALID_NUMBER. This is more in line with other directives since the issue is related to the size of an object. Close #4393.
* Return status code for _Scheduler_Get_affinity()Sebastian Huber2021-04-271-2/+7
| | | | | This avoids having conditional statements to get the API-specific status code.
* Remove superfluous <rtems/score/wkspace.h> includesSebastian Huber2021-04-2015-15/+0
|
* score: Remove unused _Thread_queue_Dequeue()Sebastian Huber2021-04-201-32/+0
| | | | | | | | | | | | Last use was removed by: commit 54550e048d3a49435912797d2024f80671e93267 Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Fri May 13 08:16:30 2016 +0200 posix: Rework pthread_join() Rework pthread_join() to use _Thread_Join().
* cpukit/aarch64: Restore ISR cookie bit maskKinsey Moore2021-04-191-13/+13
| | | | | | | The _CPU_ISR_Is_enabled() function operates on ISR cookies and so must mask off the appropriate status bits. This also fixes the naming of the parameters of the _CPU_ISR_* functions to indicate use of ISR cookies instead of interrupt enable/disable levels.
* score: Replace Objects_Name_or_id_lookup_errorsSebastian Huber2021-04-073-17/+17
| | | | | Replace Objects_Name_or_id_lookup_errors with new Status_Control codes. Get rid of the _Status_Object_name_errors_to_status lookup table.
* cpukit/aarch64: Add ESR register decodingAlex White2021-04-061-10/+125
|
* score: Add an assert to _Workspace_Free()Sebastian Huber2021-03-271-1/+5
|
* score: Fix task stack initializationSebastian Huber2021-03-271-1/+0
| | | | | | | | | Do not adjust the stack area begin address since this may confuse the stack allocator and result in failed stack frees. Account for the alignment overhead in the stack space size estimate. Check that the stack size is in the expected interval.
* score: Add Thread_Configuration::cpu_time_budgetSebastian Huber2021-03-161-17/+1
| | | | | Move the CPU time budget to the thread configuration. This simplifies _Thread_Initialize().
* leon,tn-0018: work around GRLIB-TN-0018 errataDaniel Hellstrom2021-03-116-1/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overview ======== The errata is worked around in the kernel without requiring toolchain modifications. It is triggered the JMPL/RETT return from trap instruction sequence never generated by the compiler and. There are also other conditions that must must be true to trigger the errata, for example the instruction that the trap returns to has to be a JMPL instruction. The errata can only be triggered if certain data is corrected by ECC (inflicted by radiation), thus it can not be triggered under normal operation. For more information see: www.gaisler.com/notes Affected RTEMS target BSPs: * GR712RC * UT699 * UT700/699E The work around is enabled by defining __FIX_LEON3_TN0018 at build time. After applying the following GCC patch, GCC will set the define when compiling for an affected multilib: * GR712RC (-mcpu=leon3 -mfix-gr712rc) * UT700/UT699E (-mpcu=leon3 -mfix-ut700) * UT699 (-mcpu=leon -mfix-ut699) When building for another multilib and TN0018 is still required, it is possible to enable it on the RTEMS kernel configure line using the TARGET_CFLAGS (-D__FIX_LEON3FT_TN0018) or other by other means. The following GCC patch sets __FIX_LEON3FT_TN0018 for the affected RTEMS multilibs: --------- diff --git a/gcc/config/sparc/rtemself.h b/gcc/config/sparc/rtemself.h index 6570590..ddec98c 100644 --- a/gcc/config/sparc/rtemself.h +++ b/gcc/config/sparc/rtemself.h @@ -33,6 +33,8 @@ builtin_assert ("system=rtems"); \ if (sparc_fix_b2bst) \ builtin_define ("__FIX_LEON3FT_B2BST"); \ + if (sparc_fix_gr712rc || sparc_fix_ut700 || sparc_fix_ut699) \ + builtin_define ("__FIX_LEON3FT_TN0018"); \ } \ while (0) --------- Workaround Implementation ========================= In general there are two approaches that the workaround uses: A) avoid ECC restarting the RETT instruction B) avoid returning from trap to a JMPL instruction Where A) comes at a higher performance cost than B), so B) is used where posssible. B) can be achived for certain returns from trap handlers if trap entry is controlled by assembly, such as system calls. A) A special JMPL/RETT sequence where instruction cache is disabled temporarily to avoid RETT containing ECC errors, and reading of RETT source registers to "clean" them from incorrect ECC just before RETT is executed. B) The work around prevents JMPL after system calls (TA instruction) and modifies assembly code on return from traps jumping back to application code. Note that for some traps the trapped instruction is always re-executed and can therefore not trigger the errata, for example the SAVE instruction causing window overflow or an float instruction causing FPU disabled trap. RTEMS SPARC traps workaround implementation: NAME NOTE TRAP COMMENT * window overflow 1 - 0x05 always returns to a SAVE * window underflow 1 - 0x06 always returns to a RESTORE * interrupt traps 2 - 0x10..1f special rett sequence workaround * syscall 3 - 0x80 shutdown system - never returns * ABI flush windows 2 - 0x83 special rett sequence workaround * syscall_irqdis 4 - 0x89 * syscall_irqen 4 - 0x8A * syscall_irqdis_fp 1 - 0x8B always jumps back to FP instruction * syscall_lazy_fp_switch 5 - 0x04 A) jumps back to FP instruction, or to B) _Internal_error() starting with SAVE Notes: 1) no workaround needed because trap always returns to non-JMPL instruction 2) workaround implemented by special rett sequence 3) no workaround needed because system call never returns 4) workaround implemented by inserting NOP in system call generation. Thus fall into 1) when workaround is enabled and no trap handler fix needed. 5) trap handler branches into both 1) and returning to _Internal_error() which starts with a SAVE and besides since it shuts down the system that RETT should never be in cache (only executed once) so fix not necessary in this case. Any custom trap handlers may also have to be updated. To simplify that, helper work around assembly code in macros are available in a separate include file <libcpu/grlib-tn-0018.h>. Close #4155.
* sparc,leon: avoid triggering LEON3FT errata TN-0009Daniel Hellstrom2021-03-111-2/+3
| | | | Close #4336.
* sparc,leon: avoid triggering TN-0009 bad sequenceDaniel Hellstrom2021-03-111-1/+2
| | | | Update #4336.
* sparc: fix bad register alignment for 64 bit storeDaniel Hellstrom2021-03-111-1/+3
|
* sparc: Remove sequences that the B2BST scan script warns aboutDaniel Cederman2021-03-112-3/+6
| | | | Update #4336.
* bsps/aarch64: RTEMS_DEBUG stack alignment faultsKinsey Moore2021-03-051-2/+8
| | | | | | Run with stack alignment faults enabled under RTEMS_DEBUG to catch any stack misalignments early. This makes it easier to track them down should they ever occur.
* score/aarch64: Fix interrupt level readsAlex White2021-03-052-3/+7
|
* aarch64: Fix context switchSebastian Huber2021-03-051-2/+2
| | | | | | The Per_CPU_Control::isr_dispatch_disable is a 32-bit integer. Close #4206.
* score: Ensure stack alignment requirementSebastian Huber2021-03-052-11/+24
| | | | | | | | Make sure that a user-provided stack size is the minimum size allocated for the stack. Make sure we meet the stack alignment requirement also for CPU ports with CPU_STACK_ALIGNMENT > CPU_HEAP_ALIGNMENT.
* score: Enforce CPU_STACK_ALIGNMENT requirementsSebastian Huber2021-03-0412-114/+22
| | | | | Clarify CPU_STACK_ALIGNMENT requirements in no_cpu port. Add static assertion to enforce CPU_STACK_ALIGNMENT requirements.
* score: Simplify _Objects_Name_to_id_u32()Sebastian Huber2021-03-011-20/+21
| | | | | | | Remove superfluous check for the objects maximum since the maximum is also used as a loop limit. Fix formatting.
* score: Fix thread initializationSebastian Huber2021-02-264-107/+125
| | | | | | | | Close the thread object if a thread create extension fails. Also call the delete extension to avoid resource leaks in early extensions if a late extension fails. Close #4270.
* score: Add Hash HandlerSebastian Huber2021-02-261-0/+76
| | | | Update #4267.
* score: Add _IO_Base64url()Sebastian Huber2021-02-251-18/+38
| | | | Update #4267.
* score: Remove _CORE_barrier_Do_flush()Sebastian Huber2021-02-241-37/+0
| | | | Call _Thread_queue_Flush_critical() directly.
* score: Simplify core barrierSebastian Huber2021-02-242-12/+12
| | | | | | Use the number of threads which must arrive at the barrier to trip the automatic release also to indicate if the barrier is a manual release barrier.
* score: Remove _Objects_Open()Sebastian Huber2021-02-243-6/+3
| | | | | Use the type safe _Objects_Open_u32() instead. Return the object identifier to enforce a common usage pattern.
* score: Change thread action lockingSebastian Huber2021-02-201-3/+0
| | | | | | | | Require that the corresponding lock is acquired before the action handler returns. This helps to avoid recursion in the signal processing. Update #4244.
* score: Fix warning in thread queue opsChris Johns2021-02-161-3/+3
|
* score: Add barrier thread queue operationsSebastian Huber2021-02-062-3/+32
| | | | | | | This fixes a missing decrement of the number of waiting threads during a barrier wait timeout. Close #4230.
* score: Make FIFO thread queue ops publicSebastian Huber2021-02-061-8/+9
| | | | Update #4230.
* score: Constify Thread_queue_First_operationSebastian Huber2021-02-061-6/+6
| | | | Update #4230.
* nios2: Allow ISR nesting in dispatch variantSebastian Huber2021-02-012-173/+16
| | | | | | Rename _Nios2_ISR_Dispatch_with_shadow_non_preemptive() in _Nios2_ISR_Dispatch_with_shadow_register_set(). Remove _Nios2_ISR_Dispatch_with_shadow_preemptive().
* nios2: Optimize ISR dispatch variantSebastian Huber2021-02-011-42/+60
| | | | | Use _Thread_Do_dispatch() in _Nios2_ISR_Dispatch_with_shadow_non_preemptive().
* nios2: Use Per_CPU_Control::isr_dispatch_disableSebastian Huber2021-02-015-35/+23
|
* nios2: Add TLS supportSebastian Huber2021-02-011-4/+15
| | | | Update #4214.
* nios2: Make _ISR_Is_in_progress() weakSebastian Huber2021-02-011-1/+1
| | | | This allows the BSP to override this function.
* nios2: Fix ISR dispatch variantsSebastian Huber2021-02-012-9/+7
| | | | | The thread dispatch disabled level moved to _Per_CPU_Information some time ago.
* score: Remove double assignmentSebastian Huber2021-02-011-2/+1
| | | | This fix relates to a Coverity issue (UNUSED_VALUE).
* score: Simplify _CORE_message_queue_Broadcast()Sebastian Huber2021-02-011-11/+8
| | | | This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED).
* kern_tc.c: Remove unused codeSebastian Huber2021-02-011-6/+0
| | | | This fix relates to a Coverity issue (PW.DECLARED_BUT_NOT_REFERENCED).
* score: Fix _CORE_message_queue_Submit() indentationSebastian Huber2021-02-011-40/+40
| | | | This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).