• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2009-2022 Huawei Technologies Co., Ltd. All rights reserved.
3  *
4  * UniProton is licensed under Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *          http://license.coscl.org.cn/MulanPSL2
8  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
9  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
10  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
11  * See the Mulan PSL v2 for more details.
12  * Create: 2009-12-22
13  * Description: Hardware interrupt implementation
14  */
15 #ifndef PRT_POSIX_INTERNAL_H
16 #define PRT_POSIX_INTERNAL_H
17 
18 #include "prt_typedef.h"
19 #include "prt_buildef.h"
20 #include "prt_task_external.h"
21 #include "prt_list_external.h"
22 #include "errno.h"
23 
24 #define PRT_SCHED_FIFO          1
25 #define PTHREAD_DEFAULT_POLICY  PRT_SCHED_FIFO
26 
27 #define PTHREAD_DEFAULT_PRIORITY 10
28 #define PTHREAD_OP_FAIL          (-1)
29 
30 #define PTHREAD_ATTR_UNINIT 0
31 #define PTHREAD_ATTR_INIT   1
32 
33 typedef void * (*prt_pthread_startroutine)(void *);
34 
35 extern int PRT_PthreadCreate(TskHandle *thread, const pthread_attr_t *attrp,
36                              prt_pthread_startroutine routine, void *arg);
37 extern void PRT_PthreadExit(void *retval);
38 extern int PRT_PthreadKeyCreate(pthread_key_t *key, void (*destructor)(void *));
39 extern int PRT_PthreadKeyDelete(pthread_key_t key);
40 extern int PRT_PthreadSetSpecific(pthread_key_t key, const void *value);
41 extern void *PRT_PthreadGetSpecific(pthread_key_t key);
42 extern int PRT_PthreadJoin(TskHandle thread, void **status);
43 extern int PRT_PthreadDetach(TskHandle thread);
44 extern void PRT_PthreadTestCancel(void);
45 extern int PRT_PthreadCancel(TskHandle thread);
46 extern int PRT_PthreadSetCancelState(int state, int *oldstate);
47 extern int PRT_PthreadSetCancelType(int type, int *oldType);
48 extern U32 OsTimeSpec2Tick(const struct timespec *tp);
49 extern U32 OsTimeOut2Ticks(const struct timespec *time, U32 *ticks);
50 
51 #endif
52 
53