#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;
#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<GKI_MAX_TASKS; task_id++)
- {
- if(gki_cb.com.OSRdyTbl[task_id] != TASK_DEAD)
- {
- GKI_exit_task(task_id);
- }
- }
-}
-
-
/*******************************************************************************
**
** Function GKI_wait