source: rtems/cpukit/sapi/src/posixapi.c @ 4d3e9334

4.115
Last change on this file since 4d3e9334 was e6c87f7, checked in by Joel Sherrill <joel.sherrill@…>, on 03/04/14 at 21:54:12

POSIX keys now enabled in all configurations.

Formerly POSIX keys were only enabled when POSIX threads
were enabled. Because they are a truly safe alternative
to per-task variables in an SMP system, they are being
enabled in all configurations.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief Initialize POSIX API
5 *
6 * @ingroup ClassicRTEMS
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2014.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#define POSIX_API_INIT
23
24#include <rtems/system.h>    /* include this before checking RTEMS_POSIX_API */
25
26#include <rtems/config.h>
27#include <rtems/posix/keyimpl.h>
28#include <rtems/posix/posixapi.h>
29
30#ifdef RTEMS_POSIX_API
31#include <sys/types.h>
32#include <mqueue.h>
33#include <rtems/config.h>
34#include <rtems/posix/barrierimpl.h>
35#include <rtems/posix/config.h>
36#include <rtems/posix/condimpl.h>
37#include <rtems/posix/mqueueimpl.h>
38#include <rtems/posix/muteximpl.h>
39#include <rtems/posix/onceimpl.h>
40#include <rtems/posix/priorityimpl.h>
41#include <rtems/posix/psignalimpl.h>
42#include <rtems/posix/pthreadimpl.h>
43#include <rtems/posix/rwlockimpl.h>
44#include <rtems/posix/timerimpl.h>
45#include <rtems/posix/semaphoreimpl.h>
46#include <rtems/posix/spinlockimpl.h>
47#include <rtems/posix/time.h>
48#endif
49
50void _POSIX_Fatal_error( POSIX_Fatal_domain domain, int eno )
51{
52  uint32_t code = ( domain << 8 ) | ( ( uint32_t ) eno & 0xffU );
53
54  _Terminate( INTERNAL_ERROR_POSIX_API, false, code );
55}
56
57Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ];
58
59void _POSIX_API_Initialize(void)
60{
61  /*
62   * If there are any type size assumptions in the POSIX API, this is
63   * the appropriate place to place them.
64   *
65   * Currently, there are no none type size assumptions.
66   */
67
68  /*
69   * Install our API Object Management Table and initialize the
70   * various managers.
71   */
72  _Objects_Information_table[OBJECTS_POSIX_API] = _POSIX_Objects;
73
74  _POSIX_Key_Manager_initialization();
75
76  #ifdef RTEMS_POSIX_API
77    _POSIX_signals_Manager_Initialization();
78    _POSIX_Threads_Manager_initialization();
79    _POSIX_Condition_variables_Manager_initialization();
80    _POSIX_Mutex_Manager_initialization();
81    _POSIX_Message_queue_Manager_initialization();
82    _POSIX_Once_Manager_initialization();
83    _POSIX_Semaphore_Manager_initialization();
84    _POSIX_Timer_Manager_initialization();
85    _POSIX_Barrier_Manager_initialization();
86    _POSIX_RWLock_Manager_initialization();
87    _POSIX_Spinlock_Manager_initialization();
88  #endif
89}
Note: See TracBrowser for help on using the repository browser.