nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright (C) 1999-2012 Broadcom Corporation |
| 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 | #ifndef GKI_INT_H |
| 19 | #define GKI_INT_H |
| 20 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 21 | #include <pthread.h> |
nxf24591 | c1cbeab | 2018-02-21 17:32:26 +0530 | [diff] [blame] | 22 | #include "gki_common.h" |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 23 | |
| 24 | /********************************************************************** |
| 25 | ** OS specific definitions |
| 26 | */ |
| 27 | #ifdef ANDROID |
| 28 | #include <sys/times.h> |
| 29 | #endif |
| 30 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 31 | typedef struct { |
| 32 | pthread_mutex_t GKI_mutex; |
| 33 | pthread_t thread_id[GKI_MAX_TASKS]; |
| 34 | pthread_mutex_t thread_evt_mutex[GKI_MAX_TASKS]; |
| 35 | pthread_cond_t thread_evt_cond[GKI_MAX_TASKS]; |
| 36 | pthread_mutex_t thread_timeout_mutex[GKI_MAX_TASKS]; |
| 37 | pthread_cond_t thread_timeout_cond[GKI_MAX_TASKS]; |
| 38 | int no_timer_suspend; /* 1: no suspend, 0 stop calling GKI_timer_update() */ |
| 39 | pthread_mutex_t gki_timer_mutex; |
| 40 | pthread_cond_t gki_timer_cond; |
| 41 | int gki_timer_wake_lock_on; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 42 | } tGKI_OS; |
| 43 | |
| 44 | /* condition to exit or continue GKI_run() timer loop */ |
| 45 | #define GKI_TIMER_TICK_RUN_COND 1 |
| 46 | #define GKI_TIMER_TICK_STOP_COND 0 |
| 47 | #define GKI_TIMER_TICK_EXIT_COND 2 |
| 48 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 49 | extern void gki_system_tick_start_stop_cback(bool start); |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 50 | |
| 51 | /* Contains common control block as well as OS specific variables */ |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 52 | typedef struct { |
| 53 | tGKI_OS os; |
| 54 | tGKI_COM_CB com; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 55 | } tGKI_CB; |
| 56 | |
nxpandroid | 8f6d053 | 2017-07-12 18:25:30 +0530 | [diff] [blame] | 57 | extern tGKI_CB gki_cb; |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 58 | |
nxpandroid | c761165 | 2015-09-23 16:42:05 +0530 | [diff] [blame] | 59 | #endif |