source: rtems/c/src/exec/sapi/src/posixapi.c @ 1007c3c

4.104.114.84.95
Last change on this file since 1007c3c was 1007c3c, checked in by Joel Sherrill <joel.sherrill@…>, on 11/09/99 at 19:54:40

Fixed warning where initialized default POSIX API structure did
have have semaphores and message queue fields.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2 *  RTEMS API Initialization Support
3 *
4 *  NOTE:
5 *
6 *  COPYRIGHT (c) 1989-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#include <assert.h>
18
19/*
20 *  POSIX_API_INIT is defined so all of the POSIX API
21 *  data will be included in this object file.
22 */
23
24#define POSIX_API_INIT
25
26#include <rtems/system.h>    /* include this before checking RTEMS_POSIX_API */
27#ifdef RTEMS_POSIX_API
28
29#include <sys/types.h>
30#include <mqueue.h>
31#include <rtems/config.h>
32#include <rtems/score/object.h>
33#include <rtems/posix/cond.h>
34#include <rtems/posix/config.h>
35#include <rtems/posix/key.h>
36#include <rtems/posix/mqueue.h>
37#include <rtems/posix/mutex.h>
38#include <rtems/posix/priority.h>
39#include <rtems/posix/psignal.h>
40#include <rtems/posix/pthread.h>
41#include <rtems/posix/ptimer.h>
42#include <rtems/posix/semaphore.h>
43#include <rtems/posix/time.h>
44
45/*PAGE
46 *
47 *  _POSIX_API_Initialize
48 *
49 *  XXX
50 */
51
52posix_api_configuration_table _POSIX_Default_configuration = {
53  0,                             /* maximum_threads */
54  0,                             /* maximum_mutexes */
55  0,                             /* maximum_condition_variables */
56  0,                             /* maximum_keys */
57  0,                             /* maximum_timers */
58  0,                             /* maximum_queued_signals */
59  0,                             /* number_of_initialization_threads */
60  0,                             /* maximum_message_queues */
61  0,                             /* maximum_semaphores */
62  NULL                           /* User_initialization_threads_table */
63};
64
65
66void _POSIX_API_Initialize(
67  rtems_configuration_table *configuration_table
68)
69{
70  posix_api_configuration_table *api_configuration;
71
72  /* XXX need to assert here based on size assumptions */
73
74  assert( sizeof(pthread_t) == sizeof(Objects_Id) );
75
76  api_configuration = configuration_table->POSIX_api_configuration;
77  if ( !api_configuration )
78    api_configuration = &_POSIX_Default_configuration;
79
80  _POSIX_signals_Manager_Initialization(
81    api_configuration->maximum_queued_signals
82  );
83
84  _POSIX_Threads_Manager_initialization(
85    api_configuration->maximum_threads,
86    api_configuration->number_of_initialization_threads,
87    api_configuration->User_initialization_threads_table
88  );
89 
90  _POSIX_Condition_variables_Manager_initialization(
91    api_configuration->maximum_condition_variables
92  );
93
94  _POSIX_Key_Manager_initialization( api_configuration->maximum_keys );
95
96  _POSIX_Mutex_Manager_initialization(
97    api_configuration->maximum_mutexes
98  );
99
100  _POSIX_Message_queue_Manager_initialization(
101    api_configuration->maximum_message_queues
102  );
103
104  _POSIX_Semaphore_Manager_initialization(
105    api_configuration->maximum_semaphores
106  );
107
108  _POSIX_Timer_Manager_initialization ( api_configuration->maximum_timers );
109}
110
111#endif
112/* end of file */
Note: See TracBrowser for help on using the repository browser.