1 /****************************************************************************** 2 * 3 * Copyright (C) 1999-2012 Broadcom Corporation 4 * Copyright 2019 NXP 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at: 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 ******************************************************************************/ 19 #ifndef UWB_GKI_INT_H 20 #define UWB_GKI_INT_H 21 22 #include <pthread.h> 23 24 #include "uwb_gki_common.h" 25 26 /********************************************************************** 27 ** OS specific definitions 28 */ 29 #ifdef ANDROID 30 #include <sys/times.h> 31 #endif 32 33 typedef struct { 34 pthread_mutex_t GKI_mutex; 35 pthread_t thread_id[GKI_MAX_TASKS]; 36 pthread_mutex_t thread_evt_mutex[GKI_MAX_TASKS]; 37 pthread_cond_t thread_evt_cond[GKI_MAX_TASKS]; 38 pthread_mutex_t thread_timeout_mutex[GKI_MAX_TASKS]; 39 pthread_cond_t thread_timeout_cond[GKI_MAX_TASKS]; 40 int no_timer_suspend; /* 1: no suspend, 0 stop calling GKI_timer_update() */ 41 pthread_mutex_t gki_timer_mutex; 42 pthread_cond_t gki_timer_cond; 43 int gki_timer_wake_lock_on; 44 } tGKI_OS; 45 46 /* condition to exit or continue GKI_run() timer loop */ 47 #define GKI_TIMER_TICK_RUN_COND 1 48 #define GKI_TIMER_TICK_STOP_COND 0 49 #define GKI_TIMER_TICK_EXIT_COND 2 50 51 extern void phUwb_gki_system_tick_start_stop_cback(bool start); 52 53 /* Contains common control block as well as OS specific variables */ 54 typedef struct { 55 tGKI_OS os; 56 tGKI_COM_CB com; 57 } tGKI_CB; 58 59 extern tGKI_CB gki_cb; 60 61 #endif 62