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/12 15:37:01 UTC

incubator-mynewt-core git commit: os - Move callout list init from data to text

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop eb24b4d83 -> f27fdb23d


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/f27fdb23
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f27fdb23
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f27fdb23

Branch: refs/heads/develop
Commit: f27fdb23d5628a7f5ea8beb5d0293b1679f67aaf
Parents: eb24b4d
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 08:36:52 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/f27fdb23/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/f27fdb23/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/f27fdb23/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