1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2008. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #if HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <errno.h> |
---|
17 | #include <pthread.h> |
---|
18 | #include <limits.h> |
---|
19 | |
---|
20 | #include <rtems/system.h> |
---|
21 | #include <rtems/config.h> |
---|
22 | #include <rtems/score/coremutex.h> |
---|
23 | #include <rtems/score/watchdog.h> |
---|
24 | #if defined(RTEMS_MULTIPROCESSING) |
---|
25 | #include <rtems/score/mpci.h> |
---|
26 | #endif |
---|
27 | #include <rtems/posix/mutex.h> |
---|
28 | #include <rtems/posix/priority.h> |
---|
29 | #include <rtems/posix/time.h> |
---|
30 | |
---|
31 | /*PAGE |
---|
32 | * |
---|
33 | * _POSIX_Mutex_Manager_initialization |
---|
34 | * |
---|
35 | * This routine initializes all mutex manager related data structures. |
---|
36 | * |
---|
37 | * Input parameters: |
---|
38 | * maximum_mutexes - maximum configured mutexes |
---|
39 | * |
---|
40 | * Output parameters: NONE |
---|
41 | */ |
---|
42 | |
---|
43 | void _POSIX_Mutex_Manager_initialization(void) |
---|
44 | { |
---|
45 | pthread_mutexattr_t *default_attr = &_POSIX_Mutex_Default_attributes; |
---|
46 | |
---|
47 | /* |
---|
48 | * Since the maximum priority is run-time configured, this |
---|
49 | * structure cannot be initialized statically. |
---|
50 | */ |
---|
51 | default_attr->is_initialized = true; |
---|
52 | default_attr->process_shared = PTHREAD_PROCESS_PRIVATE; |
---|
53 | default_attr->prio_ceiling = POSIX_SCHEDULER_MAXIMUM_PRIORITY; |
---|
54 | default_attr->protocol = PTHREAD_PRIO_NONE; |
---|
55 | default_attr->recursive = false; |
---|
56 | #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) |
---|
57 | default_attr->type = PTHREAD_MUTEX_DEFAULT; |
---|
58 | #endif |
---|
59 | |
---|
60 | /* |
---|
61 | * Initialize the POSIX mutex object class information structure. |
---|
62 | */ |
---|
63 | _Objects_Initialize_information( |
---|
64 | &_POSIX_Mutex_Information, /* object information table */ |
---|
65 | OBJECTS_POSIX_API, /* object API */ |
---|
66 | OBJECTS_POSIX_MUTEXES, /* object class */ |
---|
67 | Configuration_POSIX_API.maximum_mutexes, |
---|
68 | /* maximum objects of this class */ |
---|
69 | sizeof( POSIX_Mutex_Control ), |
---|
70 | /* size of this object's control block */ |
---|
71 | true, /* true if names for this object are strings */ |
---|
72 | _POSIX_PATH_MAX /* maximum length of each object's name */ |
---|
73 | #if defined(RTEMS_MULTIPROCESSING) |
---|
74 | , |
---|
75 | false, /* true if this is a global object class */ |
---|
76 | NULL /* Proxy extraction support callout */ |
---|
77 | #endif |
---|
78 | ); |
---|
79 | } |
---|