blob: f926f83aa4036b5e52a4fb70a71aad75e5fbd2b3 [file] [log] [blame]
Hamsalekha S8d3d3032015-03-13 21:24:58 +05301/******************************************************************************
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 Name : ithread.h */
23/* */
24/* Description : This file contains all the necessary structure and */
25/* enumeration definitions needed for the Application */
26/* Program Interface(API) of the */
27/* Thread Abstraction Layer */
28/* */
29/* List of Functions : ithread_get_handle_size */
30/* ithread_get_mutex_lock_size */
31/* ithread_create */
32/* ithread_exit */
33/* ithread_join */
34/* ithread_get_mutex_struct_size */
35/* ithread_mutex_init */
36/* ithread_mutex_destroy */
37/* ithread_mutex_lock */
38/* ithread_mutex_unlock */
39/* ithread_yield */
40/* ithread_sleep */
41/* ithread_msleep */
42/* ithread_usleep */
43/* ithread_get_sem_struct_size */
44/* ithread_sem_init */
45/* ithread_sem_post */
46/* ithread_sem_wait */
47/* ithread_sem_destroy */
48/* ithread_set_affinity */
49/* */
50/* Issues / Problems : None */
51/* */
52/* Revision History : */
53/* */
54/* DD MM YYYY Author(s) Changes */
55/* 06 09 2012 Harish Initial Version */
56/* */
57/*****************************************************************************/
58
59#ifndef _ITHREAD_H_
60#define _ITHREAD_H_
61
62UWORD32 ithread_get_handle_size(void);
63
64UWORD32 ithread_get_mutex_lock_size(void);
65
66WORD32 ithread_create(void *thread_handle, void *attribute, void *strt, void *argument);
67
68void ithread_exit(void *val_ptr);
69
70WORD32 ithread_join(void *thread_id, void ** val_ptr);
71
72WORD32 ithread_get_mutex_struct_size(void);
73
74WORD32 ithread_mutex_init(void *mutex);
75
76WORD32 ithread_mutex_destroy(void *mutex);
77
78WORD32 ithread_mutex_lock(void *mutex);
79
80WORD32 ithread_mutex_unlock(void *mutex);
81
82void ithread_yield(void);
83
84void ithread_sleep(UWORD32 u4_time);
85
86void ithread_msleep(UWORD32 u4_time_ms);
87
88void ithread_usleep(UWORD32 u4_time_us);
89
90UWORD32 ithread_get_sem_struct_size(void);
91
92WORD32 ithread_sem_init(void *sem,WORD32 pshared,UWORD32 value);
93
94WORD32 ithread_sem_post(void *sem);
95
96WORD32 ithread_sem_wait(void *sem);
97
98WORD32 ithread_sem_destroy(void *sem);
99
100WORD32 ithread_set_affinity(WORD32 core_id);
101
102void ithread_set_name(CHAR *pc_thread_name);
103
104#endif /* _ITHREAD_H_ */