10d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar/****************************************************************************** 20d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 30d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore 40d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 50d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* Licensed under the Apache License, Version 2.0 (the "License"); 60d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* you may not use this file except in compliance with the License. 70d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* You may obtain a copy of the License at: 80d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 90d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* http://www.apache.org/licenses/LICENSE-2.0 100d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 110d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* Unless required by applicable law or agreed to in writing, software 120d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* distributed under the License is distributed on an "AS IS" BASIS, 130d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 140d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* See the License for the specific language governing permissions and 150d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* limitations under the License. 160d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 170d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar******************************************************************************/ 180d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar/** 190d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar******************************************************************************* 200d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* @file 210d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* ithread.h 220d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 230d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* @brief 240d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* This file contains all the necessary structure and enumeration 250d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* definitions needed for the Application Program Interface(API) of the 260d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* Thread Abstraction Layer 270d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 280d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* @author 290d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* Harish 300d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 310d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* @remarks 320d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* None 330d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar* 340d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar******************************************************************************* 350d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar*/ 360d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar#ifndef __ITHREAD_H__ 370d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar#define __ITHREAD_H__ 380d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 390d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarUWORD32 ithread_get_handle_size(void); 400d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 410d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarUWORD32 ithread_get_mutex_lock_size(void); 420d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 430d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_create(void *thread_handle, void *attribute, void *strt, void *argument); 440d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 450d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakarvoid ithread_exit(void *val_ptr); 460d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 470d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_join(void *thread_id, void **val_ptr); 480d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 490d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_get_mutex_struct_size(void); 500d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 510d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_mutex_init(void *mutex); 520d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 530d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_mutex_destroy(void *mutex); 540d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 550d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_mutex_lock(void *mutex); 560d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 570d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_mutex_unlock(void *mutex); 580d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 590d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakarvoid ithread_yield(void); 600d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 610d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakarvoid ithread_sleep(UWORD32 u4_time); 620d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 630d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakarvoid ithread_msleep(UWORD32 u4_time_ms); 640d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 650d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakarvoid ithread_usleep(UWORD32 u4_time_us); 660d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 670d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarUWORD32 ithread_get_sem_struct_size(void); 680d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 690d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_sem_init(void *sem, WORD32 pshared, UWORD32 value); 700d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 710d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_sem_post(void *sem); 720d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 730d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_sem_wait(void *sem); 740d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 750d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_sem_destroy(void *sem); 760d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar 770d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish MahendrakarWORD32 ithread_set_affinity(WORD32 core_id); 780d8951cef4b1a1dbf4ff5ba3e8796cf1d4503098Harish Mahendrakar#endif /* __ITHREAD_H__ */ 79