diff options
author | Zach Johnson <zachoverflow@google.com> | 2014-09-23 20:25:47 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2015-03-16 16:51:35 -0700 |
commit | 3e130f3265c4db6134296d621abe8327fc9c918c (patch) | |
tree | ed575878040913a7bba3987cce3b02d60721b744 /gki/ulinux/gki_ulinux.c | |
parent | 093948aaec3d88f3e52cae28b286d694f2645f82 (diff) | |
download | android_system_bt-3e130f3265c4db6134296d621abe8327fc9c918c.tar.gz android_system_bt-3e130f3265c4db6134296d621abe8327fc9c918c.tar.bz2 android_system_bt-3e130f3265c4db6134296d621abe8327fc9c918c.zip |
Modulizification of GKI
Diffstat (limited to 'gki/ulinux/gki_ulinux.c')
-rw-r--r-- | gki/ulinux/gki_ulinux.c | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/gki/ulinux/gki_ulinux.c b/gki/ulinux/gki_ulinux.c index e7eb59fb8..4ad88d1e2 100644 --- a/gki/ulinux/gki_ulinux.c +++ b/gki/ulinux/gki_ulinux.c @@ -37,6 +37,7 @@ #include "alarm.h" #include "bt_utils.h" #include "gki_int.h" +#include "module.h" #include "osi.h" /***************************************************************************** @@ -90,18 +91,7 @@ void alarm_service_reschedule() { ALOGV("%s no more alarms.", __func__); } -/******************************************************************************* -** -** Function GKI_init -** -** Description This function is called once at startup to initialize -** all the timer structures. -** -** Returns void -** -*******************************************************************************/ - -void GKI_init(void) +static future_t *init(void) { pthread_mutexattr_t attr; tGKI_OS *p_os; @@ -121,6 +111,7 @@ void GKI_init(void) #endif p_os = &gki_cb.os; pthread_mutex_init(&p_os->GKI_mutex, &attr); + return NULL; } @@ -138,20 +129,7 @@ UINT32 GKI_get_os_tick_count(void) return gki_cb.com.OSTicks; } -/******************************************************************************* -** -** Function GKI_shutdown -** -** Description shutdowns the GKI tasks/threads in from max task id to 0 and frees -** pthread resources! -** IMPORTANT: in case of join method, GKI_shutdown must be called outside -** a GKI thread context! -** -** Returns void -** -*******************************************************************************/ - -void GKI_shutdown(void) +static future_t *clean_up(void) { alarm_free(alarm_timer); alarm_timer = NULL; @@ -160,8 +138,21 @@ void GKI_shutdown(void) /* Destroy mutex and condition variable objects */ pthread_mutex_destroy(&gki_cb.os.GKI_mutex); + return NULL; } +// Temp module until GKI dies +const module_t gki_module = { + .name = GKI_MODULE, + .init = init, + .start_up = NULL, + .shut_down = NULL, + .clean_up = clean_up, + .dependencies = { + NULL + } +}; + /******************************************************************************* ** ** Function GKI_wait |