1 /******************************************************************************
2 *
3 * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
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 /**
19 *******************************************************************************
20 * @file
21 *  ithread.h
22 *
23 * @brief
24 *  This file contains all the necessary structure and  enumeration
25 * definitions needed for the Application  Program Interface(API) of the
26 * Thread Abstraction Layer
27 *
28 * @author
29 *  Harish
30 *
31 * @remarks
32 *  None
33 *
34 *******************************************************************************
35 */
36 #ifndef __ITHREAD_H__
37 #define __ITHREAD_H__
38 
39 UWORD32 ithread_get_handle_size(void);
40 
41 UWORD32 ithread_get_mutex_lock_size(void);
42 
43 WORD32  ithread_create(void *thread_handle, void *attribute, void *strt, void *argument);
44 
45 void    ithread_exit(void *val_ptr);
46 
47 WORD32  ithread_join(void *thread_id, void **val_ptr);
48 
49 WORD32  ithread_get_mutex_struct_size(void);
50 
51 WORD32  ithread_mutex_init(void *mutex);
52 
53 WORD32  ithread_mutex_destroy(void *mutex);
54 
55 WORD32  ithread_mutex_lock(void *mutex);
56 
57 WORD32  ithread_mutex_unlock(void *mutex);
58 
59 void    ithread_yield(void);
60 
61 void    ithread_sleep(UWORD32 u4_time);
62 
63 void    ithread_msleep(UWORD32 u4_time_ms);
64 
65 void    ithread_usleep(UWORD32 u4_time_us);
66 
67 UWORD32 ithread_get_sem_struct_size(void);
68 
69 WORD32  ithread_sem_init(void *sem, WORD32 pshared, UWORD32 value);
70 
71 WORD32  ithread_sem_post(void *sem);
72 
73 WORD32  ithread_sem_wait(void *sem);
74 
75 WORD32  ithread_sem_destroy(void *sem);
76 
77 WORD32 ithread_set_affinity(WORD32 core_id);
78 #endif /* __ITHREAD_H__ */
79