* limitations under the License.
*
******************************************************************************/
-#ifndef GKI_INT_H
-#define GKI_INT_H
-#include "gki_common.h"
+#pragma once
+
#include <pthread.h>
-#include <sys/prctl.h>
+
+#include "gki_common.h"
/**********************************************************************
** OS specific definitions
pthread_t thread_id[GKI_MAX_TASKS];
pthread_mutex_t thread_evt_mutex[GKI_MAX_TASKS];
pthread_cond_t thread_evt_cond[GKI_MAX_TASKS];
- pthread_mutex_t thread_timeout_mutex[GKI_MAX_TASKS];
- pthread_cond_t thread_timeout_cond[GKI_MAX_TASKS];
#if (GKI_DEBUG == TRUE)
pthread_mutex_t GKI_trace_mutex;
#endif
} tGKI_OS;
-extern void gki_system_tick_start_stop_cback(BOOLEAN start);
-
/* Contains common control block as well as OS specific variables */
typedef struct
{
tGKI_COM_CB com;
} tGKI_CB;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int acquire_wake_lock(int lock, const char* id);
-extern int release_wake_lock(const char* id);
-
#if GKI_DYNAMIC_MEMORY == FALSE
GKI_API extern tGKI_CB gki_cb;
#else
GKI_API extern tGKI_CB *gki_cb_ptr;
#define gki_cb (*gki_cb_ptr)
#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
*****************************************************************************/
#include "bt_target.h"
+#define LOG_TAG "bt_gki"
+
#include <assert.h>
+#include <hardware/bluetooth.h>
+#include <sys/prctl.h>
#include <sys/times.h>
+#include <utils/Log.h>
#include "alarm.h"
#include "bt_utils.h"
#include "gki_int.h"
#include "osi.h"
-#define LOG_TAG "GKI_LINUX"
-
-#include <utils/Log.h>
-#include <hardware/bluetooth.h>
-
/*****************************************************************************
** Constants & Macros
******************************************************************************/
#endif
p_os = &gki_cb.os;
pthread_mutex_init(&p_os->GKI_mutex, &attr);
- /* pthread_mutex_init(&GKI_sched_mutex, NULL); */
#if (GKI_DEBUG == TRUE)
pthread_mutex_init(&p_os->GKI_trace_mutex, NULL);
#endif
UINT8 *p;
struct sched_param param;
int policy, ret = 0;
- pthread_attr_t attr1;
GKI_TRACE( "GKI_create_task %x %d %s", (int)task_entry, (int)task_id, taskname);
pthread_mutex_init(&gki_cb.os.thread_evt_mutex[task_id], NULL);
pthread_cond_init (&gki_cb.os.thread_evt_cond[task_id], &cond_attr);
- pthread_mutex_init(&gki_cb.os.thread_timeout_mutex[task_id], NULL);
- pthread_cond_init (&gki_cb.os.thread_timeout_cond[task_id], NULL);
-
- pthread_attr_init(&attr1);
/* On Android, the new tasks starts running before 'gki_cb.os.thread_id[task_id]' is initialized */
/* Pass task_id to new task so it can initialize gki_cb.os.thread_id[task_id] for it calls GKI_wait */
gki_pthread_info[task_id].params = 0;
ret = pthread_create( &gki_cb.os.thread_id[task_id],
- &attr1,
+ NULL,
(void *)gki_task_entry,
&gki_pthread_info[task_id]);
/* Destroy mutex and condition variable objects */
pthread_mutex_destroy(&gki_cb.os.thread_evt_mutex[task_id]);
pthread_cond_destroy (&gki_cb.os.thread_evt_cond[task_id]);
- pthread_mutex_destroy(&gki_cb.os.thread_timeout_mutex[task_id]);
- pthread_cond_destroy (&gki_cb.os.thread_timeout_cond[task_id]);
GKI_enable();