• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright (C) 2015 The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************
18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 /**
21 *******************************************************************************
22 * @file
23 *  ithread.h
24 *
25 * @brief
26 *  This file contains all the necessary structure and  enumeration
27 * definitions needed for the Application  Program Interface(API) of the
28 * Thread Abstraction Layer
29 *
30 * @author
31 *  Harish
32 *
33 * @remarks
34 *  None
35 *
36 *******************************************************************************
37 */
38 #ifndef __ITHREAD_H__
39 #define __ITHREAD_H__
40 
41 UWORD32 ithread_get_handle_size(void);
42 
43 UWORD32 ithread_get_mutex_lock_size(void);
44 
45 WORD32  ithread_create(void *thread_handle, void *attribute, void *strt, void *argument);
46 
47 void    ithread_exit(void *val_ptr);
48 
49 WORD32  ithread_join(void *thread_id, void ** val_ptr);
50 
51 WORD32  ithread_get_mutex_struct_size(void);
52 
53 WORD32 ithread_mutex_init(void *mutex);
54 
55 WORD32 ithread_mutex_destroy(void *mutex);
56 
57 WORD32  ithread_mutex_lock(void *mutex);
58 
59 WORD32  ithread_mutex_unlock(void *mutex);
60 
61 void    ithread_yield(void);
62 
63 void    ithread_sleep(UWORD32 u4_time);
64 
65 void    ithread_msleep(UWORD32 u4_time_ms);
66 
67 void    ithread_usleep(UWORD32 u4_time_us);
68 
69 UWORD32 ithread_get_sem_struct_size(void);
70 
71 WORD32  ithread_sem_init(void *sem,WORD32 pshared,UWORD32 value);
72 
73 WORD32  ithread_sem_post(void *sem);
74 
75 WORD32  ithread_sem_wait(void *sem);
76 
77 WORD32  ithread_sem_destroy(void *sem);
78 
79 WORD32 ithread_set_affinity(WORD32 core_id);
80 #endif /* __ITHREAD_H__ */
81