source: trunk/kernel/syscalls/shared_include/shared_pthread.h @ 445

Last change on this file since 445 was 445, checked in by alain, 4 years ago

Restructure the mini_libc.

File size: 3.8 KB
Line 
1/*
2 * shared_pthread.h - Shared structures and mnemonics used by the pthread related syscalls.
3 *
4 * Author  Alain Greiner (2016,2017,2018)
5 *
6 * Copyright (c) UPMC Sorbonne Universites
7 *
8 * This file is part of ALMOS-MKH.
9 *
10 * ALMOS-MKH is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2.0 of the License.
13 *
14 * ALMOS-MKH is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ALMOS-MKH; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef _SHARED_PTHREAD_H_
25#define _SHARED_PTHREAD_H_
26
27/*******************************************************************************************
28 * These typedef define the POSIX thread related types.
29 ******************************************************************************************/
30
31typedef unsigned int      sem_t;
32typedef unsigned int      pthread_cond_t;
33typedef unsigned int      pthread_condattr_t;
34typedef unsigned int      pthread_rwlock_t;
35typedef unsigned int      pthread_rwlockattr_t;
36typedef unsigned int      pthread_key_t;
37
38/*******************************************************************************************
39 * This structure and enum define the attributes for the pthread_create() syscall.
40 ******************************************************************************************/
41
42typedef unsigned int  pthread_t;               
43
44typedef struct pthread_attr_s
45{
46        unsigned int      attributes;      /*! user defined attributes bit vector             */
47        unsigned int      cxy;             /*! target cluster identifier                      */
48        unsigned int      lid;             /*! target core local index                        */
49}
50pthread_attr_t;
51
52enum
53{
54    PT_ATTR_DETACH          = 0x0001,  /*! user defined not joinable                      */
55    PT_ATTR_CLUSTER_DEFINED = 0x0002,  /*! user defined target cluster                    */
56    PT_ATTR_CORE_DEFINED    = 0x0004,  /*! user defined core index in cluster             */
57};
58
59/*******************************************************************************************
60 * This enum defines the operation mnemonics for operations on POSIX unnamed semaphores.
61 ******************************************************************************************/
62
63typedef enum
64{
65        SEM_INIT,
66        SEM_DESTROY,
67        SEM_GETVALUE,
68        SEM_WAIT,
69        SEM_POST,
70} 
71sem_operation_t;
72
73/*******************************************************************************************
74 * This enum defines the operation mnemonics for operations on POSIX condition variables.
75 ******************************************************************************************/
76
77typedef enum
78{
79        CONDVAR_INIT,
80        CONDVAR_DESTROY,
81    CONDVAR_WAIT,
82    CONDVAR_SIGNAL,
83    CONDVAR_BROADCAST,
84} 
85condvar_operation_t;
86
87/*******************************************************************************************
88 * This enum defines the operation mnemonics for operations on POSIX barriers.
89 ******************************************************************************************/
90
91typedef enum
92{
93        BARRIER_INIT,
94        BARRIER_DESTROY,
95        BARRIER_WAIT,
96} 
97barrier_operation_t;
98
99/*******************************************************************************************
100 * This enum defines the operation mnemonics for operations on POSIX mutex.
101 ******************************************************************************************/
102
103typedef enum
104{
105        MUTEX_INIT,
106        MUTEX_DESTROY,
107        MUTEX_LOCK,
108        MUTEX_UNLOCK,
109} 
110mutex_operation_t;
111
112
113
114#endif  // _PTHREAD_H_
Note: See TracBrowser for help on using the repository browser.