summaryrefslogtreecommitdiff
path: root/ace/os_include/vxworks.h
blob: 9fece194ef8aae3635bf138e7a94a895e78d9272 (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* -*- C++ -*- */

//=============================================================================
/**
 *  @file    vxworks.h
 *
 *  $Id$
 *
 *  @author Douglas C. Schmidt (schmidt@cs.wustl.edu)
 *  @author etc
 */
//=============================================================================

#ifndef ACE_OS_INCLUDE_VXWORKS_H
# define ACE_OS_INCLUDE_VXWORKS_H
# include "ace/pre.h"

# include "ace/config-all.h"

# if !defined (ACE_LACKS_PRAGMA_ONCE)
#   pragma once
# endif /* ACE_LACKS_PRAGMA_ONCE */

// this one is still broken! ;-(



# if defined (VXWORKS)
// For mutex implementation using mutual-exclusion semaphores (which
// can be taken recursively).
#   include /**/ <semLib.h>

#   include /**/ <envLib.h>
#   include /**/ <hostLib.h>
#   include /**/ <ioLib.h>
#   include /**/ <remLib.h>
#   include /**/ <selectLib.h>
#   include /**/ <sigLib.h>
#   include /**/ <sockLib.h>
#   include /**/ <sysLib.h>
#   include /**/ <taskLib.h>
#   include /**/ <taskHookLib.h>

extern "C"
struct sockaddr_un {
  short sun_family;    // AF_UNIX.
  char  sun_path[108]; // path name.
};

#   define MAXPATHLEN  1024
#   define MAXNAMLEN   255
#   define NSIG (_NSIGS + 1)

// task options:  the other options are either obsolete, internal, or for
// Fortran or Ada support
#   define VX_UNBREAKABLE        0x0002  /* breakpoints ignored */
#   define VX_FP_TASK            0x0008  /* floating point coprocessor */
#   define VX_PRIVATE_ENV        0x0080  /* private environment support */
#   define VX_NO_STACK_FILL      0x0100  /* do not stack fill for
                                              checkstack () */

#   define THR_CANCEL_DISABLE      0
#   define THR_CANCEL_ENABLE       0
#   define THR_CANCEL_DEFERRED     0
#   define THR_CANCEL_ASYNCHRONOUS 0
#   define THR_BOUND               0
#   define THR_NEW_LWP             0
#   define THR_DETACHED            0
#   define THR_SUSPENDED           0
#   define THR_DAEMON              0
#   define THR_JOINABLE            0
#   define THR_SCHED_FIFO          0
#   define THR_SCHED_RR            0
#   define THR_SCHED_DEFAULT       0
#   define THR_INHERIT_SCHED       0
#   define THR_EXPLICIT_SCHED      0
#   define THR_SCHED_IO            0
#   define THR_SCOPE_SYSTEM        0
#   define THR_SCOPE_PROCESS       0
#   define USYNC_THREAD            0
#   define USYNC_PROCESS           1 /* It's all global on VxWorks
                                          (without MMU option). */
#   if !defined (ACE_DEFAULT_SYNCH_TYPE)
 // Types include these options: SEM_Q_PRIORITY, SEM_Q_FIFO,
 // SEM_DELETE_SAFE, and SEM_INVERSION_SAFE.  SEM_Q_FIFO is
 // used as the default because that is VxWorks' default.
#     define ACE_DEFAULT_SYNCH_TYPE SEM_Q_FIFO
#   endif /* ! ACE_DEFAULT_SYNCH_TYPE */

typedef SEM_ID ACE_mutex_t;
// Implement ACE_thread_mutex_t with ACE_mutex_t because there's just
// one process . . .
typedef ACE_mutex_t ACE_thread_mutex_t;
#   if !defined (ACE_HAS_POSIX_SEM)
// Use VxWorks semaphores, wrapped ...
typedef struct
{
  SEM_ID sema_;
  // Semaphore handle.  This is allocated by VxWorks.

  char *name_;
  // Name of the semaphore:  always NULL with VxWorks.
} ACE_sema_t;
#   endif /* !ACE_HAS_POSIX_SEM */
typedef char * ACE_thread_t;
typedef int ACE_hthread_t;
// Key type: the ACE TSS emulation requires the key type be unsigned,
// for efficiency.  (Current POSIX and Solaris TSS implementations also
// use u_int, so the ACE TSS emulation is compatible with them.)
typedef u_int ACE_thread_key_t;

      // Marker for ACE_Thread_Manager to indicate that it allocated
      // an ACE_thread_t.  It is placed at the beginning of the ID.
#   define ACE_THR_ID_ALLOCATED '\022'
# endif /* VXWORKS */

#endif /* ACE_OS_INCLUDE_VXWORKS_H */