OSDN Git Service

Eliminate GKI_run and GKI_stop. Neither had any effect.
authorSharvil Nanavati <sharvil@google.com>
Sat, 6 Sep 2014 23:46:46 +0000 (16:46 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Mon, 16 Mar 2015 23:51:33 +0000 (16:51 -0700)
GKI_run was called but didn't do anything: it would call
sched_setscheduler to increase the priority of the current process
but Android OS policy doesn't allow for that. And GKI_stop was never
called.

gki/common/gki.h
gki/ulinux/gki_int.h
gki/ulinux/gki_ulinux.c
main/bte_main.c

index 94b0ded..a56e229 100644 (file)
@@ -146,8 +146,6 @@ GKI_API extern UINT8   GKI_get_taskid(void);
 GKI_API extern void    GKI_init(void);
 GKI_API extern void    GKI_shutdown(void);
 GKI_API extern const char *GKI_map_taskname(UINT8);
-GKI_API extern void    GKI_run(void);
-GKI_API extern void    GKI_stop(void);
 
 /* To send buffers and events between tasks
 */
index 364e830..edac207 100644 (file)
 #define GKI_LINUX_BASE_POLICY GKI_SCHED_NORMAL
 #endif
 
-/* GKI timer bases should use GKI_SCHED_FIFO to ensure the least jitter possible */
-#ifndef GKI_LINUX_TIMER_POLICY
-#define GKI_LINUX_TIMER_POLICY GKI_SCHED_FIFO
-#endif
-
-/* the GKI_timer_update() thread should have the highest real time priority to ensue correct
- * timer expiry.
- */
-#ifndef GKI_LINUX_TIMER_TICK_PRIORITY
-#define GKI_LINUX_TIMER_TICK_PRIORITY GKI_LINUX_BASE_PRIORITY+2
-#endif
-
 typedef struct
 {
     pthread_mutex_t     GKI_mutex;
index e03e186..24ac8af 100644 (file)
@@ -452,93 +452,6 @@ void GKI_shutdown(void)
 #endif
 }
 
-/*****************************************************************************
-**
-** Function        gki_set_timer_scheduling
-**
-** Description     helper function to set scheduling policy and priority of btdl
-**
-** Returns         void
-**
-*******************************************************************************/
-
-static void gki_set_timer_scheduling( void )
-{
-    pid_t               main_pid = getpid();
-    struct sched_param  param;
-    int                 policy;
-
-    policy = sched_getscheduler(main_pid);
-
-    if ( policy != -1 )
-    {
-        GKI_TRACE("gki_set_timer_scheduling(()::scheduler current policy: %d", policy);
-
-        /* ensure highest priority in the system + 2 to allow space for read threads */
-        param.sched_priority = GKI_LINUX_TIMER_TICK_PRIORITY;
-
-        if ( 0!=sched_setscheduler(main_pid, GKI_LINUX_TIMER_POLICY, &param ) )
-        {
-            GKI_TRACE("sched_setscheduler() failed with error: %d", errno);
-        }
-    }
-    else
-    {
-        GKI_TRACE( "getscheduler failed: %d", errno);
-    }
-}
-
-
-/*****************************************************************************
-**
-** Function        GKI_run
-**
-** Description     Main GKI loop
-**
-** Returns
-**
-*******************************************************************************/
-
-void GKI_run(void)
-{
-    /* adjust btld scheduling scheme now */
-    gki_set_timer_scheduling();
-    GKI_TRACE( "GKI_run(): Start/Stop GKI_timer_update_registered!" );
-}
-
-
-/*******************************************************************************
-**
-** Function         GKI_stop
-**
-** Description      This function is called to stop
-**                  the tasks and timers when the system is being stopped
-**
-** Returns          void
-**
-** NOTE             This function is NOT called by the Broadcom stack and
-**                  profiles. If you want to use it in your own implementation,
-**                  put specific code here.
-**
-*******************************************************************************/
-
-void GKI_stop (void)
-{
-    UINT8 task_id;
-
-    /*  gki_queue_timer_cback(FALSE); */
-    /* TODO - add code here if needed*/
-
-    for(task_id = 0; task_id<GKI_MAX_TASKS; task_id++)
-    {
-        if(gki_cb.com.OSRdyTbl[task_id] != TASK_DEAD)
-        {
-            GKI_exit_task(task_id);
-        }
-    }
-}
-
-
 /*******************************************************************************
 **
 ** Function         GKI_wait
index ec70c87..6ec6eb1 100755 (executable)
@@ -248,8 +248,6 @@ void bte_main_enable()
     BTU_StartUp();
 
     bte_hci_enable();
-
-    GKI_run();
 }
 
 /******************************************************************************