summaryrefslogtreecommitdiffstats
path: root/cpukit/posix (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Add _TOD_Is_valid_new_time_of_day()Sebastian Huber2021-09-061-0/+5
| | | | | | Move the TOD validation to the callers of _TOD_Set(). This avoids dead code in case only rtems_clock_set() is used in an application because rtems_clock_set() always calls _TOD_Set() with a valid time of day.
* score: Return status in _TOD_Adjust()Sebastian Huber2021-09-061-1/+5
|
* score: Fix priority discipline handlingSebastian Huber2021-09-012-27/+18
| | | | | | | | | | | The priority queues in clustered scheduling configurations use a per scheduler priority queue rotation to ensure FIFO fairness across schedulers. This mechanism is implemented in the thread queue surrender operation. Unfortunately some semaphore and message queue directives used wrongly the thread queue extract operation. Fix this through the use of _Thread_queue_Surrender(). Update #4358.
* confstr() support for RTEMSEshan dhawan2021-08-181-0/+127
| | | | | | | | Closes #3373 confstr() style update Signed-off-by: Eshan Dhawan <eshandhawan51@gmail.com>
* score: Replace priority prepend it with an enumSebastian Huber2021-08-122-2/+2
| | | | | | | | Use the new Priority_Group_order enum instead of a boolean to indicated if a priority should be inserted as the first or last node into its priority group. This makes the code more expressive. It is also a bit more efficient since a branch in _Scheduler_Node_set_priority() is avoided and a simple bitwise or operation can be used.
* Test needed for timer_create with CLOCK_MONOTONCZacchaeus Leung2021-08-112-19/+32
| | | | | | | | the timer_create() method can use CLOCK_MONOTONIC but there was no test for this. Also it implements the functionality to create a CLOCK_MONOTONIC timer and gettime() . Closes #3888
* score: Fix initialization of thread queue contextSebastian Huber2021-06-104-4/+4
| | | | | | | Set Thread_queue_Context::timeout_absolute in _Thread_queue_Context_set_timeout_argument() to avoid using it uninitialized. The bug was introduced by a89ecaa1a94d49ddae7753d6b83923e9d2a00486.
* sysconf: Remove sysconf(515)Ryan Long2021-06-091-4/+0
| | | | | | | GCC originally needed this 20 years ago. No longer needed, so it is being removed. Closes #4391
* posix: Allow pthread_cancel() from within ISRsSebastian Huber2021-05-261-9/+4
| | | | Close #4413.
* score: Simplify calling _Thread_Exit()Sebastian Huber2021-05-262-16/+7
| | | | | Move common code into _Thread_Exit(). This enables a tail call optimization in most cases.
* score: Simplify thread queue timeout handlingSebastian Huber2021-05-185-27/+28
| | | | | | | Add Thread_queue_Context::timeout_absolute to specify an absolute or relative timeout. This avoid having to get the current time twice for timeouts relative to the current time. It moves also functionality to common code.
* posix: Fix use of clock for relative timesSebastian Huber2021-05-181-13/+18
| | | | Close #4426.
* posix: Use RTEMS_POSIX_API in clock_nanosleep()Sebastian Huber2021-05-171-0/+5
| | | | | It is only possible to get interrupted by a POSIX signal if RTEMS_POSIX_API is defined.
* posix: Move clock_nanosleep()Sebastian Huber2021-05-172-91/+116
| | | | | | | Move clock_nanosleep() to a separate file to avoid a dependency on errno which pulls in the Newlib reentrancy support. This is an issue since most parts which are pulled in cannot be garbage collected by the linker due to the system initialization linker set.
* score: Rename _Stack_Free_nothing()Sebastian Huber2021-05-111-1/+1
| | | | | | | Rename _Stack_Free_nothing() in _Objects_Free_nothing() to make it reusable for the message queue buffers. Update #4007.
* score: Add _Thread_Dispatch_direct_no_return()Sebastian Huber2021-05-021-1/+1
| | | | | | | | | | 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-32/+0
| | | | This may reduce the code size a bit.
* Return status code for _Thread_Start()Sebastian Huber2021-04-271-3/+2
| | | | | This avoids having conditional statements to get the API-specific status code.
* Return status code for _Scheduler_Set_affinity()Sebastian Huber2021-04-272-5/+6
| | | | | This avoids having conditional statements to get the API-specific status code.
* Simplify get affinitiy directivesSebastian Huber2021-04-271-3/+0
| | | | | There is no need to disable thread dispatching to get the affinity of a task.
* Return status code for _Scheduler_Get_affinity()Sebastian Huber2021-04-272-6/+8
| | | | | This avoids having conditional statements to get the API-specific status code.
* Remove superfluous <rtems/score/wkspace.h> includesSebastian Huber2021-04-204-4/+0
|
* score: Add Thread_Configuration::cpu_time_budgetSebastian Huber2021-03-163-40/+30
| | | | | Move the CPU time budget to the thread configuration. This simplifies _Thread_Initialize().
* score: Fix thread initializationSebastian Huber2021-02-261-18/+21
| | | | | | | | 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.
* posix: Remove superfluous checkSebastian Huber2021-02-201-6/+0
| | | | | | The api pointer is never NULL. Update #4244.
* score: Change thread action lockingSebastian Huber2021-02-201-0/+2
| | | | | | | | Require that the corresponding lock is acquired before the action handler returns. This helps to avoid recursion in the signal processing. Update #4244.
* posix: Fix pthread_spin_unlock()Sebastian Huber2020-10-191-1/+1
| | | | | | | Prevent a call to _SMP_lock_Stats_register_or_max_section_time(). This fixes a thread stack corruption in case RTEMS_PROFILING and RTEMS_SMP is enabled. Close #4157.
* rtems: Add rtems_message_queue_construct()Sebastian Huber2020-09-281-1/+3
| | | | | | | | | | | In contrast to message queues created by rtems_message_queue_create(), the message queues constructed by this directive use a user-provided message buffer storage area. Add RTEMS_MESSAGE_QUEUE_BUFFER() to define a message buffer type for message buffer storage areas. Update #4007.
* score: Improve _CORE_message_queue_Initialize()Sebastian Huber2020-09-281-8/+9
| | | | | | Return a status code and differentiate between error conditions. Update #4007.
* score: Add stack free handler to TCBSebastian Huber2020-08-311-1/+3
| | | | | | | This avoids a dependency to the stack free function in the thread destruction. Update #3959.
* posix: Only check shm_unlink obj_err if necessaryKinsey Moore2020-08-111-22/+23
| | | | | | | | | | In the nominal case checked by spsysinit01, obj_err is unmodified if _POSIX_Shm_Get_by_name returns non-NULL. In the case of shm_unlink, this means an uninitialized value is passed into the switch and it appears tests using it were passing by virtue of the stack having the right value on it in most cases. This now checks obj_err only if _POSIX_Shm_Get_by_name returns NULL. Close #4016
* posix: Get real priority in pthread_getattr_np()Sebastian Huber2020-05-121-4/+6
| | | | | | | This is in line with pthread_setschedparam() and pthread_getschedparam(). Update #2514.
* doxygen: Switch @brief and @ingroupSebastian Huber2020-04-28165-165/+330
| | | | This order change fixes the Latex documentation build via Doxygen.
* Canonicalize config.h includeSebastian Huber2020-04-16225-226/+226
| | | | | | | | Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
* score: Check time of day in _TOD_Set()Sebastian Huber2020-04-141-3/+0
| | | | Close #3949.
* score: Return status in _TOD_Set()Sebastian Huber2020-04-141-4/+5
| | | | Update #3949.
* libio: Robust file descriptor reference countingSebastian Huber2020-03-131-2/+2
| | | | | | | | | | | | There was a race conditon in the reference counting of file descriptors during a close() operation. After the call to the close handler, the rtems_libio_free() function cleared the flags to zero. However, at this point in time there may still exist some holders of the file descriptor. With RTEMS_DEBUG enabled this could lead to failed assertions in rtems_libio_iop_drop(). Change the code to use only atomic read-modify-write operations on the rtems_libio_iop::flags.
* config: Add <rtems/confdefs/threads.h>Sebastian Huber2020-02-251-0/+2
| | | | | | | | Remove all comments and copyrightable content from the moved content. Use BSD-2-Clause license for new file. Update #3053. Update #3875.
* config: Remove CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLESebastian Huber2020-02-251-44/+31
| | | | | | | | | | | | | | | | | | | The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_* configuration options. These two options are probably unused, see also: * https://lists.rtems.org/pipermail/users/2019-April/033129.html * https://lists.rtems.org/pipermail/users/2019-April/033130.html Removing them simplifies the configuration. If there is a real user need which shows up after the removal, we can resurrect them on demand. Using CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE would have required the use of the undocumented CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME and CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE configuration options. Update #3874.
* posix: Remove <rtems/posix/ptimer.h>Sebastian Huber2020-02-171-1/+0
| | | | | This file contained duplicate prototypes for standard POSIX functions declared in <time.h>.
* score: Move thread stack allocationSebastian Huber2020-02-121-5/+15
| | | | | | Move thread stack allocation to caller side of _Thread_Initialize(). Update #3835.
* score: Add Thread_ConfigurationSebastian Huber2020-02-121-27/+24
| | | | | | | | | Add the Thread_Configuration structure to reduce the parameter count of _Thread_Initialize(). This makes it easier to add more parameters in the future. It simplifies the code generation since most architectures do not have that many registers available for function parameters. Update #3835.
* score: Simplify FP context allocationSebastian Huber2020-02-121-7/+7
| | | | | | | | | | | Use the stack area to allocate the FP context. This considerably simplifies the application configuration since the task count no longer influences the configured work space size. With this change the stack space size is overestimated since an FP context for each thread is accounted. Memory constraint applications can use the stack size for fine tuning. Update #3835.
* Add TOD Hooks to allow BSP to take action when TOD is setJoel Sherrill2019-12-111-4/+12
| | | | | | | | | | | | Two use cases were envisioned for this. 1) a BSP or application which desires to update a real-time clock when the RTEMS TOD is set. 2) a paravirtualized BSP can use this to propagate setting the time in an RTEMS application to the hosting environment. This enables the entire set of applications in the virtualized environments to have a single consistent TOD.
* Move feature macro before "config.h" includeSebastian Huber2019-11-197-11/+17
| | | | | | | This allows to use header includes in "config.h" to reduce the build configuration checks. Update #3818.
* Correct initial POSIX signals maskJoel Sherrill2019-09-241-5/+48
| | | | | | | | | | | | + Modify POSIX thread create extension to ensure expected initial signal mask is provided to system threads, initial tasks and threads, and inheritied by tasks and threads. + Adds psxsignal07 to verify functionality when using a POSIX Initialization thread and POSIX threads. + Adds psxsignal08 to verify functionality when using a Classic API Initialization task and Classic API tasks. Closes #3794.
* score: Use an ISR lock for Per_CPU_Control::LockSebastian Huber2019-04-122-8/+16
| | | | | | The use of a hand crafted lock for Per_CPU_Control::Lock was necessary at some point in the SMP support development, but it is no longer justified.
* posix: Avoid fatal error in Shm object createSebastian Huber2019-04-101-1/+5
|
* posix: Avoid workspace for queued signalsSebastian Huber2019-04-102-18/+12
|
* posix: _Configuration_POSIX_Maximum_queued_signalsSebastian Huber2019-04-102-2/+2
| | | | Rename to use proper namespace.