source: rtems/cpukit/include/rtems/posix/pthreadimpl.h @ 3b4795b4

5
Last change on this file since 3b4795b4 was 3b4795b4, checked in by Sebastian Huber <sebastian.huber@…>, on 02/14/20 at 10:20:42

config: Remove CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE

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:

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.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief POSIX Threads Private Support
5 *
6 * This include file contains all the private support information for
7 * POSIX threads.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2011.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_POSIX_PTHREADIMPL_H
20#define _RTEMS_POSIX_PTHREADIMPL_H
21
22#include <rtems/posix/pthread.h>
23#include <rtems/posix/threadsup.h>
24#include <rtems/score/assert.h>
25#include <rtems/score/objectimpl.h>
26#include <rtems/score/timespec.h>
27#include <rtems/score/threadimpl.h>
28#include <rtems/score/watchdogimpl.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/**
35 * @addtogroup POSIX_PTHREAD
36 */
37/**@{**/
38
39/**
40 * The following sets the minimum stack size for POSIX threads.
41 */
42#define PTHREAD_MINIMUM_STACK_SIZE _POSIX_Threads_Minimum_stack_size
43
44#if defined(RTEMS_POSIX_API)
45RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
46  Thread_Control    *the_thread,
47  POSIX_API_Control *api
48)
49{
50  the_thread->cpu_time_budget =
51    _Timespec_To_ticks( &api->Sporadic.sched_ss_init_budget );
52
53  _Watchdog_Per_CPU_insert_ticks(
54    &api->Sporadic.Timer,
55    _Per_CPU_Get(),
56    _Timespec_To_ticks( &api->Sporadic.sched_ss_repl_period )
57  );
58}
59#endif
60
61void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog );
62
63/**
64 * @brief POSIX threads sporadic budget callout.
65 *
66 * This routine handles the sporadic scheduling algorithm.
67 *
68 * @param[in] the_thread is a pointer to the thread whose budget
69 * has been exceeded.
70 */
71void _POSIX_Threads_Sporadic_budget_callout(
72  Thread_Control *the_thread
73);
74
75int _POSIX_Thread_Translate_to_sched_policy(
76  Thread_CPU_budget_algorithms budget_algorithm
77);
78
79/**
80 * @brief Translate sched_param into SuperCore terms.
81 *
82 * This method translates the POSIX API sched_param into the corresponding
83 * SuperCore settings.
84 *
85 * @param[in] policy is the POSIX scheduling policy
86 * @param[in] param points to the scheduling parameter structure
87 * @param[in] budget_algorithm points to the output CPU Budget algorithm
88 * @param[in] budget_callout points to the output CPU Callout
89 *
90 * @retval 0 Indicates success.
91 * @retval error_code POSIX error code indicating failure.
92 */
93int _POSIX_Thread_Translate_sched_param(
94  int                                  policy,
95  const struct sched_param            *param,
96  Thread_CPU_budget_algorithms        *budget_algorithm,
97  Thread_CPU_budget_algorithm_callout *budget_callout
98);
99
100RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void)
101{
102  _Objects_Allocator_lock();
103
104  _Thread_Kill_zombies();
105
106  return (Thread_Control *)
107    _Objects_Allocate_unprotected( &_POSIX_Threads_Information.Objects );
108}
109
110RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
111  Thread_Control *the_pthread
112)
113{
114  _Objects_Free( &_POSIX_Threads_Information.Objects, &the_pthread->Object );
115}
116
117/** @} */
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif
124/*  end of include file */
Note: See TracBrowser for help on using the repository browser.