summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/src/posixapi.c
blob: f1997bfd088cc953da9bc1da1e193ee397d4b0ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
 * @file
 *
 * @brief Initialize POSIX API
 *
 * @ingroup ClassicRTEMS
 */

/*
 *  COPYRIGHT (c) 1989-2014.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.org/license/LICENSE.
 */

#if HAVE_CONFIG_H
#include "config.h"
#endif

#define POSIX_API_INIT

#include <rtems/system.h>    /* include this before checking RTEMS_POSIX_API */

#include <rtems/config.h>
#include <rtems/posix/keyimpl.h>
#include <rtems/posix/posixapi.h>

#ifdef RTEMS_POSIX_API
#include <sys/types.h>
#include <mqueue.h>
#include <rtems/config.h>
#include <rtems/posix/barrierimpl.h>
#include <rtems/posix/config.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/rwlockimpl.h>
#include <rtems/posix/timerimpl.h>
#include <rtems/posix/spinlockimpl.h>
#endif

void _POSIX_Fatal_error( POSIX_Fatal_domain domain, int eno )
{
  uint32_t code = ( domain << 8 ) | ( ( uint32_t ) eno & 0xffU );

  _Terminate( INTERNAL_ERROR_POSIX_API, false, code );
}

void _POSIX_API_Initialize(void)
{
  /*
   * If there are any type size assumptions in the POSIX API, this is
   * the appropriate place to place them.
   *
   * Currently, there are no none type size assumptions.
   */

  _POSIX_Key_Manager_initialization();

  #ifdef RTEMS_POSIX_API
    _POSIX_Timer_Manager_initialization();
    _POSIX_Barrier_Manager_initialization();
    _POSIX_RWLock_Manager_initialization();
    _POSIX_Spinlock_Manager_initialization();
  #endif
}