source: trunk/kernel/syscalls/shared_include/almos-mkh/pthread.h @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.9 KB
RevLine 
[444]1#ifndef _SHARED_PTHREAD_H_
2#define _SHARED_PTHREAD_H_
3
4/*******************************************************************************************
5 * These typedef define the POSIX thread related types.
6 ******************************************************************************************/
7
8typedef unsigned int      sem_t;
9typedef unsigned int      pthread_cond_t;
10typedef unsigned int      pthread_condattr_t;
11typedef unsigned int      pthread_rwlock_t;
12typedef unsigned int      pthread_rwlockattr_t;
13typedef unsigned int      pthread_key_t;
14
15/*******************************************************************************************
16 * This structure and enum define the attributes for the "pthread_create" syscall.
17 ******************************************************************************************/
18
19typedef unsigned int  pthread_t;               
20
21typedef struct pthread_attr_s
22{
23        unsigned int      attributes;      /*! user defined attributes bit vector             */
24        unsigned int      cxy;             /*! target cluster identifier                      */
25        unsigned int      lid;             /*! target core local index                        */
26}
27pthread_attr_t;
28
29enum
30{
31    PT_ATTR_DETACH          = 0x0001,  /*! user defined not joinable                      */
32    PT_ATTR_CLUSTER_DEFINED = 0x0002,  /*! user defined target cluster                    */
33    PT_ATTR_CORE_DEFINED    = 0x0004,  /*! user defined core index in cluster             */
34};
35
36/*******************************************************************************************
37 * This enum defines the operation mnemonics for operations on POSIX unnamed semaphores.
38 ******************************************************************************************/
39
40typedef enum
41{
42        SEM_INIT,
43        SEM_DESTROY,
44        SEM_GETVALUE,
45        SEM_WAIT,
46        SEM_POST,
47} 
48sem_operation_t;
49
50/*******************************************************************************************
51 * This enum defines the operation mnemonics for operations on POSIX condition variables.
52 ******************************************************************************************/
53
54typedef enum
55{
56        CONDVAR_INIT,
57        CONDVAR_DESTROY,
58    CONDVAR_WAIT,
59    CONDVAR_SIGNAL,
60    CONDVAR_BROADCAST,
61} 
62condvar_operation_t;
63
64/*******************************************************************************************
65 * This enum defines the operation mnemonics for operations on POSIX barriers.
66 ******************************************************************************************/
67
68typedef enum
69{
70        BARRIER_INIT,
71        BARRIER_DESTROY,
72        BARRIER_WAIT,
73} 
74barrier_operation_t;
75
76/*******************************************************************************************
77 * This enum defines the operation mnemonics for operations on POSIX mutex.
78 ******************************************************************************************/
79
80typedef enum
81{
82        MUTEX_INIT,
83        MUTEX_DESTROY,
84        MUTEX_LOCK,
85        MUTEX_UNLOCK,
86} 
87mutex_operation_t;
88
89
90
91#endif  // _PTHREAD_H_
Note: See TracBrowser for help on using the repository browser.