From b6249384383bd96c13ff4b40c5890ab88b427486 Mon Sep 17 00:00:00 2001 From: Sharvil Nanavati Date: Sat, 6 Sep 2014 16:46:46 -0700 Subject: [PATCH] Eliminate GKI_run and GKI_stop. Neither had any effect. 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 | 2 -- gki/ulinux/gki_int.h | 12 ------- gki/ulinux/gki_ulinux.c | 87 ------------------------------------------------- main/bte_main.c | 2 -- 4 files changed, 103 deletions(-) diff --git a/gki/common/gki.h b/gki/common/gki.h index 94b0ded6c..a56e22915 100644 --- a/gki/common/gki.h +++ b/gki/common/gki.h @@ -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 */ diff --git a/gki/ulinux/gki_int.h b/gki/ulinux/gki_int.h index 364e83050..edac20748 100644 --- a/gki/ulinux/gki_int.h +++ b/gki/ulinux/gki_int.h @@ -41,18 +41,6 @@ #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; diff --git a/gki/ulinux/gki_ulinux.c b/gki/ulinux/gki_ulinux.c index e03e1867a..24ac8afd7 100644 --- a/gki/ulinux/gki_ulinux.c +++ b/gki/ulinux/gki_ulinux.c @@ -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, ¶m ) ) - { - 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