OSDN Git Service

Remove unused fields from GKI internal header.
authorSharvil Nanavati <sharvil@google.com>
Sun, 7 Sep 2014 01:31:03 +0000 (18:31 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Mon, 16 Mar 2015 23:51:33 +0000 (16:51 -0700)
gki/ulinux/data_types.h
gki/ulinux/gki_int.h
gki/ulinux/gki_ulinux.c

index 14b5899..d73d14e 100644 (file)
@@ -40,8 +40,6 @@ typedef int16_t INT16;
 typedef int32_t INT32;
 typedef bool BOOLEAN;
 
-typedef UINT32          TIME_STAMP;
-
 #ifdef __arm
 #  define PACKED  __packed
 #  define INLINE  __inline
index c996f32..c7cf4af 100644 (file)
  *  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
@@ -32,15 +32,11 @@ typedef struct
     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
 {
@@ -48,23 +44,9 @@ 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
index 7e0ca5f..962a740 100644 (file)
 *****************************************************************************/
 #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
 ******************************************************************************/
@@ -164,7 +164,6 @@ void GKI_init(void)
 #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
@@ -208,7 +207,6 @@ UINT8 GKI_create_task(TASKPTR task_entry, UINT8 task_id, const char *taskname)
     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);
 
@@ -230,10 +228,6 @@ UINT8 GKI_create_task(TASKPTR task_entry, UINT8 task_id, const char *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 */
@@ -242,7 +236,7 @@ UINT8 GKI_create_task(TASKPTR task_entry, UINT8 task_id, const char *taskname)
     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]);
 
@@ -781,8 +775,6 @@ void GKI_exit_task (UINT8 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();