You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/07/13 20:55:52 UTC

[39/50] [abbrv] incubator-mynewt-core git commit: os - Move callout list init from data to text

os - Move callout list init from data to text

This ensures the callout list gets initialized every time the OS is
initialized.  There were issues with stale callouts when unit tests
restarted the OS.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/a5ab3ed2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/a5ab3ed2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/a5ab3ed2

Branch: refs/heads/develop
Commit: a5ab3ed25751ae6b1e3720f361fe694204d01546
Parents: 2fbc2b6
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Jul 11 20:22:53 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Jul 12 16:48:06 2016 -0700

----------------------------------------------------------------------
 libs/os/src/os.c         | 3 +++
 libs/os/src/os_callout.c | 4 ++--
 libs/os/src/os_priv.h    | 2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a5ab3ed2/libs/os/src/os.c
----------------------------------------------------------------------
diff --git a/libs/os/src/os.c b/libs/os/src/os.c
index 5ec71ec..cbca765 100644
--- a/libs/os/src/os.c
+++ b/libs/os/src/os.c
@@ -19,6 +19,7 @@
 
 #include "os/os.h"
 #include "os/queue.h"
+#include "os_priv.h"
 
 #include "hal/hal_os_tick.h"
 
@@ -105,6 +106,8 @@ os_init(void)
 {
     os_error_t err;
 
+    TAILQ_INIT(&g_callout_list);
+
     err = os_arch_os_init();
     assert(err == OS_OK);
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a5ab3ed2/libs/os/src/os_callout.c
----------------------------------------------------------------------
diff --git a/libs/os/src/os_callout.c b/libs/os/src/os_callout.c
index 02462c0..bc36a19 100644
--- a/libs/os/src/os_callout.c
+++ b/libs/os/src/os_callout.c
@@ -18,12 +18,12 @@
  */
 
 #include "os/os.h"
+#include "os_priv.h"
 
 #include <assert.h>
 #include <string.h>
 
-TAILQ_HEAD(, os_callout) g_callout_list =
-  TAILQ_HEAD_INITIALIZER(g_callout_list);
+struct os_callout_list g_callout_list;
 
 static void
 _os_callout_init(struct os_callout *c, struct os_eventq *evq, void *ev_arg)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a5ab3ed2/libs/os/src/os_priv.h
----------------------------------------------------------------------
diff --git a/libs/os/src/os_priv.h b/libs/os/src/os_priv.h
index dfc9e38..9566546 100644
--- a/libs/os/src/os_priv.h
+++ b/libs/os/src/os_priv.h
@@ -21,10 +21,12 @@
 #define H_OS_PRIV_
 
 TAILQ_HEAD(os_task_list, os_task);
+TAILQ_HEAD(os_callout_list, os_callout);
 
 extern struct os_task_list g_os_run_list;
 extern struct os_task_list g_os_sleep_list;
 extern struct os_task_list g_os_task_list;
 extern struct os_task *g_current_task;
+extern struct os_callout_list g_callout_list;
 
 #endif