[6c2675d] | 1 | /** |
---|
| 2 | * @file rtems/posix/pthread.h |
---|
| 3 | */ |
---|
| 4 | |
---|
[5e9b32b] | 5 | /* rtems/posix/pthread.h |
---|
| 6 | * |
---|
| 7 | * This include file contains all the private support information for |
---|
| 8 | * POSIX threads. |
---|
| 9 | * |
---|
[08311cc3] | 10 | * COPYRIGHT (c) 1989-1999. |
---|
[5e9b32b] | 11 | * On-Line Applications Research Corporation (OAR). |
---|
| 12 | * |
---|
[98e4ebf5] | 13 | * The license and distribution terms for this file may be |
---|
| 14 | * found in the file LICENSE in this distribution or at |
---|
[8e36f29] | 15 | * http://www.rtems.com/license/LICENSE. |
---|
[5e9b32b] | 16 | * |
---|
| 17 | * $Id$ |
---|
| 18 | */ |
---|
[874297f3] | 19 | |
---|
[5ec2f12d] | 20 | #ifndef _RTEMS_POSIX_PTHREAD_H |
---|
| 21 | #define _RTEMS_POSIX_PTHREAD_H |
---|
[874297f3] | 22 | |
---|
[5e9b32b] | 23 | #ifdef __cplusplus |
---|
| 24 | extern "C" { |
---|
| 25 | #endif |
---|
| 26 | |
---|
[5a18e04] | 27 | #include <rtems/posix/config.h> |
---|
| 28 | #include <rtems/posix/threadsup.h> |
---|
| 29 | |
---|
[ed5a518] | 30 | #define PTHREAD_MINIMUM_STACK_SIZE (STACK_MINIMUM_SIZE * 2) |
---|
| 31 | |
---|
[5e9b32b] | 32 | /* |
---|
| 33 | * The following defines the information control block used to manage |
---|
| 34 | * this class of objects. |
---|
| 35 | */ |
---|
[874297f3] | 36 | |
---|
[c627b2a3] | 37 | POSIX_EXTERN Objects_Information _POSIX_Threads_Information; |
---|
[5a18e04] | 38 | |
---|
| 39 | /* |
---|
[dd32d883] | 40 | * These are used to manage the user initialization threads. |
---|
[5a18e04] | 41 | */ |
---|
[874297f3] | 42 | |
---|
| 43 | POSIX_EXTERN posix_initialization_threads_table |
---|
[dd32d883] | 44 | *_POSIX_Threads_User_initialization_threads; |
---|
[39cefdd] | 45 | POSIX_EXTERN uint32_t _POSIX_Threads_Number_of_initialization_threads; |
---|
[5a18e04] | 46 | |
---|
[535db3ae] | 47 | extern const pthread_attr_t _POSIX_Threads_Default_attributes; |
---|
[874297f3] | 48 | |
---|
[5e9b32b] | 49 | /* |
---|
| 50 | * _POSIX_Threads_Manager_initialization |
---|
| 51 | * |
---|
| 52 | * DESCRIPTION: |
---|
| 53 | * |
---|
| 54 | * This routine performs the initialization necessary for this manager. |
---|
| 55 | */ |
---|
[874297f3] | 56 | |
---|
[5e9b32b] | 57 | void _POSIX_Threads_Manager_initialization( |
---|
[39cefdd] | 58 | uint32_t maximum_pthreads, |
---|
| 59 | uint32_t number_of_initialization_threads, |
---|
[dd32d883] | 60 | posix_initialization_threads_table *user_threads |
---|
[5e9b32b] | 61 | ); |
---|
[874297f3] | 62 | |
---|
[5e9b32b] | 63 | /* |
---|
| 64 | * _POSIX_Threads_Allocate |
---|
| 65 | * |
---|
| 66 | * DESCRIPTION: |
---|
| 67 | * |
---|
| 68 | * This function allocates a pthread control block from |
---|
| 69 | * the inactive chain of free pthread control blocks. |
---|
| 70 | */ |
---|
[874297f3] | 71 | |
---|
[503dc058] | 72 | RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ); |
---|
[874297f3] | 73 | |
---|
[5e9b32b] | 74 | /* |
---|
| 75 | * _POSIX_Threads_Free |
---|
| 76 | * |
---|
| 77 | * DESCRIPTION: |
---|
| 78 | * |
---|
| 79 | * This routine frees a pthread control block to the |
---|
| 80 | * inactive chain of free pthread control blocks. |
---|
| 81 | */ |
---|
[874297f3] | 82 | |
---|
[503dc058] | 83 | RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free( |
---|
[4427a64] | 84 | Thread_Control *the_pthread |
---|
[5e9b32b] | 85 | ); |
---|
[874297f3] | 86 | |
---|
[5e9b32b] | 87 | /* |
---|
| 88 | * _POSIX_Threads_Get |
---|
| 89 | * |
---|
| 90 | * DESCRIPTION: |
---|
| 91 | * |
---|
| 92 | * This function maps pthread IDs to pthread control blocks. |
---|
| 93 | * If ID corresponds to a local pthread, then it returns |
---|
| 94 | * the_pthread control pointer which maps to ID and location |
---|
| 95 | * is set to OBJECTS_LOCAL. if the pthread ID is global and |
---|
| 96 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
| 97 | * and the_pthread is undefined. Otherwise, location is set |
---|
| 98 | * to OBJECTS_ERROR and the_pthread is undefined. |
---|
| 99 | */ |
---|
[874297f3] | 100 | |
---|
[503dc058] | 101 | RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get( |
---|
[4427a64] | 102 | pthread_t id, |
---|
[5e9b32b] | 103 | Objects_Locations *location |
---|
| 104 | ); |
---|
[874297f3] | 105 | |
---|
[5e9b32b] | 106 | /* |
---|
| 107 | * _POSIX_Threads_Is_null |
---|
| 108 | * |
---|
| 109 | * DESCRIPTION: |
---|
| 110 | * |
---|
| 111 | * This function returns TRUE if the_pthread is NULL and FALSE otherwise. |
---|
| 112 | */ |
---|
[874297f3] | 113 | |
---|
[503dc058] | 114 | RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( |
---|
[4427a64] | 115 | Thread_Control *the_pthread |
---|
[5e9b32b] | 116 | ); |
---|
| 117 | |
---|
[535db3ae] | 118 | /* |
---|
| 119 | * _POSIX_Threads_Sporadic_budget_callout |
---|
| 120 | * |
---|
| 121 | * DESCRIPTION: |
---|
| 122 | * |
---|
| 123 | * This routine handles the sporadic scheduling algorithm. |
---|
| 124 | */ |
---|
| 125 | |
---|
| 126 | void _POSIX_Threads_Sporadic_budget_callout( |
---|
| 127 | Thread_Control *the_thread |
---|
| 128 | ); |
---|
| 129 | |
---|
| 130 | /* |
---|
| 131 | * _POSIX_Threads_Sporadic_budget_TSR |
---|
| 132 | * |
---|
| 133 | * DESCRIPTION: |
---|
| 134 | * |
---|
| 135 | * This routine supports the sporadic scheduling algorithm. |
---|
| 136 | */ |
---|
| 137 | |
---|
| 138 | void _POSIX_Threads_Sporadic_budget_TSR( |
---|
| 139 | Objects_Id id, |
---|
| 140 | void *argument |
---|
| 141 | ); |
---|
| 142 | |
---|
[5e9b32b] | 143 | #include <rtems/posix/pthread.inl> |
---|
[97e2729d] | 144 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[5e9b32b] | 145 | #include <rtems/posix/pthreadmp.h> |
---|
[97e2729d] | 146 | #endif |
---|
[5e9b32b] | 147 | |
---|
| 148 | #ifdef __cplusplus |
---|
| 149 | } |
---|
| 150 | #endif |
---|
[874297f3] | 151 | |
---|
[5e9b32b] | 152 | #endif |
---|
| 153 | /* end of include file */ |
---|