source: rtems/cpukit/sapi/src/posixapi.c @ ef1a985

Last change on this file since ef1a985 was ef1a985, checked in by Sebastian Huber <sebastian.huber@…>, on Dec 11, 2015 at 9:47:22 AM

Optional POSIX Threads initialization

Update #2408.

  • Property mode set to 100644
File size: 1.9 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.org/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/priorityimpl.h>
40#include <rtems/posix/psignalimpl.h>
41#include <rtems/posix/rwlockimpl.h>
42#include <rtems/posix/timerimpl.h>
43#include <rtems/posix/semaphoreimpl.h>
44#include <rtems/posix/spinlockimpl.h>
45#endif
46
47void _POSIX_Fatal_error( POSIX_Fatal_domain domain, int eno )
48{
49  uint32_t code = ( domain << 8 ) | ( ( uint32_t ) eno & 0xffU );
50
51  _Terminate( INTERNAL_ERROR_POSIX_API, false, code );
52}
53
54void _POSIX_API_Initialize(void)
55{
56  /*
57   * If there are any type size assumptions in the POSIX API, this is
58   * the appropriate place to place them.
59   *
60   * Currently, there are no none type size assumptions.
61   */
62
63  _POSIX_Key_Manager_initialization();
64
65  #ifdef RTEMS_POSIX_API
66    _POSIX_Condition_variables_Manager_initialization();
67    _POSIX_Mutex_Manager_initialization();
68    _POSIX_Message_queue_Manager_initialization();
69    _POSIX_Semaphore_Manager_initialization();
70    _POSIX_Timer_Manager_initialization();
71    _POSIX_Barrier_Manager_initialization();
72    _POSIX_RWLock_Manager_initialization();
73    _POSIX_Spinlock_Manager_initialization();
74  #endif
75}
Note: See TracBrowser for help on using the repository browser.